News for hackers. Stuff that matters.
Re:James Webb Telescope will run a proprietary JS interprete... by redleggedfrog on Wednesday April 24, 2019 @09:39AM (#19738183)
I think you have to look at the reality of the situation. The last 10 years have created a legion of developers who are really only familiar with JavaScript. They have never used a proper programming language and have either never learned or have forgotten what it takes to make solid software.

But in reality, that's fine. They'll muddle through on something like this, finally getting it to work through endless tinkering, and it'll be fine.

Remember, the entire internet now pretty much runs on this premise. And it's fine, right?

Re:James Webb Telescope will run a proprietary JS interprete... by ergothus on Wednesday April 24, 2019 @11:06AM (#19739087)
> They have never used a proper programming language and have either never learned or have forgotten what it takes to make solid software.

I've been coding since I was kid, and professionally for over 20 years. I've used a few different languages, in a few different contexts, but Iv'e done JS in front/backend for the last 7 years or so and I find statements like these utterly tiresome. Sure, there are lots of naive JS devs...but I can say the same for Java, or any other language that is "a proper programming language". A lot of JS code is written to optimize for things that may it not seem like "solid software" - but I've seen a lot of terrible "solid software".

When we collectively realize that our industry is so young, that the best practices of yesteryear are often now viewed as mistakes (and that the practices from before that were maybe the right idea...), and that we really DON'T KNOW the correct answer, maybe then we'll stop loving to hate on people who are doing work that we might not do so well at if we tried it.

I don't know your intentions in saying what you said, but in general there is a LOT of smug looking-down on web development in general and JS development in particular. Arrogance is not a good look, and derision is worse. The industry has improvements it can make, certainly, but this is something true of us all, not something restricted to one sub-group while everyone else is doing thing The Right Way.

Re:James Webb Telescope will run a proprietary JS interprete... by redleggedfrog on Wednesday April 24, 2019 @12:24PM (#19739986)
Sorry, no, there was no smugness. I agree with your points here quite firmly. I guess my tone didn't carry.
Re:James Webb Telescope will run a proprietary JS interprete... by ergothus on Wednesday April 24, 2019 @12:36PM (#19740121)
Thanks for saying as much!
Re:James Webb Telescope will run a proprietary JS interprete... by eitland on Wednesday April 24, 2019 @11:26AM (#19739321)
Good coders can be productive and write good code in any mainstream language, contrary to what is said in the famous "PHP: a fractal of bad design"[0].

That said JavaScript has a number of the same problems as PHP and pointing this out should be equally acceptable as pointing out issues with PHP[1], and while I'm impressed that it was created in three weeks and impressed with the JS community we shouldn't pretend it is a very well designed language. People being productive in JS is pretty much a result of an amazing ecosystem, not because of the language.

For a very simple example of what JavaScript could have been, look at Typescript: anything you can do in JS you can also do in TS. In fact, "porting" from JS to TS is as simple as changing the file extension.

Yet except for the need for transpiling TS is massively easier to work with and can eliminate whole classes of problems when used correctly.

Source: Have programmed and maintained others creations in JS and later TS.

[0]: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

[1]: I also have programmed my fair share of PHP code. It doesn't have to be bad. But I'll happily admit that it isn't the prettiest or most well designed language I know.

Re:James Webb Telescope will run a proprietary JS interprete... by ergothus on Wednesday April 24, 2019 @12:33PM (#19740103)
> pointing this out should be equally acceptable as pointing out issues with PHP

Not the best example, considering that PHP has done its time as whipping boy. I've never been a PHP dev and I did my share of trash-talk against PHP instead of learning about the aspects that I could learn from.

My problem isn't that it's "unacceptable" to point out issues - it's that people aren't doing so CONSTRUCTIVELY. Instead, it's about finding the lesser social class to dump on freely.

For example - I have serious concerns/doubts about typescript and how it props up a tool-enhanced crutch for programming-as-communication that ultimately leads to lower-quality code. You would likely disagree and would raise your concerns about JS without TS. We can have a lovely conversation comparing points and, while it's probable neither of us is convinced by the other, we both walk away with a better understanding of the perspectives of others and impacts of code choices.

OR we could imply that JS isn't a "proper" programming language, and thereby JS devs aren't "proper" programmers and we can pat them on the head and tell them to run along and play.

Back when I was doing a lot of Perl dev (before my Java days) I noticed that the weaker Perl devs would hate-on Python (and the reverse), while the stronger Perl/Python devs would hang out with the stronger Python/Perl and compare notes. It took me a while to figure out why that made sense. The two communities had a lot of explicitly different philosophies, yet were really able to learn from one another and occasionally both languages improved as a result.

If JS isn't someone's preferred approach, that's fine...but that doesn't mean they are "lesser". They're _different_, just like different problem domains are _different_. That doesn't make them immune from criticism either, but I'm far more interested in those looking to broaden their views rather than broaden the reach of their current viewpoint.

Re:James Webb Telescope will run a proprietary JS interprete... by eitland on Wednesday April 24, 2019 @01:29PM (#19740760)
Thanks for being so calm. In hindsight I regret my comment.

Reading your comment now and rereading your comment I realize you were defending Javascript programmers, not the language. (I guess we'll have to disagree about JavaScript the language :-)

I agree we shouldn't attack programmers because of language choice. And I am happy that I pointed out that I am amazed by the JS community as it hopefully shows that I wasn't trying to attack anyone.

Re:James Webb Telescope will run a proprietary JS interprete... by ergothus on Wednesday April 24, 2019 @01:50PM (#19740996)
Thanks for clarifying - I hope I didn't come across too defensive. It's definitely become a sensitive spot when so many are dismissive, so I might lash out at those undeserving of it.

As for the language - JS definitely has its warts and its holes. It's not a language I love, but it IS a language I greatly enjoy developing for. Then again, I thought Perl was a great language (albeit with its own warts) so my views are fairly unconventional. Definitely though, I tend to think that languages fall into a more complex graph than just "better" and "worse", or even "better at X" and "worse at X".

Re:James Webb Telescope will run a proprietary JS interprete... by imtringued on Wednesday April 24, 2019 @11:45AM (#19739552)
I completely disagree. It is physically impossible to be more productive in a C++ project that takes 5 minutes to compile compared to almost any interpreted language with a debug cycle spanning seconds. It's that simple. The next issue is the ecosystem. Often the language itself is completely irrelevant if the ecosystem is good enough but here is the thing: ecosystems are tied to languages. Yes I can be productive in "crappy language X" if I recreate the superior ecosystem of "super language S". I am not a superhuman lifeform that has the power of hundreds of bright human brains (millions of bad ones aren't enough) and the corresponding two hundred hands required to interface with the computer.

No. I will just pick a good ecosystem and the language it was built around and be happy instead of proving that you can build a skyscraper out of feces by producing steel via nuclear fusion.

Re:James Webb Telescope will run a proprietary JS interprete... by Jtsummers on Wednesday April 24, 2019 @12:04PM (#19739782)
It's very possible, but instead of debugging you spend more time thinking so you're making fewer iterations.

That said, I really enjoy Common Lisp for being compiled (good performance versus interpreted) and the speed of compiling (compiling single functions at a time) so you get the same time-to-execution as your interpreted languages. Better, actually, if you change the function definition in place when you hit a condition.

EDIT: I hit submit before finishing my thoughts.

C++ isn't that bad. 5+ minute compile times can be tightened down if you have a good structure for your codebase. And if it remains at 5+ minutes, that's what unit testing is for (shouldn't need the whole build to execute) along with a build pipeline. Submit the change and get results after a few minutes. Distcc and other systems can also aid for the really large projects. Another factor to consider, to test that interpreted (presumably dynamically typed) program you have to have more tests than the C++ program needs. Static typing (even though I have issues with C++'s type system, it's still ok) covers a lot of the areas that you have to manually create tests for in dynamically typed languages

Re:James Webb Telescope will run a proprietary JS interprete... by MagicPropmaker on Wednesday April 24, 2019 @11:47AM (#19739579)
We do Erlang and C++ for CUDA programming where I am. It would be nearly impossible for us to write good code for what we do in, say PHP, or even Java.
Re:James Webb Telescope will run a proprietary JS interprete... by zaarn on Wednesday April 24, 2019 @09:47AM (#19738255)
> The last 10 years have created a legion of developers who are really only familiar with JavaScript

That probably played 0 role into this. When the project was created, about 20 to 15 years ago, people put in the design specs. The language selection was JS, Python 1.5 (1.5, not 2, not 3, 1.5, released in 1999) and a custom script language.

NASA decided for JS because Python used more memory.

The JS that is being run is essentially IE6 or IE5-level, so none of the modern features introduced in IE8 and forwards that make it all so easy.

I'd expect more modern variants of JS (TypeScript) or even something like Rust to make an appearence in 15 years or so. Atleast for these kinds of missions.

Re:James Webb Telescope will run a proprietary JS interprete... by plopz on Wednesday April 24, 2019 @09:54AM (#19738315)
Yeah, in 2003 this version of js worked with vxworks and didn't leak memory like python. I'm sort of surprised they didn't go with tcl though.
Re:James Webb Telescope will run a proprietary JS interprete... by harshreality on Wednesday April 24, 2019 @10:09AM (#19738473)
The reason they didn't choose tcl had nothing to do with the language.

> 2. An attempt was made to port each scripting engine to the VxWorks real-time operating system on a flight-like Power PC by embedding it into a payload flight software application. TCL was dropped from the study when it could not be successfully ported to VxWorks. JavaScript, Python and G-script were successfully ported and a series of tests with prototype flight software applications were run in order to rank them against the success criteria.

https://www.scribd.com/document/407354589/Event-driven-James...

Re:James Webb Telescope will run a proprietary JS interprete... by cartoonfoxes on Wednesday April 24, 2019 @10:50AM (#19738886)
I would have assumed porting TCL would have been the most straightforward of the bunch. What features made it so difficult to work with?
Re:James Webb Telescope will run a proprietary JS interprete... by plopz on Wednesday April 24, 2019 @10:12AM (#19738495)
Ahh, that makes sense then.
Re:James Webb Telescope will run a proprietary JS interprete... by theandrewbailey on Wednesday April 24, 2019 @10:12AM (#19738487)
Was the Python 1 to 2 migration anywhere near as bad as the bloodbath that 2 to 3 has been?

(My guess: no, but that happened well before my Python initialization.)

Re:James Webb Telescope will run a proprietary JS interprete... by simonh on Wednesday April 24, 2019 @10:39AM (#19738771)
The Python community was growing so fast, within a couple of years most Python developers had never used 1.x. Also 2.0 introduced an awful lot of very valuable improvements. In any case, 1.6 had some source incompatibilities with 1.5.2 anyway, so eh.
Re:James Webb Telescope will run a proprietary JS interprete... by michelpp on Wednesday April 24, 2019 @12:13PM (#19739880)
1->2 was not backwards incompatible like 2->3 was.
Re:James Webb Telescope will run a proprietary JS interprete... by nepeckman on Wednesday April 24, 2019 @09:55AM (#19738330)
This language choice was made 10 years ago by developers working for NASA. While I think it was a questionable choice, I don't think it was a hype driven choice and I don't think its accurate to say these developers only know JavaScript.
Re:James Webb Telescope will run a proprietary JS interprete... by mturmon on Wednesday April 24, 2019 @11:10AM (#19739149)
Come to think of it, STScI, which is where those developers worked (and maybe still do), was always a favorable environment for Python.

Back in the early 2000s, before Numpy was a thing, STScI developed an image-file-reader for Python called PyFITS, and an underlying array extension to Python that allowed multiple base types, slicing, etc., called numarray (e.g., see https://scipy.github.io/old-wiki/pages/History_of_SciPy.html). In some sense, STScI might have been expected to prefer Python to JS.

Re:James Webb Telescope will run a proprietary JS interprete... by joekrill on Wednesday April 24, 2019 @09:43AM (#19738205)
So what exactly makes a "proper programming language"?
Re:James Webb Telescope will run a proprietary JS interprete... by redleggedfrog on Wednesday April 24, 2019 @10:08AM (#19738462)
I could see how that would be considered inflammatory, but it was not intended that way.

I have a somewhat fuzzy definition. "A programming language that has more 'intent' to it."

For example, Rust. The designers had definite ideas about what they were creating, noted the trade-offs, and implemented features based on those decisions.

You can say that about lots of languages - Java, C#, Swift, or if you need to go back 10 years, Java <g />, C, or maybe even Python.

JavaScript on the other hand was cobbled together in a few weeks by some poor fellow who was under impossible deadlines. And it shows. We've all seen the "Wat" video. Programming in JavaScript is a minefield of bizarre phenomena. Function scopes as namespaces. Nutty math. It succeeds in spite of itself because, a. It's rarely used for anything truly important, and b. It runs on the most popular run-time environment on the planet.

Not that you can't do great things with JavaScript. But just about any other language would have been preferable.

Re:James Webb Telescope will run a proprietary JS interprete... by kowdermeister on Wednesday April 24, 2019 @11:48AM (#19739593)
The wat talk is really funny, but it proves only that if you do moronic things, you will get nonsense results. Truly shocking.

> cobbled together in a few weeks by some poor fellow

It was. And then all work has stopped on it, right?

Re:James Webb Telescope will run a proprietary JS interprete... by redleggedfrog on Wednesday April 24, 2019 @12:26PM (#19740022)
No, but that's it's Achilles heel. You can't really just the fundamental part of the language because a gajillion websites are already in existence using it. We're stuck with the janky.
Re:James Webb Telescope will run a proprietary JS interprete... by kowdermeister on Wednesday April 24, 2019 @12:43PM (#19740198)
Are the fundamentals really janky?

Prototypical inheritance is actually not a bad choice.

The event loop also stood the stand the test of time, it's a great choice for IO heavy environments like the web is.

The weak type system made it possible to bang out code really quickly without much thought thus making it very beginner friendly. Most of its issues can be traced back to this.

Re:James Webb Telescope will run a proprietary JS interprete... by blueline on Wednesday April 24, 2019 @11:51AM (#19739614)
>For example, Rust

every time like clockwork

Re:James Webb Telescope will run a proprietary JS interprete... by moron4hire on Wednesday April 24, 2019 @10:24AM (#19738604)
Most of the "wat" video's complaints also apply to Python. And JavaScript has had many more years of considered design and development than when JQuery or Node made it popular.
Re:James Webb Telescope will run a proprietary JS interprete... by deathanatos on Wednesday April 24, 2019 @11:09AM (#19739132)
> Most of the "wat" video's complaints also apply to Python.

No, they don't. All of Wat's complaints against JS, in order of presentation:

> [] + [] ; JS: '', Python: []

Python uses + between arrays for concatenation, just like strings, which I think is reasonable. JavaScript does random crap.

> [] + {} ; JS: '[object Object]' (that's a string, not an object), Python: TypeError.

Again, Python's output here is reasonable, JS's is off the deep-end.

> {} + [] ; JS: 0 (the integer) Python: TypeError

Again, Python's output here is reasonable. JS appears to demonstrate that + isn't commutative, but that's too rosy a picture: in this case, + actually is commutative, as ({} + []) and ([] + {}) are the same string, but without the parentheses we get 0. Yes, the lack of parentheses changes the value JS emits.¹

> {} + {} ; in Wat: NaN, in Chrome/Node: '[object Object][object Object]', in Python: TypeError

Similar to before, Python errors out on the garbage, JS just keep computing ever more insane values.

> [longer example, but boils down to "wat"+1 doing something and "wat"-1 doing something else for comedic effect.

Python TypeErrors on both of these.

Python certainly has its own warts, but they are not as ridiculous as the warts that JS carries around.

¹AIUI, {} + [] is parsed as empty code block, implicit semicolon, unary plus, empty array. The parentheses force the grammar to evaluate the entire thing as an expression, so ({} + []) parses instead as a parenthesized empty object, binary plus, empty array.

Re:James Webb Telescope will run a proprietary JS interprete... by technion on Wednesday April 24, 2019 @08:32PM (#19743877)
Purely for reference (since typescript didn't exist when this project started) all four of those terrible JS examples are Typescript errors: " error TS2365: Operator '+' cannot be applied to types x and y"
Re:James Webb Telescope will run a proprietary JS interprete... by londt8 on Wednesday April 24, 2019 @11:02AM (#19739024)
You are thinking of something else than python? Python has strong, dynamic type system with little implicit type conversions.
Re:James Webb Telescope will run a proprietary JS interprete... by orf on Wednesday April 24, 2019 @10:50AM (#19738883)
They really don't.
Re:James Webb Telescope will run a proprietary JS interprete... by bobcostas55 on Wednesday April 24, 2019 @10:50AM (#19738880)
It's one where empty array plus empty array does _not_ equal an empty string.
Re:James Webb Telescope will run a proprietary JS interprete... by apta on Wednesday April 24, 2019 @09:46AM (#19738234)
Not JavaScript
Re:James Webb Telescope will run a proprietary JS interprete... by Avshalom on Wednesday April 24, 2019 @11:07AM (#19739105)
integers.
Re:James Webb Telescope will run a proprietary JS interprete... by maxerickson on Wednesday April 24, 2019 @11:26AM (#19739316)
Cashew nuts!
Re:James Webb Telescope will run a proprietary JS interprete... by NotAnEconomist on Wednesday April 24, 2019 @09:47AM (#19738253)
Having written in it for a while, JavaScript just kind of is "meh".

TypeScript, for instance, is a much better development experience in terms of language constructs, but that only makes the package management situation stand out more.

Re:James Webb Telescope will run a proprietary JS interprete... by amluto on Wednesday April 24, 2019 @09:46AM (#19738239)
In the context of a critical, long-running, resource-constrained system, a language + runtime that can have deterministic memory usage. So: not JavaScript and probably not J2SE either.
Re:James Webb Telescope will run a proprietary JS interprete... by wayneftw on Wednesday April 24, 2019 @09:58AM (#19738372)
> They have never used a proper programming language and have either never learned or have forgotten what it takes to make solid software.

I've done C, C++, C#, Java, Basic and Python for a living in the past and I always make rock solid software. JavaScript is by far the most productive programming language that I've used to do this.

People who think there's such a thing as an objectively "proper" programming language that they haven't even named are actually the problem with this industry, not JavaScript developers.

Re:James Webb Telescope will run a proprietary JS interprete... by lallysingh on Wednesday April 24, 2019 @10:00AM (#19738399)
> I always make rock solid software

Everything else you claim is suspect because you said this.

Re:James Webb Telescope will run a proprietary JS interprete... by saiya-jin on Wednesday April 24, 2019 @10:31AM (#19738689)
Indeed, it takes a quite bit of experience to realize how fragile our products are, especially given enough time. If some dev claim they never deliver bugs, have 100% coverage with tests etc. thats a huge warning sign.

I've seen great cathedrals of frameworks and patterns being built by smart experienced guys over few years, which ended up in quite a bit of mess at the end. Add a junior or two and see what added value they bring

Re:James Webb Telescope will run a proprietary JS interprete... by wayneftw on Wednesday April 24, 2019 @10:26AM (#19738639)
There's really nothing but an opinion in my response (and in the item I'm responding to) and a bit of bragging certainly doesn't invalidate that in the slightest.

Besides that, if you think that there are no people out there who can consistently write solid software, well...you're just flat out wrong. (And if you think you can't find them on HN, well wrong again...)

Re:James Webb Telescope will run a proprietary JS interprete... by citrablue on Wednesday April 24, 2019 @11:45AM (#19739540)
I think the apparent hubris is what they're referring to, and that it is a negative indicator of developer self-awareness, while humility and willingness to acknowledge past mistakes are positive signs.

Honestly, if you've always delivered rock solid software, you're some sort of mythical creature.

Re:James Webb Telescope will run a proprietary JS interprete... by wayneftw on Sunday April 28, 2019 @08:19AM (#19770727)
> I think the apparent hubris is what they're referring to, and that it is a negative indicator of developer self-awareness, while humility and willingness to acknowledge past mistakes are positive signs.

Yes, anyone who's ever done a slight bit of bragging, even if it's actually true, is automatically and forever, completely lacking developer self-awareness.

> Honestly, if you've always delivered rock solid software, you're some sort of mythical creature.

There are whole agencies full of people that do it. But I get it, the thought that it's somehow impossible probably makes most software devs feel better about accepting their own mediocrity.

I love how everything is so black and white to HNers. "If you've ever bragged, you can't be telling the truth." or "If you use JavaScript, you're not a real programmer."

It's very comical.

Re:James Webb Telescope will run a proprietary JS interprete... by ben_w on Wednesday April 24, 2019 @12:09PM (#19739837)
There’s a comic, I forget where, that says the difference between good and bad developers is that while both cause the code reviewer to exclaim “WTF?”, the bad developers causes far more of them. :)
Re:James Webb Telescope will run a proprietary JS interprete... by jxcl on Wednesday April 24, 2019 @02:29PM (#19741392)
Re:James Webb Telescope will run a proprietary JS interprete... by ben_w on Wednesday April 24, 2019 @06:12PM (#19743083)
That’s the badger :)
Re:James Webb Telescope will run a proprietary JS interprete... by benj111 on Wednesday April 24, 2019 @11:43AM (#19739519)
"They'll muddle through on something like this, finally getting it to work through endless tinkering, and it'll be fine"

This is NASA we're talking about. For a satellite. There will be no muddling, or tinkering.

Nasa isn't in the market to hire any old web dev you know. This is rocket science.

Edit: On second reading you may not be a serious as I first thought :)

Re:James Webb Telescope will run a proprietary JS interprete... by jvanderbot on Wednesday April 24, 2019 @09:45AM (#19738227)
It's classic s/w. Over budget, under spec'd, and arbitrarily the language of the internet.
Re:James Webb Telescope will run a proprietary JS interprete... by mtberatwork on Wednesday April 24, 2019 @10:59AM (#19738991)
> and arbitrarily the language of the internet.

I think you mean the Web.

Re:James Webb Telescope will run a proprietary JS interprete... by bregma on Wednesday April 24, 2019 @10:34AM (#19738734)
> Remember, the entire internet now pretty much runs on this premise. And it's fine, right?

Oh, great, a space telescope run like the internet. Now every 2-bit remote galaxy out there is going to be making toxic comments about the Earth and human civilization as we know it. Be careful not to mention things like white dwarfs, or you'll be in for it from all sides.

Thanks JavaScript. Way to ruin the night sky for all of us.

Re:James Webb Telescope will run a proprietary JS interprete... by JamesWebb on Wednesday April 24, 2019 @11:07AM (#19739103)
JWST will orbit earth, they won't know about it in remote galaxies.
Re:James Webb Telescope will run a proprietary JS interprete... by seniorsassycat on Wednesday April 24, 2019 @11:19AM (#19739245)
Jwst will orbit the Earth sun l2 Lagrange
Re:James Webb Telescope will run a proprietary JS interprete... by seeker61 on Wednesday April 24, 2019 @11:07AM (#19739104)
Don't worry a little banner will appear in front of it telling the real truth about 9-11
Re:James Webb Telescope will run a proprietary JS interprete... by beamatronic on Wednesday April 24, 2019 @11:28AM (#19739346)
You have viewed 2 of your 5 complimentary images for this month