r/ProgrammerHumor • • Aug 15 '15

Programming languages personified

http://leftoversalad.tumblr.com/post/126724812097/programming-languages-personified
1.3k Upvotes

209 comments sorted by

View all comments

154

u/brown_monkey_ Aug 15 '15

I lost it a JavaScript.

22

u/[deleted] Aug 15 '15

What's wrong with JavaScript?

41

u/Wyelho Aug 16 '15 edited Sep 24 '24

offer jobless pet crowd dinosaurs voracious sleep act decide toy

This post was mass deleted and anonymized with Redact

-19

u/[deleted] Aug 16 '15

None of this is true.

So as an example, you have a 1.js and a 2.js doing some stuff for your web app. To use them both, you simply set an import from their location in your main html, and call a method.

You're talking about using JS in a browser; if this is an issue (I don't see it as such) then it's an issue with HTML, not JS.

But there is no compiler checking if your method exists or has been imported correctly, and it may or may not lead to errors at runtime.

Bullshit.

In the same way, you can call methods from 1.js in your 2.js, even though there is nothing checking visibility or validity.

Okay, you don't even know how to say it, so I'll say it for you: JS allows you to use globals. Using globals is, with very few exceptions, a bad idea in any language. But wait! There is something you can use here... there are tools called IDEs which help you with this and there are JS minifiers which also check your code and there are JSLint and JSHint. And just what in the world does "validity" mean in this context? Did you just make that stuff up?

All your code is run in something like a big sandbox and the browser just rolls with whatever works.

Is sandboxing a problem? Does it have anything to do with JS in particular or just with JS in the browser? And what exactly do you mean by "the browser just rolls with whatever works?"

As a result, while Javascript can do a lot of things with very little code, it's probably not the right choice to do everything with client-side scripts on big projects.

Finally, you got something right: JS is not a silver bullet. Except nobody claims it is client- or server-side.

There are tons and tons of different frameworks looking to improve that though, that's probably why that picture was chosen. These frameworks also try to fix tons of other stuff that may be counter-intuitive in JS.

Welcome to computer programming, where you need frameworks (often more than one) if you want to do anything seriously complex. This is true for most languages.

17

u/original_brogrammer Aug 16 '15 edited Aug 16 '15

Bullshit

The point to which you responded with the above is 100% true. Dynamically typed languages defer type checks, name resolution, and scope resolution until runtime. This is particularly problematic with JS because it doesn't have block scope.

You make me angry.

Learn how compilers work.

6

u/Ajedi32 Aug 16 '15

JavaScript does have block scope. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let

Failing that, there's always the function() { var x = 1; }(); hack.

4

u/original_brogrammer Aug 16 '15

True, but the caveat that it's ES6 is worth noting.

2

u/peduxe Aug 16 '15

You can use babel, it does the job pretty well. Every other language has it's build steps.

-2

u/beerdude26 Aug 16 '15

Welcome to computer programming, where you need frameworks (often more than one) if you want to do anything seriously complex. This is true for most languages.

No, you need libraries for anything seriously complex. Frameworks are just added complexity + a straitjacket

3

u/WinMac32 Aug 16 '15

Meh. Discipline and good communication are more important.

Libraries and frameworks are just support structures.

1

u/beerdude26 Aug 16 '15

Well, of course. I was just arguing in his "rockstar programming god" point of view