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
-
b3b345695yDid you know a bool can also suck?
bool programmingStyle = false;
if ( programmingStyle. sucks( ) )
{
learnonothersitesbutthisonebecausemyfunctionnamingsalsosucks( );
} -
Dacexi122615yThat's actually a real and useful thing. So let's say you have something complicated to check, instead of having like a 3 line if you could make a function which returns true or false.
-
@Dacexi I don't quite understand what you are saying. Do you mean a function which returns bool? This rant is about a method on the bool type: in this case true.stop()
-
That code doesn't make any sense... Sad sounds like a property rather than a function. === true is also useless code inflation.
Should be
if(sad) {
sad.stop();
beAwesome();
}
... and even then... ".stop()" on a boolean?? But I guess that's what this rant was initially about. -
@arminlinzbauer Correct. :)
But it's possible, since Javascript is not a strongly typed language (compare my jsfiddle from another comment).
Of course that you CAN do something doesn't necessarily imply that you SHOULD. -
@arminlinzbauer On an additional note:
In Javascript '=== true' is NOT redundant.
=== checks for type and value equality. If you don't compare a variable to true with '===' it might still be 'truthy' (evaluate to true if interpreted as boolean). For example, the following expression will print true:
if( "false" && { } && (function() {}) && 5) {
console.log("true");
}
Please note, that I didn't test these statements - is entirely possible I made a mistake. -
Orionss29285yWell, OpenClassrooms is a quite good french website to learn programming basics. And when I talk about basics, it's just an introduction. They don't go deeper than the surface of every language or technologies and back in past, they were a lot hated because they gived bad advices and bad practices.
I learned my first programming languages on this website, almost ten years ago, and that's worst than it was before :/ -
@theCatholic - I'm aware of that, but for something as simple as that, a 'truthy' value should be enough to justify the execution of this block imo...
-
Totally overriding prototype methods because fuck the next developer and his understanding of a string.
Or, uh, Boolean in this case. -
Shisuki6235yBack in the day they were called "Le site du zéro" which translates to "The zero's website"
Guess they're loyal to their ideology.. -
@theCalcaholic Sometimes courses like that are overpriced.
The marketing is pretty good however. Like, "follow this course, and you will be the next Mark Zuckerberg" -
@theCalcaholic you were just outed friendo!
Uh, also, do you know how to unreport a comment? I done did fucked up and accidentally reported yours when I was meant to hit reply. Fml.
If you want, report this one for me! It’d make me feel better about the situation. -
@theCalcaholic so sorry :0 I've been staring on a monitor for 9 hours straight, I guess my vision got a bit blurry...
-
-
Noob65685yThat's not real JavaScript!
In 2017 real JS has to be chained and nested to the fuck!
if ( sad().isTrue === true ? true : false) {
return new Promise( (resolve, reject) => {
try {
resolve(sad().stop().beAwesome().call(this));
} catch(err) {
reject(Error(err.statusText));
}
};
} -
Noob65685y@theCalcaholic I wanted to add a generator there as well.
Also ES17... You live in 2026 -
@Noob Right. 😂
ECMAScript versions always confuse me.
ES 6 = ES 2015
ES 7 = ES 2016
and so on.
I was referring to ES 7, of course, but I guess, I messed up. :P -
This place has the most polite, well mannered community I’ve seen anywhere on the Internet.
Quick someone call me a cunt before I cry. -
I always hated these BS pseudocode "jokes" that people write. It is almost consistently crap code anyway
Related Rants
Hmm,
boolean with a stop function, looks wierd
rant
js