Deprecate IncludeFile, IncludePath, CompilerIf etc...
Deprecate IncludeFile, IncludePath, CompilerIf etc...
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
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!
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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!
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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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.
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.
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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)
Example B (Proposed Changes)
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
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
...
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
Just my oppinion.
Env
Thanks!
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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.
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.
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
Ok, your opinion is acknowledged.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.
As it was a feature suggestion, not a demand, I would have appreciated less of the aggressive responses, but never mind.
Env
Thanks!
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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...
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.
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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

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!
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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.
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.
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
@ Kaeru Gaman,
I understand, and I appreciate that. Let us think no more on that matter
I understand, and I appreciate that. Let us think no more on that matter

Thanks!
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
-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!
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... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
Lol.blueznl wrote: Next thing we'll have curly brackets, brrrr!
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

Env
Last edited by Env on Wed Apr 28, 2010 1:54 pm, edited 1 time in total.
Thanks!
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
Not if it used #, because everywhere I see # in my code is a constant name.Env wrote:Though wouldn't you agree that it would certainly make it easier to navigate through the code and find the compiler directives?
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!

- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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 commentthis is a label that will appear in the proclist, just like Procedures and Macros.
and comments like that:define a block that can be folded.
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
and comments like that:
Code: Select all
;{
;}
oh... and have a nice day.
Re: Deprecate IncludeFile, IncludePath, CompilerIf etc...
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.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
Your responses were not aggressive and are commendable.
But now that we're all friends here, you probably recognize that.

cheers