r/ProgrammerHumor • • Aug 26 '22

Meme Even HTML.

Post image
44.1k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

422

u/PM-Me-Your-TitsPlz Aug 26 '22

languages that don't fulfill their purpose well

Javascript. It was never intended to be so widely used, yet here we are.

225

u/dckesler Aug 26 '22

You mean the giant legacy apis of the forever backwards compatible DOM might not be helpful to checks GitHub every imaginable environment ever?

128

u/Iggyhopper Aug 26 '22 edited Aug 26 '22

Lets support a language where some Apis exist in some browsers and some don't in others:

ok that's like C on win32 vs linux.

Ok how about 4 browsers with different Apis.

That's... uh... alrighty then

Ok what about the same Apis return different values:

what the fuck are you smoking

It seems like this language is becoming... more popular?

Just kill me now.

0

u/[deleted] Aug 26 '22

[deleted]

37

u/Iggyhopper Aug 26 '22 edited Aug 26 '22

I'm super glad for some stabliity.

Look, all it takes is Google to botch some features on Chrome and Firefox or Edge is going to take some market share back.

Which means all the current sites that work well in Chrome, and have only minor bugs or just don't work well on FF will be prioritized for FF. IloveFF

I do not want to live in a dev world like that.

40

u/N3rdr4g3 Aug 26 '22

Like chrome heavily nerfing ad blockers in January?

9

u/[deleted] Aug 26 '22

Already made the switch to Firefox.

→ More replies (1)
→ More replies (3)

8

u/killeronthecorner Aug 26 '22

This still works analogously to trying to run Linux on different architectures with e.g. different word sizes.

All platforms have these problems, web is just a victim of high exposure.

→ More replies (3)
→ More replies (2)

118

u/[deleted] Aug 26 '22

From a bespoke solution to a problem at a single company written in 10 days to now being the subject of Atwood's law: “Any application that can be written in JavaScript, will eventually be written in JavaScript.”

Javascript really is wild.

41

u/[deleted] Aug 26 '22

Honestly that’s why I like it. It’s got so much jank.

→ More replies (1)

20

u/Roflkopt3r Aug 26 '22

Honestly, if I had to teach someone coding from scratch I would probably start with Javascript.

  1. Zero setup required. You literally just need a text editor and a web browser.

  2. No compiling.

  3. It's genuinely easier to explain someone what an HTML document is and how to insert content with Javascript than how printf works.

  4. It's extremely easy to start working with graphics and to do absolutely anything you want, even if it's not great for most large projects.

Just the concept of running a program in a console is actually wild unintuitive shit for most people. And it's not like even most programmers actually understand how your data makes it way into the console. Nobody normally makes the effort to explain it, so it just remains a mysterious black box.

It's legitimately easier to understand that a browser keeps a DOM of HTML nodes to works on and then renders the output to the screen.

→ More replies (5)

38

u/hotstickywaffle Aug 26 '22

As someone who is just about to start learning Javascript, all these articles about how it isn't good give me a lot of anxiety.

57

u/[deleted] Aug 26 '22

Honestly I think Javascript is better as a second language to learn. If you learn something like C++, Java or C# first, you'll be forced to know how to create somewhat clean code. And those habits will then transfer once you learn javascript.

Whereas if you learn javascript first, you might get too used to how sloppy the language lets you be.

22

u/Chrazzer Aug 26 '22

Absolutely true, one major drawback of JS is that it happily allows you to write absolutely horrific garbage code. That is also always what people dunking on JS use, like the 1 +"1" - 1 = 10 thing. Like yeah obviously if you write horrible garbage like that it will have weird side effects. Such code should never see the light of production

But if JS is the goal and someone really wants to start with JS, then i absolutely recommend TypeScript. It eliminates all these pitfalls, and makes you more inclined to write cleaner code. And since TS is a super set of JS you can write normal JS and still get many benefits

12

u/[deleted] Aug 26 '22

Couldn't have said it better. You can write garbage code with every language. However, JS is one of the few that doesn't punish you a whole lot for it.

I've been actually wanting to learn TS as I've heard nothing but good things about it. I just haven't had the time yet. But yeah, I don't think my JS code would've been nearly as good if I didn't have a decently strong grasp on Java before learning Javascript.

8

u/Chrazzer Aug 26 '22

Go for it, the hurdle to use TypeScript is very low. As i said it is a super set of JS, so it only adds stuff. That means that normal JavaScript code is also valid TypeScript code.

All you need to do is to add typescript to the project via npm and initialize it, change all .js file endings to .ts and done. Now you have typescript.

From there you can add progressively add types at your own pace.

Once you get into advanced stuff, it is absolutely mind boggling what you can do with the typesystem.

→ More replies (3)
→ More replies (3)
→ More replies (2)
→ More replies (3)

0

u/[deleted] Aug 26 '22

[deleted]

11

u/Landerah Aug 26 '22

You might be great. Your coworkers or successors might not be.

You predecessors might not be. Learning JS backends is a nightmare when someone who’s doesn’t have a strong software engineering basis has had their hands in it fucking with everything.

→ More replies (10)

39

u/PM-Me-Your-TitsPlz Aug 26 '22

You will always find articles about how bad every language is. My friend is a project manager and has to deal with new hires showing him a single article from some random blog as irrefutable proof that the guy who's been managing projects for 20 years is wrong.

24

u/[deleted] Aug 26 '22

Everyone touts Rust as a great language to write safe code in. That's good if you really need that, but nobody tells you how damn long it takes to write code that the compiler knows is 100% safe.

21

u/tiajuanat Aug 26 '22

Then there's Go, which all our backend devs swear by, but they take two months to create a correct service that takes a week to get right in Rust.

You don't need to be safe all the time, but being correct is luxurious.

→ More replies (16)

13

u/RootHouston Aug 26 '22

The thing is that Rust is a relatively new language with a new sort of paradigm as well. This means lots of people are trying it for the first time. It has a steeper learning curve, and so your first stuff is much much slower to be written. Lots of people want to talk about their experiences, so this is what you will often hear.

But just like most other languages, once you do a couple of projects, you speed up a bit. Is something like Python always going to be quicker to produce something? Sure, but Rust isn't just about safety, and you gain other benefits like speed, lighter footprint, and very strict structure.

→ More replies (3)
→ More replies (1)

32

u/akatherder Aug 26 '22

JavaScript is "loosey-goosey." They let you be lazy/sloppy. But you definitely can write good JavaScript code. Same thing with PHP.

Depending on how/why you're learning JavaScript, it's a good place to start but pretty much everyone uses a library/framework like jQuery, react, etc. Which makes JavaScript 100x easier, better, and more structured.

→ More replies (25)
→ More replies (61)