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
-
"no semi-colons" <- how to spot a retard. be it "defining code style rules" or "designing a language"
-
So no CR means each line keeps going to the right on each line feed? How wide is their screen? lol
-
@tosensei spend a few weeks with modern languages like Kotlin or Swift and you‘ll start to see semicolons as antiquated.
IIRC, JS is a different story because they are pseudo-optional and can cause some obscure bugs when omitted. But I‘m not 100% sure about that. -
No carriage return?!
WTF! Don't they use teletype terminals for coding like everyone else?! -
"No CRLF ! LF only !"
This makes a lot of sense. I do not want CRLF in normal files. And don't activate some auto convertor, this should only be done explicit. What if there is a file that actually needs CRLF? Normal files should have LF only. -
"No double-quotes ! Single-quotes all the way !"
This also makes sense. In a language where this does not matter it is a good idea to have all quotes the same way. Using " in some places and ' in others without a rule where to use which one to use where is bad.
"No semi-colons !"
This also makes sense. I don't know about JavaScript but in bash people often use semi-colons to write an uglier style. -
LF makes sense, rest is bit dubious in my opinion.
When you know how to configure GIT, you're ahead of most devs...
Yes, even Windows Devs where the installer asks for this behaviour....
The end result is a clusterfuck. Mixed line endings can result in severe problems. -
@tosensei what about a language that opens scopes with a colon and closes them with a semicolon?
Basically replacing brackets?
On a scale of 1 to 10 how retarded is that? -
@happygimp0 something about double quotes always seemed more literal to me.
Also how are you supposed to close strings and include apostrophes at the same time when you're only allowed single quotes? -
@IntrusionCM I also think that LF makes sense, but in terms of everything else, don't you think that single quotes make sense in certain languages such as PHP? Performance wise (which ain't that big of a deal for what I am about to say) the interpreter does not have to do a check to see if something is to be interpolated, but at the same time, for non properly escaped user input in which something like $showMeYoTitties gets added by the user, then single quotes make more sense to me.
Idk fam, just saying, really interested in your input for this -
@CeladonCookie SHIFT+2 is faster and easier for the fingers to reach than ' next to backspace.
That is really my only argument. -
@IntrusionCM I know. I configured git to not convert LF to CRLF. Would prefer default, though
-
-
@AleCx04 Yes.
But the thing with quoting is reason why I said dubious.
In dubio pro reo.
I don't like the argumentation of performance, cause especially in PHP or in the author's case of JS the argument is rather "shady". PHP has OpCaching for a reason and in JS the only reason JS works well is compiler and optimization, otherwise JS wouldn't be so popular.
Hence eliminating that argument, I like the quoting style of single quotes more than double quotes - it's explicit.
But it can backfire in unpleasant ways...
E.g.
"This is a string with $var \n"
'This is a string with ' . $var . "\n"
In most cases, single quotes only requires usage of sprintf or mixing of double quotes and single quotes.
You want stuff to be interpreted sometimes.
Which is way I say dubious - a strict requirement as in MUST not use double quotes is in my opinion braindamaged.
What would be more sensible would be: SHOULD use single quotes if applicable.
Entirely different meaning
Related Rants
/me joining a new front-end project with enforced prettier rules to complete the build pipeline.
No double-quotes ! Single-quotes all the way !
- weird flex, but OK. I'll comply
No CRLF ! LF only !
- Ok, now you're starting to annoy me. With git autocrlf I can have my precious CR locally bu check in only LF and YOU CAN GIVE THE FUCK ABOUT WHAT LINE ENDINGS I USE LOCALLY WHEN EVERYTHING WILL BE CORRECT WHEN PUSHING COMMITS!
No semi-colons !
- Now I hate you
rant
formatting
code style
prettier
js