LISP is ugly
LISP is ugly
LISP is ugly
I raise you this: https://imgs.xkcd.com/comics/lisp_cycles.png
Directly linking the file of an XKCD should be illegal
I know it's not nearly as nested as this, but nesting in Rust annoys the hell out of me.
rust
impl { fn { for { match { case => { } } } } }
is something I've run into a few times
the loop or match statement could possibly be extracted to another function, depending on the situation. rustc will most likely inline it so its zero cost
Back when I was still in school, I ran a few tests on real world LISP and Java (the then dominant language, this was in the late days of Sun Microsystems succes).
Turns out most LISP programs had fewer parentheses then Java had braces, parens and brackets.
Java follows the paradigm of boilerplate oriented programming.
If your code looks like this, you seriously need to reconsider your code
are there any JS fans who argue that it's elegant? i thought the supposed advantage was that it's flexible and universal.
It's a stockholm syndrome kind of thing.
Well my Js isn't looking like that and it is really easy not too. But bad people write bad code.
Well, universal, anyway.
Weirdly, I've seen plenty of people who appear to genuinely like Js and Ts.
I learned Lisp at uni and hated it. Thankfully that was long enough ago that I’ve forgotten everything I learned about it.
I’m sorry to hear you learned nothing.
Yeah - pure functions and immutable data aren't always the right answer, but appreciating that they're damn good most of the time is a good first step. Writing obvious code that does exactly what it appears to do at first glance and not one thing more? Your colleagues will thank you when they have to work with your stuff.
If your code is that deeply nested, surely something has gone horribly wrong, yes?
Problem is that Js kind of encourages this being single threaded and using callbacks for anything blocking. To be fair, the new async syntax sugar helps in modern Js, but nesting a bunch of callbacks or promises was basically the way you did stuff for the longest time.
Yes and no. Any programming language encourages nesting as in the end the computer does nest your code. So it is only normal and predictable that languages would reflect that. BUT! Nest logic can often be inverted and by doing so, reduce how much nesting you need to do.
Can be
Code aesthetic: If your code looks like a triangle, you're seriously doing something wrong.
I prefer a bunch of
if (fucked_up) {return(error_code);}
for checking common errors.
Yup, never nest.
All the conditions should be checked and returned if they failed as you go through the function with the successful response being the last line.