Skip to content

Comment on JavaScript right on the hardwareparent

Comments

Because everyone* knows JavaScript. I'd wager that the vast majority of professional software engineers work on the web, or very close to the web, and JavaScript is the lingua franca of the web. I mean just look at the front page of Hacker News on any given week. It's full of talk of JavaScript and new JavaScript libraries and new things to do in JavaScript. When you think about how many more people this can reach without them having to learn yet another language for a very specific thing, it makes sense.

*hyperbole, please forgive me for being not being completely literal.

Everybody thinks they know javascript, but on the contrary nobody actually knows it. It's a very twisted and powerful language. It has many quirks and many unknowns.

Most of the time if one thinks s/he knows javascript, actually s/he knows a higher level abstraction library and DOM built on javascript like Jquery.

Some people do know javascript. Implementations differ, but are getting more standardized as time goes on. Without the DOM and browser environment APIs, it gets a lot simpler. Do you think fewer people actually know javascript than actually know C++?

C++ is a bad example. C itself is mindblowinly complex, and C++ layers more on top of that. A better example might be Python, or possibly Lua. Languages that have been designed, rather than grown organically, unlike C++/C/Javascript.

C++ was grown organically? I think Bjarne Stroustrup would disagree.

By that I'd mean the way more and more complexity has been layered on over the years.

Of course some people do know Javascript inside out, but how many?

Yeah, but a basic level of javascript is often all that's necessary.

I had quite a few non-developers on my team, who knew enough javascript to have a "good enough" idea what was going on with the code, without having to bug me all the time.

I'd wager that the vast majority of professional software engineers work on the web

Yes, a majority of prof. software engineers who work for internet companies work on the web. But then there's also stuff like embedded, systems, databases (not the ones you hook up to some scripting language to generate html), medical, aerospace, industrial processes, etc.

The software industry is huge and only a small part of it is web related.

I mean just look at the front page of Hacker News

It's like assuming San Francisco was a model for all other cities on this planet. It's all about your local bubble. For you maybe really it looks like everyone (including your local coffeeshop owner) could win a JS hackathon. But for me I barely know an engineer who's fluent in JavaScript. Everything is C++ here.

Correction - everyone thinks that they know Javascript. It's a more twisted language than it appears.

It's still more approachable though than C or Lua where only some people think they know it.

And arduino is even more approachable again.

Don't you forget that Arduino is C++.

And? That's brilliant, as it provides some progression after learning the language! Once you're confident with Arduino, you can move onto C++, from there ASM, etc...

I may know javascript, but my god I wish I didn't have to.

Many people do enjoy writing JavaScript and view it as just as good as Python and others.

I've dealt with these kind of programmers on numerous occasions. While they may claim to know other programming languages, they usually don't know much about them at all, in reality. If they do know another language, it's PHP, which is just about as bad as JavaScript in most respects.

Any programmer who has real experience with a variety of different programming languages will become very aware of how inferior JavaScript inherently is.

JavaScript's problems go much beyond the quirks or oddities we see with programming languages in general. They're severe deficiencies (the lack of proper modules or namespacing, and the lack of proper class-based OO), or inexcusably stupid design flaws (semicolon insertion, its broken scoping rules, its broken type system, its broken prototype-based OO, its broken comparison operators, and so on).

No intelligent, experienced, self-respecting programmer will want anything to do with such a ridiculously flawed and broken language. They surely will not see it as good as Python or any other language that isn't rife with the unjustifiable stupidity that permeates every aspect of JavaScript.

Well, that's just unnecessarily offensive. I'm proficient in Python, Java, and C, and was at some point also fluent in PHP, Ruby, and Lisp. While I wouldn't particularly enjoy coding in Javascript, CoffeeScript is, to date, the best language I've worked with. I debug in JavaScript, so I'm not that far away from it.

Why is "class-based OO" necessary? There's nothing wrong with prototypal inheritance. The way modules are done in Node is pretty powerful compared to other languages I've used. The scoping rules are different, for sure, but I don't really see why you'd call them "broken". They're internally consistent and easily comprehensible.

Semicolon insertion is, admittedly a problem. The solution, of course, is to put in your own semicolons. If you do that, and use something approaching reasonable whitespace conventions, there isn't really a problem. JavaScript's `==` the like are, for sure, broken, but that's nothing a `===` can't fix. It's not like the other languages you mentioned wouldn't have issues without reasonable conventions.

There's nothing "offensive" about pointing out realities, even if they may be painful for some people to accept.

I find your arguments somewhat odd. You do openly admit that you "wouldn't particularly enjoy coding in Javascript". People don't say such things about good programming languages, especially when arguing in favor of them to some extent.

I also find it odd that you argue that there's nothing wrong with prototype-based OO, yet claim that CoffeeScript is the best language you've worked with. One of CoffeeScript's most useful and important features is that it adds very simplistic class-based OO to JavaScript. Go look at the example code in the "Classes, Inheritance, and Super" section of the CoffeeScript home page to see what I'm talking about. The CoffeeScript code is tolerable; the JavaScript that's outputted is horrendous. Hand-written JavaScript is often just as bad, if not worse.

The various JavaScript "module" systems are purely hacks. They abuse existing language features to fake modularity, poorly. They're nothing like the proper module support of other languages. And at least you admit that semicolon insertion and the broken comparison operators are serious issues. Many other JavaScript advocates refuse to, for whatever reason.

There's nothing wrong with admitting that JavaScript is a really bad language. I think you know that it is, and want to admit it, and I think you should. It doesn't deserve to be defended, because its problems are generally inexcusable in every respect.

There's nothing "offensive" about pointing out realities, even if they may be painful for some people to accept.

The problem is that your comments about JS tend to contain more hyperbole and opinion than undisputed reality.

JS obviously has flaws. But so does English. It's good to have a natural language that a large percentage of the world's population, across nationalities and ethnic groups, can speak. I think the same applies in programming. Programming languages are not just for telling a computer what to do; they're also for collaborating with other programmers. And once a code base is written in a particular language, it's often hard to make a case for rewriting it in a different language. So why not use a language that is popular, is cross-platform, is vendor-neutral, has multiple optimized implementations, and is likely to remain popular and well-supported for many years to come? JavaScript is that language.

FWIW, I have much more experience with Python and Lua than with JavaScript. I also do some work in C++. Yet, despite JavaScript's flaws, I'm defending it as a general-purpose programming language.

JavaScript has issues, but they are largely syntactical. Yes, `==` means something different than it does in every other language - but it is still a useful construct (if not worthy of its own operator). Yes, `Class.prototype.method` is overly verbose, but in CoffeeScript you get clean syntax without losing the beauty of prototypical inheritance.

The strengths of JavaScript, on the other hand, are deep. Everything is an object, functions as first-class citizens, the inheritance model, etc. The callback-based I/O of Node.js wouldn't work nearly as well in any other language I've seen, because JavaScript is such a good language.

I will take a language with syntactical deficiencies but a beautiful underlying model over the opposite any day, and I don't see anything about that statement that indicates that I'm a poor programmer who's only been exposed to PHP and JavaScript.

There's nothing wrong with admitting that JavaScript is a really bad language.

Your use of the word 'admitting' is peculiar. There's nothing wrong with claiming that JS is bad. There's also nothing wrong with claiming it's good.

I enjoy programming in CoffeeScript more than any other language I've used (Ruby, Python, Objective-C, a little Java, a little C). Plus, as dynamic languages go, it's fast. To me, these two things make CoffeeScript a fantastic language.

And since CoffeeScript is just syntactic sugar on top of JavaScript, well, I suppose JavaScript must at heart be a fantastic language too.

(Evidently today's my "someone is wrong on the Internet" day).

I also find it odd that you argue that there's nothing wrong with prototype-based OO, yet claim that CoffeeScript is the best language you've worked with

You don't have to use the OO inheritance features in CoffeeScript in order to like it on the whole.

This is the key. With good conventions and tools it is perfectly fine language. The concept of "Programming into one's language" from Code Complete applies strongly:

> Programmers who program "in" a language limit their thoughts to constructs that the language directly supports. If the language tools are primitive, the programmer's thoughts will also be primitive.

> Programmers who program "into" a language first decide what thoughts they want to express, and then they determine how to express those thoughts using the tools provided by their specific language.

I disagree with Coffeescript though, nothing will make that shit readable to me. :P

What a bunch of pompous bullshit. From what you've said it seems you've never met a talented JS programmer.

Do they exist?!

I've met talented JavaScript programmers. They're just quite good at using other languages, too, and thus choose not to use JavaScript whenever possible.

I'd wager that you know as much about javascript as you do about presenting a convincing point of view.

I agree. I sort of like javascript now, but it was an acquired taste after force-feeding myself the language.

If you're telling the truth, you don't know it.

Very nice analogy (the lingua franca). The state of CS and the convergence we're seeing toward the web worries me though.

Can I ask why it worries you? Honestly just curious. Is it the performance hits of more levels of abstraction? Or fear of all data being in the "cloud"?

Personally it worries me because people can build whatever they want and call themselves "programmers". It encourages a state in the industry when knowing about data structures, hardware, turing machines or the other fundamentals of computer science are considered unecessary. Perhaps they are, from a business standpoint. However, it will eventually inhibit growth of the discipline as a whole.

A common rebuttal to that is "it allows people to get into programming more easily". I personally think this is horseshit. There are a multitude of ways to get started with programming, and javascript is in many ways the one that teaches the worst practices and patterns of them all.

I understand where you are coming from, and I don't like the "it allows people to get into programming more easily" excuse either.

But I don't really think it will inhibit growth. I think that it is more likely just to create two main groups of people that call themselves programmers. The people that know HTML and jQuery and the actual programmers. I don't think it will do anything to the growth of real programming, it just might mean we get lots of people calling themselves programmers who really aren't. But that happens already.

I think that segregation in of itself can be dangerous too though. People will get stuck in the web programmer mindset, and never progress if they're interested in anything else.

You seem to think these programmers are content with simply learning only what they need to know and calling it a day.

As a self taught developer, I find it offensive that you think I would go through all the trouble of teaching myself how to code, and then rest on my laurels, like I wasn't inherently curious and thoughtful.

Since learning Javascript front to back, I've developed a curiosity with strictly typed languages, assembly, computer science, Big O notation and other (what I consider) hardcore disciplines in computing.

Javascript was my gateway, and I love it to death, but I'm not a javascript developer any more than a C developer is simply a C developer.

I don't intend to offend you, but I think you illustrate a problem with many programmers who have come into the field with a self-taught JavaScript or PHP background, and without any sort of a formal education.

Type systems, complexity analysis, and assembly language programming, for example, aren't "hardcore disciplines in computing". They're the basic foundation upon which the rest of our knowledge is built. They are among the minimal level of knowledge that all programmers should have.

When you understand concepts such as those first, and are exposed to JavaScript later on, it's plainly obvious how inexcusably bad JavaScript is. While theory may not always work well in practice, JavaScript goes out of its way to ignore sensible and practical theory in every way possible.

People starting with JavaScript (or PHP; JavaScript isn't alone in being a bad language), but without this basic theoretical knowledge, don't seem to realize how bad the language truly is. It's unfortunate to see them not accept and admit to these flaws, even after the learn that there are much better ways of doing things.

Type systems, complexity analysis, and assembly language programming, for example, aren't "hardcore disciplines in computing". They're the basic foundation upon which the rest of our knowledge is built.

Your second sentence pretty much defines "hardcore". The "hard core" of anything is what supports the rest. Originally the term is from the mid-19th century and refers to a layer of broken stones and bricks that provided support for a building project, commonly roads.

http://boards.straightdope.com/sdmb/showthread.php?t=523412

People like yourself are the exception, usually the majority follows what the parent post was stating.

As someone that codes since 1986 with a CS degree, I am often dismayed what many "programmers" seem to know nowadays.

Programmer may have been an elite title at one time, but now it's just like saying gardner, chef, or scientist. You just have to work a little harder to figure out whether or not someone is a moron. There have always been morons and there always will be. I may be one of them!

To quote Sturgeon "90% of everything is CRUD". Majority of people that get CS now is due to money (how else to justify the expense of a diploma?), not the appeal computers have, and it's been like that for a while.

Lowering barrier to entry is +EV move, almost always. It multiplies crud but more importantly multiplies the 10% that are worth the crud.

Majority of people that get CS now is due to money (how else to justify the expense of a diploma?)

Not sure where you are, but universities in Europe are not like in USA.

In many countries public universities are more renowned than private ones and in some, it is even quite symbolic what you pay per semester.

As opposed to studying for five years in a college, learning Java and programming in Java exclusively, never learning anything outside the Java and never perfecting?

People's curiosity is what motivates them to experiment and learn new things, not how or what language they learn (I started with Basic which apparently causes brain damage and I'm getting along fine). If they are curious on their own, they'll pick up data-structures/asm/c etc.

As opposed to studying for five years in a college, learning Java and programming in Java exclusively, never learning anything outside the Java and never perfecting?

Uau!? Do such universities exist?

You can write Java in any language if you are persistent enough.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.