Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Or even more moronic: makefiles where different kinds of whitespace have different meaning.
-
What would you rather use?
I believe YAML is a superset of JSON, so you should be able to write it without whitespace mattering. -
@netikras yeah. Use space where you need to have a tab, and the whole thing barfs with syntax error. Completely moronic shit.
-
Onyx16403456y@TheyCallMeMJ Idk... JSON is pretty messy to write manually. Think I finally got VS Code's indenting setup properly, so it's going better now. Just had me wanting to throw my keyboard for a while there with all the syntax errors.
-
YAML sucks but I prefer it over JSON for files that also need to be human-readable.
-
I'm going to probably get flamed for this, but I hate bash scripting for the same reason, it's just so hacked-together and breaks so easily over tiny syntax issues compared to a modern language.
-
git-gud14066yyou know what, i'm just gonna say it:
i love yaml. and i love python.
brackets are for computers, and indentation is for humans. why not drop the fucking brackets when the computer can read indentation and we use it anyways?
and if you can't configure your editor to automatically convert whitespaces, nothing can save you. -
devs30756y@RememberMe bash fucking sucks. Don’t get me wrong, I, for some reason, really enjoy writing bash scripts for automation. But it’s the automation part I like, not the language.
Like, when do you need to use [ ] or [[ ]]. Or as you mention, the problem with white spaces: if [“$foo”=“bar”] vs if [ “$foo” = “bar” ] -
devs30756yPHP can have issues with white specs as well. I once worked on a Laravel project where I accidentally put a space before a <?php which made the entire site crash horribly...
-
zotigapo7616ySame here.
I create everything json later convert to fucking yaml.
Only one think i like yaml is comments thats it.
Damn confusing with array and objects annoying -
Json is for data transfer, yaml is for configuration files. Can you honestly say, that it's easier to read a Json conf file, than a yaml conf file?
-
@KasperNS this. Exactly this. I tried writing an AWS Cloudformation template in JSON once and hated every second of it. YAML is much better in that case.
-
obeobe15yWhitespace and indentation should be used for readability.
Brackets should be used for functionality.
Python has some great stuff.
Using indentation to control flow is not part of it.
It's annoying how it insists to change basic syntax that everyone is already used to from other languages, with no tangible benefit or rationale.
Like, "#". The major programming languages all support "//" for one-line comments. Why not allow that?
And multi-line? god forbid use the "/* */" mainstream way that everyone is familiar with. In Python, we use ' """ '. Three double-quotes, to start and end a multi-line comment. God.
It's like the emo millennial who needs everybody to see how special, unique, and snow-flaky he is.
Well, Python (and YAML) may have their crowd of followers, but, on the most part, that is DESPITE their peculiarities, not because of them. -
@obeobe A lot of people forget that Python is one of the oldest popular languages. Older than Java and Javascript. Things like shirking brackets and semicolons probably were super useful before advances in editors could handle this for you.
My guess as to why comments are '#'? Probably to copy shell scripting, which I'm also guessing one of the main use cases of Python was in its beginning, that is to improve upon shell scripting.
The multiline """ technically isn't even a comment. I believe it's a string value that actually gets evaluated, then immediately discarded. So technically Python doesn't have true multiline comments, but the triple quote saves you from prefixing each line with '#' to make it marginally easier to read.
Not necessarily disagreeing with your points, just trying to justify some counterarguments.
Related Rants
I fucking hate YAML!!! Whoever thought a fucking whitespace delimited file was a good idea should......
</rant>
Ahh that's better; back to learning Ansible.
rant
yaml