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
-
C0D4681386yEven when not using ; there are times you have no choice, or write a pile of shit to avoid a ;
Oh boi, I’m up 3 ; more then a lot of these JS devs, the world is going to burn; or fall apart. -
Do you apply this same reasoning/argument to Python?
I myself always use semicolons in JavaScript, but don't think it's necessarily bad to not use them as long as you're consistent. -
inaba46256y> It’s just making it more complicated for others to understand
If you find yourself being unable to read code without semicolons I'm gonna recommend that you practice more coding.
As someone who uses semicolons, most arguments against not using semicolons tend to be stupid. At least the ones that aren't "but I like them" because that's preference and impossible to argue for or against.
"But there might be cases where you could possible have potential errors" you might might say without bringing up any examples, or either bringing up edge cases or shite like this:
const a = 1
const b = a
(1 + 2).toString()
and going "see, it says a isn't a function therefore semicolons are better" without realizing this that this code is pretty dumb. Or the good ol' "return\n{\n\n}" which I can't recall ever having to do, and is easily solvable by defining a variable for the object.
If you have any arguments that countered by "manning up", I'd love to hear them :v -
@nathan815 in phyton they technically are something completely different..
so no.. -
@inaba
1) JS devs touch my java code and push broken code that’s missing semicolons
2) try to minify that shit without somicolons. Lucky you if it works for you.
3) consistency is something every developer should care about, I hope I don’t need me to give you reasons for this..
4) maybe you’re the one who needs more practice if you haven’t worked on code where this made it just more confusing.
I have enough experience in writing software, it just bothers me to see how devs care less and less as the years go by. -
inaba46256y@just8littleBit aww that's easy.
1. If your coworkers keep pushing broken code, then go talk to them about it. Maybe give them other tools than notepad while you're at it.
2. Lmao get a better minifier. In fact, here this will minify js without semicolons just fine https://jscompress.com/
3. In other words, time to use js on the client and server. As long as you're consistent in the language youre currently writing.
4. So your counter argument is "no u". At least put some effort into it my dude
"care less and less" lmao we're talking about how semicolons are optional here and not some kind of degeneration of society or whatever -
Omitting semicolons is a big fucking no-no.
You can omit them in personal projects but not at the job. It makes code inconsistent and prone to errors.
Even the feeling to be "uber-dev-1337" for not putting the semicolons does not justify it.
Not everything has to be ImbecileJS. -
@inaba so the solution in your opinion is to:
Convince co-workers to use different tools
Switch to different tools and
Switch technologies
Oh and even better, let’s forget about iOS, Android, java, .Net etc, then we can not put semicolons everywhere.
Great. That’s easier than putting fucking semicolons in there..
The fact that this triggers you so much gives me the feeling that it’s personal because maybe you actually don’t use semicolons as consistently as you claim to do..? -
@just8littleBit dear God. alright I'm not a Java developer, nor a JS dev. but I toggle between python and C decently consistently and never have these issues. in my prior JS experiences, I always use semicolons. but I get not using them. let me weigh in here:
I fully agree with @inaba.
a) if your devs can't change their semicolon tendencies between languages than your devs suck. teach them better and give them proper IDEs if you haven't already.
a2) maybe don't let your JS devs touch the Java code yea? seems wrong in the first place. you didn't describe them as JS/Java devs. so don't do that to them. or yourself.
b) most decent minifiers can figure out where semicolons need to be. and if your code runs differently with and without, then your code is ambiguous. refactor it.
c) if you're so upset just write a script to add them in. use CI or an atom plugin or whatever. hell even an awk script. it's not that difficult to fix. -
mundo0349796y@nathan815 did you know there are scenarios where a semicolon is needed? Or scenarios where a missing semi colon cause erratic behavior?
It is better and consistent to use the stupid semi colons; -
olback109816ySemicolons makes me more comfortable. I know that that's the end. I also think it makes it more readable.
-
Semicolons in JS are like a “comfort blanket” for the weak.
https://youtu.be/Qlr-FGbhKaI
While we’re at it. Types don’t save you either - you’re literally wasting your time.
#YouDontNeedSemiColons
JS only *needs* them in like two places. One before an iffe, and another one I never have a problem with so I always forget it. Maybe something to do with a return line.
Anyways, yeah because there literally is a limit to the number of decisions a person can make in a day - is rather not waste any of mine on rather or not I need a semi colon.
Grow up and learn how to read/write real JavaScript!
Seriously, take one moment to think about it objectively... even try it for like an hour and a half... you’re welcome.
Not to mention they make code noisy.
Amplify Signal, Reduce Noise. -
willol13896yCrying over semicolons tells me that you're not using a linter, which means that semicolons are the least of your worries.
Get a fucking linter (or even a beautifier, woah it adds semicolons for you woah) -
-
inaba46256y@just8littleBit Well of course, if you coworkers push broken Java code then it's not the fault of JS since that means they haven't even compiled their code.
If your minifier can't minify without semicolons, then get one that isn't shit. Even babel works fine without semicolons ffs.
Why should we forget about the two operating systems and languages when really all you need to do is "git gud".
And if you doubt I use semicolons, then worry not, because I have open source projects
https://github.com/inabahare/lewd2/...
https://github.com/inabahare/...
https://github.com/inabahare/...
There are semicolons, so you don't have to worry about your reading inability ;) -
I can abuse parantheses by writing a (function()) inside and pass the variables with another paranthese pair which is encapsulated with parantheses due to bug fixing and oh, the function returns boolean and I need the falsy value of it so I just use an exclamation point at the start and then, obviously, encapsulate it with another pair of parantheses.
Have I told you that I mostly do this inline? -
@smb26 haha! Use jshint! Even though it doesn't adds auto, it tells where you can place one and where it is *unnecessary* (you don;t need a semicolon after closing the defining code block of a function ({}))
Related Rants
To the JS devs (not all of course, but to many of them), look here: ;
Is it so hard to do? ;
I feel like you don’t use semicolons just to mess with non-JS devs...
Just because it works without, doesn’t mean it shouldn’t be used...
It’s as if i would stop using dots Just because I can it doesn’t mean it’s the way to go
It’s just making it more complicated for others to understand
Especially if the code looks like the spaghetti monster vomited into the IDE!
rant
please use it
js
semicolon