Live data from Hacker News

JavaScript is Good, Actually

ashfurrow.com

201–210 of 369 posts

Re: JavaScript is Good, Actually

#201

Oh man, I hate these articles as they bring out the trolls. Javascript is a great language because it allows you to develop incredibly fast (scripting language) for a platform that runs everywhere (the web). It used to be far simpler, but IMHO, insecurity because of all of the FUD that this sort of article prescribes, has meant that the language has bloated to incorporate all sorts of syntax improvements and new patt…

>It's not a systems programming language, so all the comparisons against typed, compiled languages are moot. No they are not 'moot'. At least not if you're building applications with 100k+ LOC. For dinky websites and small projects I'm with you. >Introducing transpiling as a mandatory pattern for JS development was a mistake. Again, what are you building? A dinky website, or a large application that you'll have to ma…

No, they are moot. I've built several 100k+ LOC apps with JavaScript. You have no clue what you're talking about.

Re: JavaScript is Good, Actually

#202

Earlier quoted context omitted.

> It's not a great language (clearly demonstrated by the discussion about it being good or not) but it's not terrible I'm wondering what would be an example of a great language? Because we know that there are only two kinds of languages: the ones people complain about and the ones nobody uses

My response to this is usually that Ruby is a great language because it's easy to get useful work done with a large, meaningful subset of the language. You can ignore the warts just by not using them. You can't do that in JS, because the warts are so fundamental. (yes, you can be tripped up by library authors in Ruby, but there's community backpressure against providing footguns).

I don't agree. The ruby community had a recent love affair with dsl. Taking a peak at rspec library source made my eyes bleed. There's also a huge preference for "magic" even outside of rails, so much that when you want to augment or add functionality you're supposed to monkey patch. There's also a huge preference for "clean" syntax when it doesn't necessarily improve maintainability--it just makes the number of odd syntax rules you have to learn and internalize more convoluted. Also I feel as though the reason there's so much preference for tests and strict rubocop is exactly because there are too many footguns baked into the language.

That's not to say other dynamically typed languages (including js) or even statically typed languages are all that much better. But I would say ruby is really showing its age with the number of warts and hacks that have accumulated.

Re: JavaScript is Good, Actually

#203
post #177

Earlier quoted context omitted.

Haskell was the first thing that came to mind. I can show with one hand, by joining my pointer-finger and thumb, the number of people I know that use it. It looks lovely, and it's something I'd very much like to learn some day but I can't for the life of me think of what I would use it for. Are there any killer apps out there for it? At least with lisp, I can configure emacs ...

Pandoc and Xmonad are written in Haskell.

Also git-annex!

Re: JavaScript is Good, Actually

#204

Oh man, I hate these articles as they bring out the trolls. Javascript is a great language because it allows you to develop incredibly fast (scripting language) for a platform that runs everywhere (the web). It used to be far simpler, but IMHO, insecurity because of all of the FUD that this sort of article prescribes, has meant that the language has bloated to incorporate all sorts of syntax improvements and new patt…

Arguing about it's merits doesn't miss the point at all because it isn't limited to the browser. Even other dynamic languages generally have a better design and are much easier to debug in production in my experience.

Also, people making legitimate criticisms about a technology (in this case to try and cut through the hype train a bit) are not 'trolls'.

Re: JavaScript is Good, Actually

#205

Switching back to Java after having spent a long time in JavaScript land with modern standards made me realize how great JavaScript had become. The biggest reason for JavaScripts greatness to me is JSON. I couldn't understand how Java developers put up with such bulky ways to deal with data. After some time in Java land I've come back to appreciating its strengths again though. Code completion is nice. I'm kind of ho…

Try Python - JSON works very well with it and while Python has its flaws, I think it's a much better language to use.

Ehhhh...it works okay but the same fundamental serialization problem exists. The fact that dict can be roughly equivalent to JSON helps, but as soon as you start including more complex types you're going to have to use something to handle serialization/deserialization. Which really isn't that complex with Java if you're using a few convenience libraries: gson, orika/mapstruct, lombok all make it a lot less painful to write this kind of boilerplate serialization code.

Re: JavaScript is Good, Actually

#206

Earlier quoted context omitted.

>It's not a systems programming language, so all the comparisons against typed, compiled languages are moot. No they are not 'moot'. At least not if you're building applications with 100k+ LOC. For dinky websites and small projects I'm with you. >Introducing transpiling as a mandatory pattern for JS development was a mistake. Again, what are you building? A dinky website, or a large application that you'll have to ma…

No, they are moot. I've built several 100k+ LOC apps with JavaScript. You have no clue what you're talking about.

If you only have hammer everything looks like nail. You will enjoy other languages much more.

Re: JavaScript is Good, Actually

#207
post #94

Earlier quoted context omitted.

If we’re talking about “dynamic CRUD over socket abstracted to death”-style tasks, and not considering minor preferences like syntax, then python, lua, most of lisp/schemes, perl. All of these allow enough meta-anything to do: ./file.src: func api_foo() for x in objs x.a = fetch(x.b) ui.btnok.enabled = yes commit() And have foo exported as api, and when called, all clients/servers, databases synced, validations passe…

I think python is a terrible language. It has so little syntax you can't tell the difference between various things. A variable declaration, a reassignment, a keyword, a whatever else, they don't have any visual distinction from each other. I also find that python has reserved a whole bunch of keywords that I can't use as function names, making APIs hard to create with appropriate names. You also have to pollute your…

> I also find that python has reserved a whole bunch of keywords that I can't use as function names, making APIs hard to create with appropriate names.

Python is one of the imperative languages with fewer number keywords in existence. Compare for example the number of keywords in Python[1] with Javascript[2].

Maybe you're confusing the built-in functions in Python language, like len() or str(), however since they're functions you can reassign them (not a good idea, however in a limited scope it works).

[1]: https://en.wikipedia.org/wiki/Python_syntax_and_semantics#Ke... [2]: https://www.w3schools.com/js/js_reserved.asp

> It has so little syntax you can't tell the difference between various things. A variable declaration, a reassignment, a keyword, a whatever else, they don't have any visual distinction from each other.

The fact that you don't know the difference between keywords and built-in functions makes your argument weak. But I will bite, if you're having difficult to make the distinction between a keyword and a variable you probably have a very bad editor. Syntax highlighting helps a lot here (like in almost every other language).

> You also have to pollute your code with self everywhere.

I really like the fact that self is explicit in Python. It makes OO patterns more explicit (there is no magic variable like self or this, just a parameter that is passed as the first argument in any Class method) and it helps making a distinction between attributes and local variables. Really, I would go even further and make super() a method from Object, so instead of calling a magic method super() I would call:

    class Test:
        def __init__(self):
            self.super().__init__(self)
Ugly? Maybe, however it is so much easier to understand what is happening.

> has no where near the number of libraries on github as javascript

Most JavaScript libraries in GitHub are pure toys/garbage, though. Python has a number of useful libraries and if you don't concur with me, please give examples of areas where Python is lacking a good library (I can easily give an example for JavaScript: ML and scientifc computing).

Re: JavaScript is Good, Actually

#208

Earlier quoted context omitted.

No, they are moot. I've built several 100k+ LOC apps with JavaScript. You have no clue what you're talking about.

If you only have hammer everything looks like nail. You will enjoy other languages much more.

And if you live in a glass house, you shouldn't throw stones.

Re: JavaScript is Good, Actually

#209

Earlier quoted context omitted.

I think python is a terrible language. It has so little syntax you can't tell the difference between various things. A variable declaration, a reassignment, a keyword, a whatever else, they don't have any visual distinction from each other. I also find that python has reserved a whole bunch of keywords that I can't use as function names, making APIs hard to create with appropriate names. You also have to pollute your…

Python environments and versioning are a PITA too. That's my main beef with it. Getting anyone else's Python code to run is a nightmare if they haven't documented everything; most other languages I use feel like they have some sort of default versioning built in when you start including other packages. The difference between 'npm install' (and even an added 'gulp') and the chickens I've had to sacrifice at crossroads…

I don't know, getting people to run my Python code currently consists of "make sure you have Python 3, run `pipenv install`, run the code".

Re: JavaScript is Good, Actually

#210

Oh man, I hate these articles as they bring out the trolls. Javascript is a great language because it allows you to develop incredibly fast (scripting language) for a platform that runs everywhere (the web). It used to be far simpler, but IMHO, insecurity because of all of the FUD that this sort of article prescribes, has meant that the language has bloated to incorporate all sorts of syntax improvements and new patt…

I think you touched on a key point. Javascript IS a decent scripting language. Treat Javascript as a scripting language and not for general large scale application development and you will probably be pretty happy.
Post reply on HN