This
if(a === b) {
blah
}
else {
bleh
}
or this
if(a === b) {
blah
} else {
bleh
}
Personally, I prefer the second one as it takes up less space and looks a lot cleaner and cooler
This
if(a === b) {
blah
}
else {
bleh
}
or this
if(a === b) {
blah
} else {
bleh
}
Personally, I prefer the second one as it takes up less space and looks a lot cleaner and cooler
The second. It takes up fewer lines than the other. And if you do the first you are a monster
both look horrible lmao
I would do this:
if (a === b) {
blah
}
else {
bleh
}
I agree with @JayAySeaOhBee14, just the fact that I have a different opinion. THIS is my superior looking:
if (a == b) {
blah
} else {
bleh
}
I prefer option C: Python.
# Smaller than your JS
if a == b:
blah
else:
bleh
# Even smaller
if a==b:blah
else:bleh
# Actually bigger than the previous option but one line
exec("if a==b:blah\nelse:bleh")
This is the clean way. Any other way is less readable and should be avoided except for some idiomatic code like comprehensions or ternary assignments. If you like compressing codes in few lines, learn perl and have fun with unreadable tiny unreadable scripts.
Fi
Fir
Firs
Firs Second of course
I prefer a===b:blah?bleh
actually.
Actually though I prefer the 2nd option : )
That is basically the 2nd option with highlightings.
that is a ternary assignment, for IfThenElse the second is more readable and preferred. And readability is something best learnt early …
Yea I actually like the 2nd one best, but something about minified javascript just always looks cool.
My preferred syntax looks something like this
if
(a === b)
{blah}
else
{bleh}
I prefer this:
if (a === b) {
blah;
} else {
bleh;
}
I guess you don’t what’s the difference between ==
and ===
…
I prefer the second one!
Maybe well be as the different is subtle. But if == is probably the one leading to less surprised for people not understanding that == != ===
I always thought they were the same until 3h ago…
Nope. Small bit difference and can surprise when not known.
I feel attacked…obviously the first is the best.
This is why y’all ain’t TL3. First one is the true way to program.