Live data from Hacker News

JavaScript is Good, Actually

ashfurrow.com

241–250 of 369 posts

Re: JavaScript is Good, Actually

#241

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…

I'm still bitter about JSON not supporting comments.

That's why I use 'ini' format for config files despite not being standardized.

Re: JavaScript is Good, Actually

#242

Earlier quoted context omitted.

The Leica selfie in the header says everything that needs to be said.

I can't be absolutely sure what you mean by this comment, but it feels like a needlessly personal attack. FWIW, I don't really approve of the self-description of "world class software developer", either because (i) I'm not really sure what it means, but (ii) it sounds a bit pretentious. Still, it doesn't really relate to the quality or validity (or otherwise) of the post.

Its no more a personal attack that your comment, "it sounds a bit pretentious" since that's all my comment means.

Leica manufacture cameras made of brass and, like apple, are more "experience-oriented". I can appreciate putting a picture of yourself on your blog, but taking a photograph of yourself holding a camera which obscures everything but a brand name... that's equally suggestive of "a bit pretentious".

Re: JavaScript is Good, Actually

#243

Earlier quoted context omitted.

You should try Kotlin. It solves exactly this pain point - creating classes for data structures is very terse and easy. You can have a one-liner class like class Person(val name: String, val email: String, val yearOfBirth: Int? = null) Or you can make it a `data class` and get automatic `equals` and other things.

Thank you for telling me. I've been hovering around this possibility since I'm using Intellij and am the primary owner of the code. Although I'm also keen on this code being as accessible as possible for the rest of the organisation and few has even heard of Kotlin. When I suggest switching to Kotlin everyone's always smiling dismissively like "ah, you with your crazy ideas again". Might do it though. Maybe.

Don't ask, do it. Asking is a great way to get shot down. Write something smaller in Kotlin, then show people what it looks like. It is heavily interoperable with Java, so you could move some of the boilerplate heavy classes over.

Re: JavaScript is Good, Actually

#244

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…

It's funny you should say the same issues aren't as bad with Node and NPM. Node's versioning is a sliding window. I tried compiling Bootstrap recently and it simply wouldn't compile because there was some dependency error that didn't make sense. Apparently Node breaks things too frequently and you can't `npm install` anything if it's half a year behind the newest version. I've never had that problem with Python.

Re: JavaScript is Good, Actually

#245

Earlier quoted context omitted.

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".

And if every Python developer, researcher using Python, etc, did that, it would be much less of a problem. The reality is, many, many don't.

It's kind of ironic, really. With the Zen of Python stating "There should be one-- and preferably only one --obvious way to do it" why is it that it's so common for people to not do the thing that makes it reasonably portable?

I mean, I currently am working with some code that, as part of its readme, has a pip install of a lib -off of master-, and yes, obviously that caused problems. Is the author not a Python developer? Well, he's a researcher. Why is the obvious thing for someone coming naively to develop in the language not building a portable environment?

Re: JavaScript is Good, Actually

#246
post #223

Code spends most of its time being in production and not in development. During that time in production, developers will leave the team, bugs will show up, major enhancements will be made. So it is important that the codebase is easy to reason about, easy to refactor and easy to debug. If you take a language like Java and an IDE like Eclipse or Intellij IDEA, it is trivial to find from where a particular piece of cod…

Data from Stack Overflow Trends says that javascript, python are becoming more popular than Java, C# https://insights.stackoverflow.com/trends?tags=javascript%2C...

None of the languages are new.

Re: JavaScript is Good, Actually

#247
post #223

Code spends most of its time being in production and not in development. During that time in production, developers will leave the team, bugs will show up, major enhancements will be made. So it is important that the codebase is easy to reason about, easy to refactor and easy to debug. If you take a language like Java and an IDE like Eclipse or Intellij IDEA, it is trivial to find from where a particular piece of cod…

This is a giant overgeneralization. If you are using Redux, for example, you _can_ easily tell most of the time what functions get called and in what context, because data flow is unidirectional and easy to reason about. If you're using an old massive tangle of spaghetti code, it is much more difficult, yes.

Re: JavaScript is Good, Actually

#248
post #223

Code spends most of its time being in production and not in development. During that time in production, developers will leave the team, bugs will show up, major enhancements will be made. So it is important that the codebase is easy to reason about, easy to refactor and easy to debug. If you take a language like Java and an IDE like Eclipse or Intellij IDEA, it is trivial to find from where a particular piece of cod…

If the issue is IDEs you can do all that with WebStorm.

As a matter of fact, you can even use IntelliJ for checking function usages and refactoring in JavaScript.

Re: JavaScript is Good, Actually

#249

Earlier quoted context omitted.

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…

It's funny you should say the same issues aren't as bad with Node and NPM. Node's versioning is a sliding window. I tried compiling Bootstrap recently and it simply wouldn't compile because there was some dependency error that didn't make sense. Apparently Node breaks things too frequently and you can't `npm install` anything if it's half a year behind the newest version. I've never had that problem with Python.

'Node breaks things too frequently' - Python 2.7 -> 3.0.

Yes, you need to get the right version of Node, just like you need the right version of Python. I've had both largely just work with directions of "Version Y.X", where Y is defined. I've also had the occasion where it still broke with a specific version where both Y and X were defined.

In general, if I have the right version of Node (and I agree, I'd prefer package.json to also indicate the version of Node that was used to initialize it), things work when installing from package.json. Things also generally just work with Python if I have the right major version of Python, and an environment file. My issue is more that the 'simple' steps a lot of people do when creating Python projects -don't- use an environment. They just use whatever is installed globally on their computer, and they pip install any dependencies, then write a readme to pip install things with, rather than lock it down with a virtual environment.

Re: JavaScript is Good, Actually

#250
post #223

Code spends most of its time being in production and not in development. During that time in production, developers will leave the team, bugs will show up, major enhancements will be made. So it is important that the codebase is easy to reason about, easy to refactor and easy to debug. If you take a language like Java and an IDE like Eclipse or Intellij IDEA, it is trivial to find from where a particular piece of cod…

You can always cherrypick advantages and disadvantages to make a language look "bad", or make another language look "better".

what can you cherry pick from javascript to make it look good?
Post reply on HN