Untitled

Story: Nessie - The Loch Ness Monster of Programming LanguagesTotal Replies: 3
Author Content
Kagehi

Apr 01, 2005
10:57 AM EDT
How exactly is s/" " better than s.split(" ")? I'm sorry, but obfuscating the meaning is hardly necessary. Split tells you what it is, s/" " **should** be a syntax error involving an invalid type cast in *any* sane language. Why? Because someone 'might' actually make such a mistake and getting an error makes a lot more sense than wondering why it seemed to work anyway, but gave a bad result. In fact arr*" " is even worse, especially if you are using a variable name to define the delimeter, instead of a hard coded string. Maybe it wouldn't work anyway, but it is still not understandable. If I use the language, I want to be able to read it and figure out what it is doing "without" having to look up with '/' does in relation to strings. Even if I have never seen Python or any other language with a split command, I can 'quess' what it does, same as with all other commands. If I came across Nessie, all you could say seeing arr*" " or s/" " is. "what they hell is that?" So, one has to ask, what use is it to remove a subfunction people can actually comprehend, and replace it with something that tells you nothing about what it actually does? What kind of warped mind actually thinks this is a 'good' idea? For that matter, if you really want to make it incomprehensible and human unintelligible, why not just make it like Beatnik:

http://en.wikipedia.org/wiki/Beatnik_programming_language

After all, the point of such decisions seem to be to keep 'normal' people from having a clue what the program code does by actually reading it. lol
mbaehrlxer

Apr 01, 2005
3:41 PM EDT
s/" " is more compact. once you know what it means it stands out on your code much more, is faster to read and less to remember.

it is only better if you believe that compact is better. if you prefer verbose then i can accept that. this is a matter of opinion.

apart from that, any argument for verboseness falls apart as soon as you get foreign speakers who may not master english. personally, i feel that the less english words are part of the language the easier a language is to handle for non-english speakers.

if you want to use a language you need to learn it no matter what. you do need to learn that to split you use split() in python, and use / in nessie or pike. the question is in the end how much you need to learn in total. (and i am not trying to claim that nessie is easier in that respect than python, perl is the bad example here :-)

but where do you see a type cast here? there is a string split by a string, no typecasting whatsoever.

even s/3 would not have a type cast. it would be a string broken into parts of a size of 3 (not 3 parts of equal size, i grant you that this is a bit unintuitive, but in the long run much more practical)

greetings, martin.
mbaehrlxer

Apr 01, 2005
4:27 PM EDT
i forgot to mention that the beauty of s/" " is the fact that the / operator will work on any type (where any kind of splitting makes sense).

you do not need to learn different operators or functions for different types. that is simplicity.

greetings, martin.
mbaehrlxer

Apr 02, 2005
12:16 AM EDT
btw python supports

>>> "foo%sfoo"%"bar" 'foobarfoo'

i love it! but it's certainly not intuitive.

i'd love to see it in pike and nessie, but that would break pikes consistency, because % is the modulo operator, and the above is nowhere near a modulo operation.

greetings, martin.

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!