Skip to content

re: There's no "else if" in JS VIEW POST

re: One might use Linux for decades and never ever see a single line of the code. That’s true, there are very specific circumstances under which if mi...

99% of businesses ????????
If you consider that COBOL has been back ...
If you consider that many banks prefer continue with old COBOL (not the new one) for the ATM services.
I you consider that big manifactures build products IoT with a poorly code and very buggy.
I think that you're developing for excelence, despite I've seen in your code of elixir-iteraptor some IF statement

Legacy is legacy, there is no doubt (although COBOL was invented as a most imperative language ever.) I admit I exaggerated the percentage, though.

I've seen in your code of elixir-iteraptor some IF statement

I never said I am perfect. If I had 72hrs/day I would be always writing the good code avoiding ifs. This is a solid settlement: I use ifs to save some time, while I still expressly understand I could do better.

I'm intrigued by what you said about if-statements. I'm curious to know how you would write the following callback function.

someRequest(URL, (err, result) => {
    if (err) {
    } else console.log(result);

I'm still a novice so it's difficult for me to imagine doing some things without if-statements. I would appreciate it if you could show meπŸ˜…πŸ™‚.

You could use something like promises.

.then(result => console.log(result))
.catch(err => console.log(err));

Ooh. That's right. Forgot promises could do thatπŸ˜…. Thanks 😊

code of conduct - report abuse