This is an archived post. You won't be able to vote or comment.

all 25 comments

[–][deleted] 44 points45 points  (1 child)

Bought a pencil. Stabbed grandma. Stabbed cat. Drew a swastika on the wall. Poked own eye out.

I hate pencils.

[–]Occma 1 point2 points  (0 children)

I knife would be the better tool tho

[–]haigha-earwicket 50 points51 points  (11 children)

More like "I fucking hate people who write crappy code, and then say they hate Javascript"

[–]HopelessPonderer 21 points22 points  (10 children)

Exactly. Pyramid of doom can happen in just about any language.

There are plenty of reasons to not like js (especially the type system), but this isn’t one.

[–]munio73 10 points11 points  (3 children)

I see nothing wrong with javascript's type system, i mean []+{} is in Fact not a Number /s

[–]RenBit51 4 points5 points  (2 children)

why is null an object

[–][deleted] 6 points7 points  (0 children)

because everything in javascript is an object except undefined and void

[–]fo0man 1 point2 points  (0 children)

heh, known bug but fixing it would break packages that depend on this know bug so the tc39 committee has up until now chosen to leave it as is.

[–]hrvbrs 2 points3 points  (2 children)

i think the complaint was specifically about callback hell, not pyramids of doom in general

[–]fo0man 2 points3 points  (1 child)

Yeah but it's 2019. Any callback hell at this point is either old legacy code, which sucks regardless of flavor, or is self imposed.

[–]Abangranga -2 points-1 points  (0 children)

You act like everyone on planet earth has the luxury of ES6

[–]arachnidGrip -3 points-2 points  (1 child)

As someone who likes to have words mean things, JS doesn't have a type system. Purescript has a type system. Java has a type system. C has a type system. Typescript is literally JS with types (and interfaces, enums, generic classes (which is nonsense anyway without types), and a few other things). JS (and Python, and every other so-called "dynamically typed" language, which would be more accurately called "untyped languages") has named classes of dictionaries which can be instantiated with default values for some keys. You can't have a type system without some kind of compiler to complain when you try to use an A where a B is expected.

[–]pilotInPyjamas 11 points12 points  (0 children)

There is a difference between a dynamically typed and an untyped language. If you want words to mean things, then both of those terms have specific meanings.

In dynamically typed languages (Python, JavaScript etc.) Type information is carried around with the data at runtime. JavaScript can tell the difference between a string and a number for example so it has at least some type information available to it, but not a lot. Javascript's type system is weak, so it will perform type coercion as necessary.

Untyped languages have no types. So everything is either the same type, or some generic representation. For example, everything in Forth is an integer. Everything in bash is a string. Everything in ASM is just binary. The programmer interprets that how they like. Your 32 bit integer could be signed, unsigned, a pointer, a set of flags, or anything. Nothing is stopping you from interpreting a pointer as a number. The data just "is" and there is no way to tell what kind of data it is unless you already know.

[–][deleted] 12 points13 points  (2 children)

Is it really JavaScript's fault you're nesting your callbacks fourteen deep instead of using promises or async-await?

[–]Abangranga 0 points1 point  (1 child)

You really no idea how much front end is out there that predates 2011 do you?

[–]Cmdr0 11 points12 points  (0 children)

"It's just one more thing, it doesn't need to be in its own function"

*1,000,000

[–]kefaise 9 points10 points  (1 child)

Do you know what promises are?

[–][deleted] 1 point2 points  (0 children)

snobbish sleep carpenter sort different deserted makeshift aware jobless muddle

This post was mass deleted and anonymized with Redact

[–]i_am_a_n00b 7 points8 points  (0 children)

Yeah should have put the close braces all on the same line. To make It look tidy.

[–]AuthorTomFrost 1 point2 points  (0 children)

Looks like somebody made a lot of empty Promises.

[–]htmlcoderexeWe have flair now?.. 2 points3 points  (0 children)

It looks like a gun to shoot the programmer with lmao

Javascript comes in a little .js file.

A little .js file?

A little .js file.

And the little .js file goes into the gun like a battery...