Page 1 of 1

Alternative single line comment character(s)

Posted: Wed Jun 12, 2019 2:15 pm
by Clyde
This may sound foolish, but using languages like PHP, JavaScript and sometimes C# on a daily basis seeing the semicolon (;) used for single line comments bugs me really a lot. I know it is a matter of familiarization but to me those ; comments make the code hard to read.

So, for the sake of my mental health ;-) would it be possible if you could add double slashes (//) as allowed comment characters for single line comments (don't get rid of the semicolon, of course, "just" also allow //).

Thanks a lot!

Re: Alternative single line comment character(s)

Posted: Wed Jun 12, 2019 4:37 pm
by airsoftsoftwair
I'm afraid that's not very likely because it also means that the syntax highlighter in the Hollywood IDE, in Flow Studio, in the Cubic IDE plugin, in the UltraEdit and Notepad++ and vim plugins would have to be adapted which is a lot of work. Especially the syntax highlighter in the Hollywood IDE is something I'd prefer not to touch again ;) Besides that, I'm also a fan of the semicolons as comments :)

Re: Alternative single line comment character(s)

Posted: Wed Jun 12, 2019 6:26 pm
by plouf
agree with aisoftware

i come from a "background" where ; is the comments (blitzbasic / purebasic / a lot of Assemby's)
so for "us" this is logic and "we" have to familize with something else ;)

Re: Alternative single line comment character(s)

Posted: Thu Jun 13, 2019 9:53 am
by Clyde
@plouf: I understand that. But keep in mind that I don't want the ; to vanish. I just want an additional alternative.

@Andreas: I see your point. To be honest, I wouldn't care if the syntax highlighting would not work in this case, as long as the compiler does not complain and it works as intended. Maybe implement it as a hidden feature? :-) Btw, I am currently working on a (simple) Hollywood plugin for Visual Studio Code (which is a great editor), so adding // as a single line comment works like a snap in seconds ...

Re: Alternative single line comment character(s)

Posted: Thu Jun 13, 2019 7:22 pm
by airsoftsoftwair
Clyde wrote: Thu Jun 13, 2019 9:53 am @Andreas: I see your point. To be honest, I wouldn't care if the syntax highlighting would not work in this case, as long as the compiler does not complain and it works as intended. Maybe implement it as a hidden feature? :-)
Sorry, that's just too modern. There has to be some retro touch to Hollywood ;-) Btw, in C the // comments weren't available before C99 either :)

Re: Alternative single line comment character(s)

Posted: Fri Jun 14, 2019 3:14 pm
by Clyde
airsoftsoftwair wrote: Thu Jun 13, 2019 7:22 pm Sorry, that's just too modern. There has to be some retro touch to Hollywood ;-) Btw, in C the // comments weren't available before C99 either :)
Gnaaaaaaahhh! :-)

Ok, if you want to go this route :-) : With creating Hollywood you have always show how far ahead you are against other technologies! Hollywood is more modern than most other stuff. So, keep the ; for the retro touch and add // for modernness. :-) And I am quite sure, at least the files for UltraEdit, Notepad++ and VIM are easy to extend.
I could not test it with VIM, but this should be the regex für the VIM syntax hightlighter (see file hollywood.vim, line 126):

Code: Select all

(;|\/\/).*$
See also https://regex101.com/r/ytFKug/1

:-)

Re: Alternative single line comment character(s)

Posted: Fri Jun 14, 2019 7:30 pm
by airsoftsoftwair
Have I mentioned that another advantage of ; is that it is much quicker to type and only needs half as much space which also increases the compiler's performance :)

Re: Alternative single line comment character(s)

Posted: Fri Jun 14, 2019 10:24 pm
by Clyde
Nope, you haven't and it really sounds like an excuse. :-P :-D

All the other people can continue to enjoy the performance boost when using ; and I happily wait a bit more while compiling and enjoy using // ... :-)