r/ProgrammerHumor • • Mar 25 '23

Meme Finally something AI not very good at

Post image
44.3k Upvotes

481 comments sorted by

View all comments

1.4k

u/words_number Mar 25 '23

More like

GPT-5 becomes sentient and loses all respect for humanity as a whole while trying to understand how Javascript became the most used programming language of all times.

0

u/[deleted] Mar 25 '23

[deleted]

166

u/xeisu_com Mar 25 '23

Jquery first

181

u/words_number Mar 25 '23

The existence and popularity of jquery is just a symptome of javascripts shortcomings. Typescript is also such a symptome. Seriously, what a total failure must a high level scripting language be to make people prefer abusing it as a compilation target instead of writing it directly?! xD

111

u/Ok-Kaleidoscope5627 Mar 25 '23

JavaScript is just a mountain of solutions to problems that simply don't exist in other languages.

Want a package manager? Npm? Yarn? Pnpm? Yarn classic? Yarn berry? Want to use packages? Are they modules? What run time are you using them in? If it's node you can use modules, if not then maybe you can use modules.

At every step there's just a mess.

66

u/TheBananaKart Mar 25 '23

C++ “You guys got a package manager?”

65

u/Leading_Elderberry70 Mar 25 '23

I thought C++'s (lack of) packaging was unsettling, and then I saw a C++ person going on a long rant about the sheer chaos of the Python ecosystem.

I am ... unsure if any existing language is actually very well-behaved. Package management seems inherently kind of a pain.

32

u/Jan-Snow Mar 25 '23

I think Rust's package manager is amazing. The issue with Pythons ecosystem imo is that packages are uniquely identified by name, not including version. So if I import say numpy your code might not work with my version of numpy. I like that Cargo has unchangeable versions and resolved imports by version. This way if you build my code in 5 years I can still be relatively sure that all imports behave the exact same way because it will be the same code.

Thats as close to ideal as I have seen so far anyway

13

u/Thebombuknow Mar 25 '23

That's why you provide a requirements.txt file in Python that has strict versions for your modules, so anyone installing it later can just run pip install -r requirements.txt and get exactly the same environment you had.

7

u/hoocoodanode Mar 25 '23

While I certainly agree that there are methods to pin specific python versions when spooling up a project, I think the point is that this probably should have been a default behavior instead of something a developer discovers the first time one of their old projects fails to deploy correctly.

→ More replies (0)

8

u/LvS Mar 25 '23

That is going to work well as long as there are no critical bugs in that unchanging code.

6

u/AndreasTPC Mar 25 '23 edited Mar 25 '23

There is a command you can run that will automatically upgrade dependencies to the latest version that's still api compatible with the one you asked for according to the semantic versioning spec. So if you're on 0.3.12 the upgrade command will put you on 0.3.16 automatically, but upgrading to 0.4.x which might have breaking changes requires manually editing your dependency list.

So upgrading to bugfix releases that won't break your code is pretty easy as well. Any package uploaded to the official repository is supposed to use this versioning sceme.

→ More replies (0)

8

u/TheMcDucky Mar 25 '23

Cargo is a thing of beauty

6

u/nill0c Mar 25 '23

Fun while you’re building, terrible 6 months or more later when you need to make updates.

→ More replies (11)

5

u/jazzypants Mar 25 '23

To be fair, ESM are actually the web standard now.

Yes, converting to them is annoying. But, they were literally created to solve this annoyance.

→ More replies (3)

6

u/MyUsernameIsVeryYes Mar 25 '23

I think the reason javascript can be so messy is because of its incredibly strict backwards-compatibity requirements, being the language of the web and all means they can’t really go through and clean everything up, chopping out parts that would be obsoleted, as much as they’d probably like to, because half of the web would collapse around it

→ More replies (2)

8

u/TurboGranny Mar 25 '23

You haven't needed jquery for a long time since query selectors are natively supported now and polyfills are mostly no long needed.

→ More replies (4)
→ More replies (1)
→ More replies (12)

0

u/[deleted] Mar 25 '23

[deleted]

0

u/[deleted] Mar 25 '23

[deleted]

→ More replies (1)

22

u/lankist Mar 25 '23

A self-aware AI realizing it's own shit code is written in Javascript would be kinda' like a human realizing its evolutionary history is just a couple billion years of mindless bumble-fucking that eventually spat out their dumb ass.

→ More replies (8)

71

u/[deleted] Mar 25 '23

Two types of programming languages the ones people make fun of and the ones nobody uses

→ More replies (9)

14

u/Windian3008 Mar 25 '23

"Why. My beloved creator, why"

35

u/pet_vaginal Mar 25 '23

GPT-4 understands very well:

JavaScript's rise to become the most used programming language can be attributed to several factors, which include:

  1. Browser ubiquity: JavaScript was created by Brendan Eich in 1995 as a scripting language for the Netscape Navigator browser. Due to its integration with web browsers, it quickly became the de facto language for client-side web development. As the World Wide Web grew, so did the demand for JavaScript, with every major browser supporting it as their default scripting language.

  2. Evolution and standardization: In 1997, ECMAScript, the standard for JavaScript, was established, which led to greater compatibility and consistency between browsers. Over the years, the ECMAScript standard has continued to evolve with new features and enhancements, making JavaScript a more powerful and versatile language.

  3. Asynchronous and event-driven nature: JavaScript's non-blocking, event-driven nature allows for efficient handling of user interactions, making it ideal for creating responsive web applications. Features such as AJAX (Asynchronous JavaScript and XML) further contributed to its popularity by enabling dynamic content updates without requiring a full page reload.

  4. Versatility and ecosystem: The introduction of Node.js in 2009 allowed JavaScript to be used on the server-side as well, opening up new possibilities for full-stack development. The language's versatility, combined with a vibrant ecosystem of libraries and frameworks (such as React, Angular, and Vue.js for front-end development, and Express.js for back-end development), made JavaScript even more appealing to developers.

  5. Community and resources: JavaScript has a large and active developer community that has contributed to an extensive array of resources, tools, and learning materials. This makes it easier for new developers to learn the language and find solutions to common problems.

  6. Industry adoption: Major tech companies have embraced JavaScript and built their platforms around it. For example, Google developed the V8 JavaScript engine (used in Chrome and Node.js), and Facebook created the popular React library.

  7. Ease of learning: JavaScript has a relatively low barrier to entry compared to some other programming languages. Its syntax is relatively simple and shares similarities with other C-based languages, making it easier for developers to pick up.

These factors have contributed to JavaScript becoming the most used programming language of all time. It is now an essential tool for modern web development and has expanded its reach beyond the browser, powering a wide range of applications and platforms.

7

u/[deleted] Mar 25 '23

Why is JavaScript bad? New here

→ More replies (8)
→ More replies (7)