Deprecate IncludeFile, IncludePath, CompilerIf etc...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Env »

Hello,


A feature I want to suggest is to deprecate all the compiler directives, i.e. IncludeFile, IncludePath, CompilerIf etc, and replace them with a '#' prefix.


So IncludeFile would be #include, or #includefile, the same applies to CompilerIf which would simply become #if, etc.


This would make it a lot more similar to other languages (i.e. C++) and would provide a smoother transition for other programmers coming to/going from PureBasic to other languages.

EDIT: Not to mention, for anyone who creates parsers for the source code, it would be a lot more efficient to be able to extract compiler-directives before parsing the rest of the source code.


Thanks,

Env
Thanks!
User avatar
STARGÅTE
Addict
Addict
Posts: 2226
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by STARGÅTE »

I'm against it!

Because # is already occupied for constants and compiler keywords are no constants, there are keywords!

if you want to use C++, use C++

This is PureBasic!
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Kaeru Gaman »

definitely, # is reserved for constants.

a "smooth transition" from other languages is mostly limited by general syntax rules and generally differnt functionality, but not by a bloody little char in front of a compiler directive.

additionally, a parser needs to parse anyways, no matter if it searches for CompilerIf or #CompilerIf, would be the same.

so, in my eyes there is no use in this request.
oh... and have a nice day.
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Env »

Though wouldn't you agree that it would certainly make it easier to navigate through the code and find the compiler directives?


Constant's are a directive, since they are Constant, they are defined before the rest of the code.


Example A (Current Keywords)

Code: Select all

 
 #App_Title = "Pointless Test"
 #App_Version = "1.0"
 
 IncludeFile "Pointless.pbi"
 
 CompilerIf Defined( WINDOWS, #PB_Constant )
 IncludeFile "Windows_Specific.pbi"
 CompilerEndif
 
 Enumeration
 ...
Example B (Proposed Changes)

Code: Select all

 #App_Title = "Pointless Test"
 #App_Version = "1.0"
 
 #Include "Pointless.pbi"
 
 #If Defined( WINDOWS, #PB_Constant )
 #Include "Windows_Specific.pbi"
 #Endif
 
 Enumeration
I personally believe it's more uniform, which is always a good thing, and if you have a lot of source code to scan through, to find a certain include file, or definition check, then it would certainly be easier to see them.

Just my oppinion.

Env
Thanks!
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Kaeru Gaman »

ermn... to me it does not at all look easier.

I programmed in C for years, too.
and I still use POVScript for POVRay what is based on C-Script, where the directives are introduced with a #, but on the other hand the constants are not.

in PureBasic, the Constants are introduced with a # but the Compiler Directives are not.
it's fine that way, and I have no problems switching between PB and PovS.

your second code example just looks dirty to me, the much # do not at all help to see anything clearer.
besides, you should put it to the enumeration, too, shouldn't you?

when you have problems seeing a CompilerIf somewhere deep in the code, you just experience a lack of structuring, organizing and commending.
a # will not help at all, but to learn how to comment code.


anyhow, I just wanted to show you why your request is pointless.
no need to argue against it, I bet it will never be implemented that way.
oh... and have a nice day.
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Env »

Kaeru Gaman wrote: anyhow, I just wanted to show you why your request is pointless.
no need to argue against it, I bet it will never be implemented that way.
Ok, your opinion is acknowledged.

As it was a feature suggestion, not a demand, I would have appreciated less of the aggressive responses, but never mind.




Env
Thanks!
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Kaeru Gaman »

also see the other side:
it's your first day here and you request something that would completely change the look&feel...
what do you think people should answer?

go to a book club, gardeners club or bikers club and try it... ;)
oh... and have a nice day.
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Env »

As someone who has used PureBasic since the 3.00 release, and who has been in and out of the forum with different user names (Mainly under different e-mail address, or simply I have forgotten what the user name was), I am fully aware of my side... Though thank you for the consideration :).

I do anticipate that with the recent additions (linked lists being supported in structures for example), that the pure basic language is still evolving in terms of its structuring, so depending on what future editions may entail, as well as the possible changes to the compiler that may occur (since computer technology is always changing), I had the thought that allowing all compiler directives to share a common rule with such things as constants would separate the PureBasic syntax up a bit more, providing a nice foundation for organisation for any future changes....

Who knows, one day PureBasic may integrate a object-orientated approach, since a few OOP pre-compilers have been developed in the past, so it would simply be providing the foundation for organising a lot more features, as well as ease-of-use.

You made the point that just using general good manners when writing code (structuring etc.) would be enough... But if you are writing 100,000+ lines of code, it would be very inefficient to have to separate every 3 lines of code with bold commenting.

I started with PureBasic because it was the next best thing to what I was using (DarkBasic, and Blitz3D) as a beginner. Eventually I moved on to C++ because it was again better for my needs...

However, I still use PureBasic because it's a good platform for prototyping, and also good for knocking out applications at ease.

Because of this, I feel my opinion should be valid, and not seen as a 'noob' interference.


Regardless, it's hardly common courtesy to show anyone, be them new, or an old time regular the attitude and aggression that you displayed in this post...

Now to prevent this thread from digressing any more, you're more than welcome to express your views of my right to be spoken to in a mutually respectful manner via my e-mail address: mrking2910(at)googlemail.com


Thanks,

Env
Thanks!
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Kaeru Gaman »

I'm sorry that you had the impression my posting was overly agressive.
I just said clear words about an idea I do not like at all. I would also told you if you had a some-thousand-post expert account.
clear words - not just agression.

also take into account that the emotional interpretation of a toneless text on an international cross-culture forums is something doomed to fail.
what you consider agressive maybe just normal clear words in other cultures.
what you call politeness and like to use maybe considered colorless wishy-washy in other cultures.
oh... and have a nice day.
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Env »

@ Kaeru Gaman,

I understand, and I appreciate that. Let us think no more on that matter :)
Thanks!
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by blueznl »

-273

Euh... in my personal honest and totally unbiased objective (yeah, right!) opinion I don't think it's such a good idea, to be honest... Next thing we'll have curly brackets, brrrr! :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Env »

blueznl wrote: Next thing we'll have curly brackets, brrrr! :-)
Lol.

I suppose I have just been programming with C++ for too long, adopting it's standards... On revision of the feature request, I can appreciate it's probably just a software developer looking to bridge two languages together for easier development...


But, fear not.. I shall post more ludicrous requests soon enough... I.e. enforce a rule that all procedures have to have '::' as a prefix :P (Joke)



Env
Last edited by Env on Wed Apr 28, 2010 1:54 pm, edited 1 time in total.
Thanks!
Mr Coder
User
User
Posts: 54
Joined: Tue Apr 13, 2010 8:02 am

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Mr Coder »

Env wrote:Though wouldn't you agree that it would certainly make it easier to navigate through the code and find the compiler directives?
Not if it used #, because everywhere I see # in my code is a constant name.

If you want keywords to stand out, add them as custom colored keywords in the prefs. Easy!

BTW, since you mentioned it, why don't you just use ::: before all your compiler directives? They would stand out for you and not cause any syntax errors, and even parsers could pick out the directives too. You just solved your own request! :)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by Kaeru Gaman »

one more thing you may not have known...

if you want to mark something to be easy to find, use a minus as the first char of a comment

Code: Select all

;- CompIf #Const1
CompilerIf #Const1
  ; .....
CompilerEndIf 
this is a label that will appear in the proclist, just like Procedures and Macros.

and comments like that:

Code: Select all

;{
;}
define a block that can be folded.
oh... and have a nice day.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...

Post by rsts »

Env wrote:As someone who has used PureBasic since the 3.00 release, and who has been in and out of the forum with different user names (Mainly under different e-mail address, or simply I have forgotten what the user name was), I am fully aware of my side... Though thank you for the consideration :).


Regardless, it's hardly common courtesy to show anyone, be them new, or an old time regular the attitude and aggression that you displayed in this post...


Env
If you've really spent a good deal of time in the forums, you should recognize that Mr Gaman's comments were not really discourteous or aggressive. Rather, it's merely the way Mr Gaman expresses himself and is probably cultural, rather than directed at someone.

Your responses were not aggressive and are commendable.

But now that we're all friends here, you probably recognize that. :D

cheers
Post Reply