The slickest language syntaxwise? [modified]
-
Im just doing a little poll here on what languages you think have the slickest syntax. and if you dont like any it would be interesting to hear some arguments on what is bad in the current languages. So pretty much, why do you like a certain kind of syntax? I personally code C#, not because I like the syntax but rather because it lets me express myself enough and its some kind of defacto standard for .net coding. I know that Ive defended the C style languages because of their syntax but I think I have to rethink this :P
MyType<OtherType<int>> var = new MyType<OtherType<int>>(1,2,3); if (a == b && c > d ) ...
I cant say that I find the above very pretty. Its symbol mania... So if you guys could invent your own perfect language, how would it look? * For those of you who see code in here and are going to vote1 or cry "Do not post programming yadda yadda"... this is not a programming question.. its a question about prefference regarding syntax.. -- modified at 3:37 Thursday 21st December, 2006 -
Im just doing a little poll here on what languages you think have the slickest syntax. and if you dont like any it would be interesting to hear some arguments on what is bad in the current languages. So pretty much, why do you like a certain kind of syntax? I personally code C#, not because I like the syntax but rather because it lets me express myself enough and its some kind of defacto standard for .net coding. I know that Ive defended the C style languages because of their syntax but I think I have to rethink this :P
MyType<OtherType<int>> var = new MyType<OtherType<int>>(1,2,3); if (a == b && c > d ) ...
I cant say that I find the above very pretty. Its symbol mania... So if you guys could invent your own perfect language, how would it look? * For those of you who see code in here and are going to vote1 or cry "Do not post programming yadda yadda"... this is not a programming question.. its a question about prefference regarding syntax.. -- modified at 3:37 Thursday 21st December, 2006The entire language consists of one statement that works for all programs that you will ever write:
ReadMyMindAndDoExactlyWhatIWantYouInfernalMachine;
Jon Sagara When I grow up, I'm changing my name to Joe Kickass! My Blog | My Site | My Articles
-
The entire language consists of one statement that works for all programs that you will ever write:
ReadMyMindAndDoExactlyWhatIWantYouInfernalMachine;
Jon Sagara When I grow up, I'm changing my name to Joe Kickass! My Blog | My Site | My Articles
I would love to see that compiler ;-)
-
Im just doing a little poll here on what languages you think have the slickest syntax. and if you dont like any it would be interesting to hear some arguments on what is bad in the current languages. So pretty much, why do you like a certain kind of syntax? I personally code C#, not because I like the syntax but rather because it lets me express myself enough and its some kind of defacto standard for .net coding. I know that Ive defended the C style languages because of their syntax but I think I have to rethink this :P
MyType<OtherType<int>> var = new MyType<OtherType<int>>(1,2,3); if (a == b && c > d ) ...
I cant say that I find the above very pretty. Its symbol mania... So if you guys could invent your own perfect language, how would it look? * For those of you who see code in here and are going to vote1 or cry "Do not post programming yadda yadda"... this is not a programming question.. its a question about prefference regarding syntax.. -- modified at 3:37 Thursday 21st December, 2006I think my ideal would be C++ but I would definitely change the very messy template syntax :wtf: and overloading of << and >> (there must be a prettier way to do this and I've never gotten used to it!) C# and "managed" extensions just make things worse (I still remember when the mantra was "less is more")...something is badly wrong when you have to use constructs like "MyType> var". But in 20 years nothing's beaten the elegance of well structured C code for me :)
-
I think my ideal would be C++ but I would definitely change the very messy template syntax :wtf: and overloading of << and >> (there must be a prettier way to do this and I've never gotten used to it!) C# and "managed" extensions just make things worse (I still remember when the mantra was "less is more")...something is badly wrong when you have to use constructs like "MyType> var". But in 20 years nothing's beaten the elegance of well structured C code for me :)
the MyType> var was a bit of forum distortion of the code. apparently the codeblocks in the forum does not output the raw content. so its fixed now. what it shows is a 2 level generic type
-
I would love to see that compiler ;-)
Oh no - that sounds like it could be a "Plain English Compiler"! RUN FOR YOUR LIVES!!!!!! :laugh: :laugh: :laugh:
-
The entire language consists of one statement that works for all programs that you will ever write:
ReadMyMindAndDoExactlyWhatIWantYouInfernalMachine;
Jon Sagara When I grow up, I'm changing my name to Joe Kickass! My Blog | My Site | My Articles
Back in ASM days we used the
DWIM
instruction for that:OUT eax, 17 ; hook garbage collector to resource manager
DWIM 88 ; Do What I mean (in 88 clock cycles)Unfortunately, it didn't survive the move to more RISCy instruction sets (I never understood why). For C++0x I suggested to use the more colloquial "..." expression here
std::string FindPrime(__int64 digits)
{
...
}I don't know what is so complicated about it, but obviously the standards comitee is still "working on it"
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify!|Fold With Us! -
I think my ideal would be C++ but I would definitely change the very messy template syntax :wtf: and overloading of << and >> (there must be a prettier way to do this and I've never gotten used to it!) C# and "managed" extensions just make things worse (I still remember when the mantra was "less is more")...something is badly wrong when you have to use constructs like "MyType> var". But in 20 years nothing's beaten the elegance of well structured C code for me :)
Don Fletcher wrote:
the very messy template syntax
Well template syntax is not so awful, if you use typedefs. Passing around raw templates does not sound like a good habbit to me. But we're touching at the very controversial nature of C++. It's not because the language allows the programmer to do something it is a good idea to do it. But still the programmer is free to make his own choices.
-
the MyType> var was a bit of forum distortion of the code. apparently the codeblocks in the forum does not output the raw content. so its fixed now. what it shows is a 2 level generic type
Oh that might be true now ... but it's only a matter of time before it's an accepted part of the syntax :laugh:
-
Oh no - that sounds like it could be a "Plain English Compiler"! RUN FOR YOUR LIVES!!!!!! :laugh: :laugh: :laugh:
!SUGEN DNARG EHT !SUGEN DNARG EHT !SUGEN DNARG EHT Beware of what you'll bring upon yourself. :)
-
Don Fletcher wrote:
the very messy template syntax
Well template syntax is not so awful, if you use typedefs. Passing around raw templates does not sound like a good habbit to me. But we're touching at the very controversial nature of C++. It's not because the language allows the programmer to do something it is a good idea to do it. But still the programmer is free to make his own choices.
Very true - and if you don't like something then don't use it! (That works for me and it's one of the great things about C/C++ :cool: )
-
Back in ASM days we used the
DWIM
instruction for that:OUT eax, 17 ; hook garbage collector to resource manager
DWIM 88 ; Do What I mean (in 88 clock cycles)Unfortunately, it didn't survive the move to more RISCy instruction sets (I never understood why). For C++0x I suggested to use the more colloquial "..." expression here
std::string FindPrime(__int64 digits)
{
...
}I don't know what is so complicated about it, but obviously the standards comitee is still "working on it"
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify!|Fold With Us!but take this: std::string FindPrime(__int64 digits) maybe people are just too used to it, but "::" "__int64" why should we have to use that many mumbo jumbo symbols to express what we want to do? Im not saying we need anything like the "english compiler" but dont you find the excessive use of symbols a bit annoying? its like we/language designers try to make things look cooler and more complex than they really are... the more __ before an identifier , the cooler the code.
-
!SUGEN DNARG EHT !SUGEN DNARG EHT !SUGEN DNARG EHT Beware of what you'll bring upon yourself. :)
:laugh:
-
Back in ASM days we used the
DWIM
instruction for that:OUT eax, 17 ; hook garbage collector to resource manager
DWIM 88 ; Do What I mean (in 88 clock cycles)Unfortunately, it didn't survive the move to more RISCy instruction sets (I never understood why). For C++0x I suggested to use the more colloquial "..." expression here
std::string FindPrime(__int64 digits)
{
...
}I don't know what is so complicated about it, but obviously the standards comitee is still "working on it"
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify!|Fold With Us!peterchen wrote:
it didn't survive the move to more RISCy instruction sets
Ouch! No! Not the ghost of processors where native instruction sets will support high level languages!!!!
-
I think my ideal would be C++ but I would definitely change the very messy template syntax :wtf: and overloading of << and >> (there must be a prettier way to do this and I've never gotten used to it!) C# and "managed" extensions just make things worse (I still remember when the mantra was "less is more")...something is badly wrong when you have to use constructs like "MyType> var". But in 20 years nothing's beaten the elegance of well structured C code for me :)
If you like to read about weird programming languages, click this link. The factorial function can be written like this in Forth:
: FACTORIAL 1 SWAP BEGIN ?DUP WHILE TUCK * SWAP 1- REPEAT ;
or in Prolog:fact(X,1) :- X =:= 1. fact(X,Fact) :- X > 1, NewX is X - 1, fact(NewX,NF), Fact is X * NF.
But the winnr is APL!X
Apl has defined ! as a factorial operator. It is a higly specialized mathematical analysis. It has extremely powerful array processing capabilities where arrays can for example process themselves. Dont ask me how, I never used it just read about it but perhaps somebody here can entertain us with his/her knowledge :)_____________________________________ Action without thought is not action Action without emotion is not life
-
but take this: std::string FindPrime(__int64 digits) maybe people are just too used to it, but "::" "__int64" why should we have to use that many mumbo jumbo symbols to express what we want to do? Im not saying we need anything like the "english compiler" but dont you find the excessive use of symbols a bit annoying? its like we/language designers try to make things look cooler and more complex than they really are... the more __ before an identifier , the cooler the code.
Roger J wrote:
maybe people are just too used to it, but "::" "__int64" why should we have to use that many mumbo jumbo symbols to express what we want to do?
:: is very precise, __ is necessary garbage.
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify!|Fold With Us! -
Roger J wrote:
maybe people are just too used to it, but "::" "__int64" why should we have to use that many mumbo jumbo symbols to express what we want to do?
:: is very precise, __ is necessary garbage.
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify!|Fold With Us!>>:: is very precise yes but the same reasoning could be applied to the symbols used in say Perl. that doesnt mean that its a good/clean/smart syntax. we could ofcourse have symbols for everything , eg ¤ for public and maybe £ for private, but that doesnt make it good just because it has a meaning. eg. "&&" wtf is that all about?, why did someone think "oh lets make the logical and token be &&, that is so clever.." Or are everyone happy with their elit symbol syntax just because you you have gotten so used to it?
-
Im just doing a little poll here on what languages you think have the slickest syntax. and if you dont like any it would be interesting to hear some arguments on what is bad in the current languages. So pretty much, why do you like a certain kind of syntax? I personally code C#, not because I like the syntax but rather because it lets me express myself enough and its some kind of defacto standard for .net coding. I know that Ive defended the C style languages because of their syntax but I think I have to rethink this :P
MyType<OtherType<int>> var = new MyType<OtherType<int>>(1,2,3); if (a == b && c > d ) ...
I cant say that I find the above very pretty. Its symbol mania... So if you guys could invent your own perfect language, how would it look? * For those of you who see code in here and are going to vote1 or cry "Do not post programming yadda yadda"... this is not a programming question.. its a question about prefference regarding syntax.. -- modified at 3:37 Thursday 21st December, 2006My favourite language is Haskell[^] because there is so little 'overhead' syntax! It is strongly typed, but infers types, meaning you don't (in 99.99% of cases) have to explicitly type anything. You can if you want....but you don't have to. You have to love a language that let's you define a (polymorphic) quicksort like this:
qsort [] = [] qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)
There's bits of Erlang[^] syntax that are schweet as well (binary types, for example).
-
Im just doing a little poll here on what languages you think have the slickest syntax. and if you dont like any it would be interesting to hear some arguments on what is bad in the current languages. So pretty much, why do you like a certain kind of syntax? I personally code C#, not because I like the syntax but rather because it lets me express myself enough and its some kind of defacto standard for .net coding. I know that Ive defended the C style languages because of their syntax but I think I have to rethink this :P
MyType<OtherType<int>> var = new MyType<OtherType<int>>(1,2,3); if (a == b && c > d ) ...
I cant say that I find the above very pretty. Its symbol mania... So if you guys could invent your own perfect language, how would it look? * For those of you who see code in here and are going to vote1 or cry "Do not post programming yadda yadda"... this is not a programming question.. its a question about prefference regarding syntax.. -- modified at 3:37 Thursday 21st December, 2006Roger J wrote:
I know that Ive defended the C style languages because of their syntax
I think the C-style languages are rather poor in their syntax, even though I'm primarily a C style language programmer myself. However, 1. I do think C# and Java syntaxes are much clearer and more readable than C/C++. 2. On the whole it's not that big an issue compared to the willingness of the programmer to write readable code, i.e., using well-named identifiers, short functions, etc. 3. Perl is probably the worst of the C syntax languages. I don't think any syntax is perfect. But, without having used them much, in scripting languages, Python and Ruby seem pretty slick. In statically typed languages Eiffel is pretty elegant. Many C-syntax types think it's verbose. But this is a superficial impression if you dig a little deeper.
Kevin
-
>>:: is very precise yes but the same reasoning could be applied to the symbols used in say Perl. that doesnt mean that its a good/clean/smart syntax. we could ofcourse have symbols for everything , eg ¤ for public and maybe £ for private, but that doesnt make it good just because it has a meaning. eg. "&&" wtf is that all about?, why did someone think "oh lets make the logical and token be &&, that is so clever.." Or are everyone happy with their elit symbol syntax just because you you have gotten so used to it?
Roger J wrote:
"&&" wtf is that all about?
Isn't it a Mathematics thing to represent logical AND with & and logical OR with |? This is what is my understanding although I am not so sure.
"Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"