4 ms·
I dislike the way it looks like JSON but isn't. My opinion is that QML not going to supersede web tech any time soon. As broken as CSS is, it is here to stay f
by w4tson 9y ago
I dislike the way it looks like JSON but isn't.
My opinion is that QML not going to supersede web tech any time soon. As broken as CSS is, it is here to stay for the a while yet. The tooling for QML isn't great. You're heavily relying on QT Creator etc and the licensing around all that stuff. The exact opposite of FOSS that the web embraces.
Also FWIW, I know it's a holy issue but when you copy lines round in python etc you ARE having to add and remove those extra bits of syntax except they're invisible, they're spaces/tabs (don't even). Any sane person would have to have white space visibility turned on in their editor so would just be looking at cruft anyways.
- seanwilson 9y ago> I dislike the way it looks like JSON but isn't. Sticking on the topic of syntax, JSON has its own annoyance that the extra comma on the last field will be a syntax error when other languages let you get away with it. A field that goes over two lines is the exception so there should be a more verbose syntax for that rather than for single line fields in my opinion. > As broken as CSS is, it is here to stay for the a while yet. I prefer SASS with significant whitespace, no semicolons and no braces. :P > Also FWIW, I know it's a holy issue but when you copy lines round in python etc you ARE having to add and remove those extra bits of syntax except they're invisible, they're spaces/tabs (don't even). Any sane person would have to have white space visibility turned on in their editor so would just be looking at cruft anyways. Hmm, so in pretty much all IDEs, I can paste Python code then do TAB or shift+TAB to fix the indentation level as what you pasted is still selected. Having to add e.g. curly braces/bracket to fix nesting is miles more cumbersome and error-prone when there's a syntax error. It's super irritating trying to work out where the missing brace/bracket is. I'm less concerned how it looks and more concerned how easy it is to move lines of code around plus find syntax errors. I'm still amazed how bad syntax error messages are at helping you work out what's wrong.
- btschaegg 9y ago> JSON has its own annoyance that the extra comma on the last field will be a syntax error when other languages let you get away with it. My thoughts exactly. I am repeatedly astounded by the fact that McCarthy thought of something abstract as Lisp syntax in the 50s and yet it did take ages for Algol-derived languages to figure out the comma thing. The case of JSON especially irritates me since its not only supposed to be easy to parse (and - honestly - allowing an additional comma wouldn't be hard anyway), but easy to generate as well... Also: You know something's wrong when all your SQL templates look like SELECT Column1 ,Column2 ,Column3 ,[...] Just sayin'.
- seanwilson 9y agoYeah, agree with that! Personally, I cannot understand how some people hate significant whitespace in languages. You should be adding whitespace anyway so the braces are redundant and missing out braces is a massive source of super annoying and unhelpful syntax errors where you can be hunting around for ages for the mistake. Incorrect indentation is easy to spot and easy to correct in a few keystrokes in comparison.
- krapp 9y agoPeople hate significant whitespace because whitespace and indentation are meant for human readability. Introducing the potential for bugs into syntax that a compiler or interpreter shouldn't care about seems unnecessary, or at least not superior to the alternative. Incorrect bracing and incorrect indentation are equally easy (or difficult) to spot depending on a programmer's familiarity with the language, the features of the editor being used, and the size of the codebase being analyzed, as significant whitespace is just a more complex and brittle form of brackets that uses multiple, visually indistinguishable but incompatible non-printing characters.
- kazinator 9y agoDropping the silly commas somehow wasn't obvious right away to McCarthy, either! See: https://news.ycombinator.com/item?id=14885779 https://news.ycombinator.com/item?id=14885779 The "Algebraic Manipulation of Symbolic Expressions" was basically predecessor to S-exps, but with commas. The interesting thing is that math notation has some comma-based things (function arguments, sets, sequences) and some that don't use commas (like matrices and vectors).
- btschaegg 9y agoTo clarify: What bugs me about this isn't really that there are commas. If that makes the parsing simpler, I won't mind having to type them, and having them there doesn't make the code less readable. They might not be needed technically, but I can live with that. What annoys me is that you can't end a list in a comma: [ 1, 2 ] is valid, whereas [ 1, 2, ] isn't. This means that if you generate JSON (and if you're using a lower level language you might not want to import a library just for that), you'll have to make a) either the first or the last entry of your sequence a "special case" (omit the comma) or b) backtrack after the string generation and erase the last comma if there are any entries. On top of that, AFAIK Ecmascript allowed trailing commas since its inception (in array literals, that is), while JSON doesn't.
- slavik81 9y ago> You're heavily relying on QT Creator etc and the licensing around all that stuff. The exact opposite of FOSS that the web embraces. I don't understand what you're getting at. Qt Creator is FOSS. https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/ https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/