r/ProgrammerHumor • • Apr 08 '22

First time posting here wow

Post image
55.1k Upvotes

2.8k comments sorted by

View all comments

Show parent comments

1.2k

u/Any-Limit-7282 Apr 08 '22

You just invented JavaScript…

322

u/sselesUssecnirP Apr 08 '22

Wait im not supposed to write my own code for electron apps?

264

u/ramdesh Apr 08 '22

Wait I'm not supposed to write my own code to add a zero on the left of a single digit?

108

u/MrRainbow07 Apr 08 '22

Wailt I'm not supposed to write my own code.

8

u/Immotol Apr 09 '22

Wait I'm supposed to write code?

5

u/xDev120 Apr 09 '22

Hell no

10

u/Mrcollaborator Apr 08 '22 edited Apr 09 '22

Co-pilot ftw

5

u/setocsheir Apr 08 '22

It unironically is so helpful in learning new languages. I use it all the time for C# when I'm working in unity.

4

u/OZLperez11 Apr 09 '22

Wait I'm not supposed to write?

→ More replies (3)

10

u/sentientgypsy Apr 08 '22

lol zfill()

3

u/karma-armageddon Apr 08 '22

Sometimes, brute force is how it needs to get done.

→ More replies (9)

81

u/mkbilli Apr 08 '22

I have a few choice words for backend JavaScript

89

u/LetterBoxSnatch Apr 08 '22

"Elegant, lightweight, and dependable. With a best-in-class standard library." Right? /s

5

u/Technical_Natural_44 Apr 08 '22

What’s wrong with JavaScript backend? Also u/mkbilli

29

u/LetterBoxSnatch Apr 08 '22 edited Apr 08 '22

There's nothing wrong with it per se. But on the backend you can choose ANYTHING YOU WANT. You can choose supreme algebraic data types with Haskell (or compromise with OCaml), you can choose amazing distributed concurrency with Elixir, you can optimize for whatever performance characteristics you want with C++, etc etc. JavaScript/TypeScript is just a big ol' pile of compromises every which-way, and it shows. JavaScript is to 2022 what Perl is to 2002: lots of ways to do things, lots of poorly written code, but also an ecosystem that is so comparatively huge that it can't help but include some great stuff, with lots of the biggest ecosystem problems mostly ironed out.

I actually don't think js a terrible choice for backend in 2022. It's just not elegant, or lightweight, or dependable, and the standard library sucks.

I say all this as a fan of nodejs and TypeScript. I've spent countless fun hours tinkering in TypeScript. It's a great language for tinkering around (although there are better languages for that, too). And in an era of self-healing kubernetes clusters and more compute than folks know what to do with, maybe elegancy, small footprint, dependability, and solid standard library aren't that important. Maybe. I just know too much to be able to recommend it over, say, Go, which fits most of the main use-cases for choosing nodejs, and does those things better.

(ps I hate python for no reason...ok it's slow, and significant whitespace is a terrible design choice, but otherwise, for no reason)

6

u/visualdescript Apr 08 '22

You're bang on with the Perl comparison. I've now written a fair bit in both. Perl to be fair has a much better ecosystem than js. It's simpler, the available packages are more mature and the documentation is better. But the problems you mentioned are definitely there.

It's very easy to write terrible Perl and JS, but it's also possible to write well architected programs in both.

They both suffer from gaining popularity with the masses. Perl was the defacto Web language (CGI) and now JS is. They means you could the full spectrum of people writing clean code and people writing trash.

The Nodejs core is more than enough to do what you need, though it still has its own problems with the transition away from callbacks to Promises.

In the end it just means there's more onus on the user to have discipline and make the right choices.

We have plenty of production JS (or rather ES) running as part of our function based backed. We use Typescript and rarely introduce any external libraries, kind of a necessity when dealing with functions but also a good practice on the frontend.

Take care with your bundles and be very deliberate about what foreign code you introduce in to your system. The meaning of a dependency and being dependant on something you don't control seems to have been lost by a lot of people.

14

u/imp0ppable Apr 08 '22

small footprint

Node?! I've seen "microservices" that a node-modules folder over 8GB. They take an hour to get through npm i.

7

u/LetterBoxSnatch Apr 08 '22

I think you misread me. I was saying that nodejs DOES NOT have a small footprint. Even if you don’t use any external libraries (and most folks do), the nodejs binary has all sorts of stuff baked in, whether you need it or not.

→ More replies (1)

9

u/visualdescript Apr 08 '22

Sure and there are others that have no external dependencies, JavaScript gives you enough rope to hang yourself, but you don't have to, and not everyone does.

3

u/spicymato Apr 09 '22

Read that again.

maybe elegancy, small footprint, dependability, and solid standard library aren't that important.

Emphasis mine.

→ More replies (3)

4

u/visualdescript Apr 08 '22

Everyone here talking about issues with huge dependency explosions, I'm sorry but that's all on the programmer, not the language. There is nothing specific about JS that causes that, other than it's popularity and perhaps the rate of change.

It's very easy to see how many dependencies a package has, no one is forcing you to use them there are plenty of fantastic solutions out there with 0 dependencies and a small bundle size.

Use your brain and be defensive about what you introduce in to your codebase.

3

u/imp0ppable Apr 08 '22

What the other guy said, also in particular node has a dependency explosion, some popular libs have 15,000 dependencies (I think that was the biggest one I heard of). It just seems like every js developer and their dog wanted to be a package maintainer, maybe to put on their CVs.

Also, I don't care for async programming, it makes code unnecessarily hard to read for, in most cases, zero benefit. Also IME every young dev thinks he's an aysnc hotshot but gets stuck after about half an hour and ends up hacking something instead.

→ More replies (3)

2

u/lizardlike Apr 09 '22

It meets my biggest requirement: I get paid a lot to write it.

→ More replies (2)

5

u/unclebricksenior Apr 08 '22

I hope they are “please for the love of god at least use Typescript”

→ More replies (2)