4 ms·
I'll never understand why people keep going out of their way to make new weird syntaxes. Is it really necessary? Does it really give something over well establi
by mrcharles 14y ago
I'll never understand why people keep going out of their way to make new weird syntaxes. Is it really necessary? Does it really give something over well established C-like syntaxes?
At the very least, people should approach new languages from an ease of typing angle. I look at that and all I can think is "That would be a bitch to type out. Doing it all day? No thank you."
- jurre 14y agoEase of reading I hope!
- jlgreco 14y agoI have too seemingly opposing thoughts on this. One part of me says "Don't reinvent the wheel", but the other part of me suspects that forcing a new language to follow the syntactical conventions of another language that was designed with different considerations in mind is a bad idea. The best example of a language that I think suffers from it's association with the syntax of another is C++. The features that it provides are all more or less fine, but cramming it into a syntax that was made for a much simpler language really wasn't a good idea. (I understand why it was done from a historical perspective, and understand the few benefits it affords, but I think those are particular to that example) On the other hand again, there really isn't a lack of syntaxes these days that a new language developer can look to for inspiration. Surely one of them should work fine most of the time.
- terhechte 14y agoThis specific one is just bad though. I mean "\" is really difficult to type on almost all non-us keyboards. It's not even really easy on US keyboards (the pinky has to go a long way). See how often it's in there. Even standard C syntax is a pain on some non-us keyboards. I.e. on a German keyboard, the [, [, {, }, are rather difficult to type. That's why I (being German) switched to an English layout around two years ago. Now I have trouble typing umlaut and thus writing good German, but at least my coding speed improved by probably 50% and my Hand hurts far less.
- jlgreco 14y agoYes, without doubt this specific one is bad.
- eru 14y agoYou might want to try the Neo layout. It's a modern layout that includes international characters, like German Umlauts. (I'm also German and switched to American Dvorak earlier. I only heard about Neo later, and am too lazy to switch now.)
- dkersten 14y agoI guess if LCtrl and their LMod3 were swapped (ie so that capslock is used as Ctrl for shortcut keys), I could see this being an interesting layout. It has all the common keys either on the home row or easily reached from the home row. I can't ever see myself switching from Colemak though, I like how the fingers roll across adjacent keys too much. (Plus since I don't type much German, I don't need quick access to üöäß, though an English-centric variant of Neo would be.. interesting, maybe using those keys for the most common programming symbols?)
- threedaymonk 14y agoThere are various keyboard layouts that are superficially English but which allow various diacritics via dead keys, such that, for example, you can type AltGr+" followed by u to get ü. (I just did exactly that.) I know of us altgr-intl on Linux (that is, xkb), but there are similar layouts on OS X and Windows.
- GregBuchholz 14y agoNow I'm interested to know which languages exist that don't rely heavily on backslashes. I guess I can't think of a language that doesn't use blackslashes for string escapes. Some other uses off the top of my head: * C -- line-continuations (important for macros). * Perl -- regex back-references. * Haskell -- anonymous functions. * Python -- line continuation. * Tcl -- line continuation. * Icon -- non-null test (unary), generator limitation (binary). * Prolog -- \+ for not provable. * J -- the prefix adverb and the grade-down verb (\:). * TeX -- Yes.
- arethuza 14y ago"Surely one of them should work fine most of the time." S-expressions? NB I once got paid to write Lisp, C and PostScript on the same project, if nothing else it taught me to be somewhat flexible about language syntax.
- eru 14y agoYou could ask they the same question about C-like syntaxes? Was it really necessary to invent anything new after somebody had hit upon S-Expressions? Anyway, to answer in the affirmative: Certain paradigms provide from certain syntax. E.g. Haskell would be much clunkier to write in a C-like syntax than with the ML-derived one it has. And Lisp's macros would be harder to pull off with a different syntax. In my opinion, Python also profits from syntactic differences with C. Somebody more knowledgeable could talk about SQL-syntax. > At the very least, people should approach new languages from an ease of typing angle. I look at that and all I can think is "That would be a bitch to type out. Doing it all day? No thank you." Old languages would also benefit from that approach. We've seen some alternative syntaxes JavaScript, but not really for something like C.
- TazeTSchnitzel 14y agoHave you read the tutorial? ANI is a very different language to C. Using a C-like syntax wouldn't make sense.
- leal 14y agoIt's the other way around, language designers go out of their way to conform to C-like syntax in order to cater to programmers of C-like languages. C's syntax is a fairly low level, which makes it fairly easy to map to assembly, but not very well suited for representing high level constructs (see C++).