Lazarus

Miscellaneous => Suggestions => IDE/CodeTools => Topic started by: dolemi on January 02, 2016, 01:13:14 pm

Title: !! Change Begin-End to {}
Post by: dolemi on January 02, 2016, 01:13:14 pm
Can we have an option to change {} to /* */, and change Begin-End  to {}
Title: Re: !! Change Begin-End to {}
Post by: vincococka on January 02, 2016, 01:33:52 pm
While one can say that everything is possible, I believe that it will lead to confusion when you`ll sometimes switch between C/C++ code and C'ed Pascal syntax.

I came from C world and it is just a matter of habit (begin/end, and {} comments).
Title: Re: !! Change Begin-End to {}
Post by: eny on January 02, 2016, 01:38:42 pm
Can we have an option to change {} to /* */, and change Begin-End  to {}
Use Java, C(++/#), PHP etc. etc.
Title: Re: !! Change Begin-End to {}
Post by: balazsszekely on January 02, 2016, 01:46:28 pm
Quote
@dolemi
Can we have an option to change {} to /* */, and change Begin-End  to {}
No, I don't think it's possible.  After a few hours of coding you won't even notice "begin end", it will come naturally.

Quote
@eny
Use Java, C(++/#), PHP etc. etc.
This is a good one.  :D
Seriously, changing "begin end" to "{}", it's like changing "{}" to "begin end" in c, c++.
Title: Re: !! Change Begin-End to {}
Post by: marcov on January 02, 2016, 01:48:45 pm
Note that Pascal (comment) { } behave differently depending on modes.

In some modes comments must exactly match, in some modes one  } closes the comment.

And no, Pascal is not curly braces, deal with it.

Title: Re: !! Change Begin-End to {}
Post by: Thaddy on January 02, 2016, 02:15:26 pm
Can we have an option to change {} to /* */, and change Begin-End  to {}

The problem is that would probably also make FPC case sensitive O:-)

I'd also like to abbreviate procedure to void,use struct instead of record (although that can be done with macro's),  reverse the type declaration, but usually I stick to C/C++ in those case.

Real Problems:
You can't use conditionals anymore, you can't use a string re[presentation of a GUID etc, etc.
Title: Re: !! Change Begin-End to {}
Post by: guest58172 on January 02, 2016, 02:54:46 pm
Can we have an option to change {} to /* */, and change Begin-End  to {}

That's stupid to ask this. Historically, languages that use curly braces (and  more generally speaking more symbols) and those who use begin end (and generally speaking more keywords) don't have the same origin.

Pascal influence graph::

http://exploringdata.github.io/vis/programming-languages-influence-network/#Pascal

C influence graph:

http://exploringdata.github.io/vis/programming-languages-influence-network/#C

(see also https://upload.wikimedia.org/wikipedia/commons/2/25/Genealogical_tree_of_programming_languages.svg)

It's like If you wanted to write in french with the cyrilic alphabet. It doesn't work.
Title: Re: !! Change Begin-End to {}
Post by: Thaddy on January 02, 2016, 03:14:13 pm
Can we have an option to change {} to /* */, and change Begin-End  to {}

That's stupid to ask this.

Well, it is a bit more complicated than that.
Both Delphi and especially FPC have syntactic elements that find their source in other language branches.
There is little left for the purists, imo.
Title: Re: !! Change Begin-End to {}
Post by: dolemi on January 02, 2016, 03:19:30 pm
It is a preference, you like blue, I like green, and none is wrong or right. Everyone has own reason to have Begin-end or {}.

Linux has lots of desktop background pictures. Why does Lazarus cannot have more options fit for different types of programmers? With varieties options, it attracts different type of background people.

I call it as user-friendly. What do you think?
Title: Re: !! Change Begin-End to {}
Post by: dolemi on January 02, 2016, 03:21:05 pm
I am doing marketing for Lazarus.
Title: Re: !! Change Begin-End to {}
Post by: dolemi on January 02, 2016, 03:44:33 pm
I have a software that can handle few dozen language syntax.
Title: Re: !! Change Begin-End to {}
Post by: Abelisto on January 02, 2016, 03:45:33 pm
Can we have an option to change {} to /* */, and change Begin-End  to {}

Yet another holly-war and yet another troll. Just ask about changing curve brackets to TAB characters like in the Python.
Title: Re: !! Change Begin-End to {}
Post by: Leledumbo on January 02, 2016, 04:09:29 pm
Can we have an option to change {} to /* */, and change Begin-End  to {}
That's easy:
Code: Pascal  [Select][+][-]
  1. uses SysUtils,StrUtils;
  2. ...
  3. ReplacedString := StringsReplace(OriginalString,['{','}','begin','end'],['/*','*/','{','}',[rfReplaceAll,rfIgnoreCase]);
  4.  
;)
Side note:
I don't want to take OP too seriously, he surely needs to Pascalize his brain first. And based on his other questions, Linuxify as well. It's a well known behavior that we once meet in a while.
Title: Re: !! Change Begin-End to {}
Post by: BeniBela on January 02, 2016, 04:15:03 pm

Seriously, changing "begin end" to "{}", it's like changing "{}" to "begin end" in c, c++.

And in C/C++ you can actually do that!

Code: [Select]
#define begin {
#define Begin {
#define bEgin {
#define BEgin {
#define beGin {
#define BeGin {
#define bEGin {
#define BEGin {
#define begIn {
#define BegIn {
#define bEgIn {
#define BEgIn {
#define beGIn {
#define BeGIn {
#define bEGIn {
#define BEGIn {
#define begiN {
#define BegiN {
#define bEgiN {
#define BEgiN {
#define beGiN {
#define BeGiN {
#define bEGiN {
#define BEGiN {
#define begIN {
#define BegIN {
#define bEgIN {
#define BEgIN {
#define beGIN {
#define BeGIN {
#define bEGIN {
#define BEGIN {
#define end ;}
#define End ;}
#define eNd ;}
#define ENd ;}
#define enD ;}
#define EnD ;}
#define eND ;}
#define END ;}


And that is why C++ is superior
Title: Re: !! Change Begin-End to {}
Post by: taazz on January 02, 2016, 04:21:16 pm

Seriously, changing "begin end" to "{}", it's like changing "{}" to "begin end" in c, c++.

And in C/C++ you can actually do that!

Code: [Select]
#define begin {
#define Begin {
#define bEgin {
#define BEgin {
#define beGin {
#define BeGin {
#define bEGin {
#define BEGin {
#define begIn {
#define BegIn {
#define bEgIn {
#define BEgIn {
#define beGIn {
#define BeGIn {
#define bEGIn {
#define BEGIn {
#define begiN {
#define BegiN {
#define bEgiN {
#define BEgiN {
#define beGiN {
#define BeGiN {
#define bEGiN {
#define BEGiN {
#define begIN {
#define BegIN {
#define bEgIN {
#define BEgIN {
#define beGIN {
#define BeGIN {
#define bEGIN {
#define BEGIN {
#define end ;}
#define End ;}
#define eNd ;}
#define ENd ;}
#define enD ;}
#define EnD ;}
#define eND ;}
#define END ;}


And that is why C++ is superior
That is also why C++ is unsafe to use and since there is C++ to do that, freepascal has no reason to do it.
Title: Re: !! Change Begin-End to {}
Post by: balazsszekely on January 02, 2016, 04:24:41 pm
Quote
@BeniBela
And that is why C++ is superior
c, c++, pascal,... are just tools. Which is best, it highly depends on what is your objective/goal. If you want to code a Driver/OS/Embedded devices then yes c/c++ is superior, on the other hand if you need a rich GUI application, with database connection then pascal is a much better choice. I think a good programmer should learn at least 2-3 programming languages and use them according to the requirements.

PS: In my opinion the most obvious drawback of c/c++ is productivity. It's painfully slow to develop a GUI application.
Title: Re: !! Change Begin-End to {}
Post by: Thaddy on January 02, 2016, 05:43:13 pm
@Benibela:
Tnx for illustrating my point about case sensitivity in such an original way ;)

@Getmem:
My biggest problem with C++ is that many use it in such a way that code becomes unreadable.
It is more or less self-obfuscating in the many wrong hands there are out there.

Although it is perfectly possible to write such code in FreePascal too, not many do that.
Title: Re: !! Change Begin-End to {}
Post by: skalogryz on January 02, 2016, 05:46:33 pm
The topic looks like new-year trolling. Does everyone agree to close it?
Title: Re: !! Change Begin-End to {}
Post by: balazsszekely on January 02, 2016, 06:26:43 pm
Quote
@Thaddy
My biggest problem with C++ is that many use it in such a way that code becomes unreadable.
It is more or less self-obfuscating in the many wrong hands there are out there.
Yes, I agree.
 
Quote
@skalogryz
The topic looks like new-year trolling. Does everyone agree to close it?
I suggest to change the french oui word to yes or vice versa.  :D
This thread definitely needs to be locked.
TinyPortal © 2005-2018