Hacker News new | ask | show | jobs
by matthewmacleod 4233 days ago
I don't understand why someone would want to spend hours trying to optimize languages which weren't designed to run native software on a platform to be as effective as the ones that were when you could just write the software in the native language, to me this just seems like an exercise in futility. Even moreso considering the fact that Javascript and HTML are horribly unproductive languages, though I suppose since so many people know them well they can be more productive in them than in a language they don't know.

I don't understand how you can fail to understand this.

People want to write cross-platform apps for mobile devices. The marketplace is pretty evenly split between iOS and Android devices, and anybody releasing an app probably wants to make it available on both platforms. However, the cost of using two entirely separate tooling stacks to do this could easily be far too high for small apps.

Your dislike of HTML/CSS/Javascript is pretty baseless too. Lots of developers like them, are productive in them, and don't feel that they're all that bad. The fact that compile-to-JS/CSS languages exist is meaningless – it's like complaining that assembly is useless because nobody uses it directly.

And bear in mind that JS now approaches ~0.5x native C code performance with Asm.js – this is better than Dalvik[1]. That opens up a lot of options.

[1] https://blog.mozilla.org/javascript/2013/08/01/staring-at-th...

1 comments

>it's like complaining that assembly is useless because nobody uses it directly

Everybody always tries to make this comparison(WELL IF YOU WANT IT TO RUN SO GOOD JUST WRITE IT IN ASSEMBLY), and it really goes to show how little they know. Programmers don't write things in assembly because today's compilers can write much better assembly than pretty much anyone. No compiler can write C better than even a mediocre programmer, which is why if you want to write something that runs very smoothly or requires high performance stuff, you write it in a C-family or JVM language. That aside, specifically your comparison makes no sense to me. Everything is assembly underneath, so I don't think anyone would say that it is useless unless they had part of their brain stem missing. HTML and JS have no place on mobile(aside from fools trying to shove them on there, hence my rant), they could be completely removed from the equation and nothing would change, and people who actually want to build good products rather than SHIP AS FAST AS POSSIBLE AT THE LOWEST COST POSSIBLE ON EVERY PLATFORM SIMULTANEOUSLY SO WE CAN MAKE THE MOST PROFIT POSSIBLE FUCK IF IT RUNS LIKE SHIT could chug along making great products, with languages designed to make great products on that platform. The developers that feel they "aren't that bad" are probably ones who haven't used anything else and don't even care to try, which is why they are trying to make them work on mobile.

> Programmers don't write things in assembly because today's compilers can write much better assembly than pretty much anyone.

I don't buy that statement. In college we'd write a small program in assembler, then write that same program in C and compare the generated assembler code. The generated code was always longer than the hand-written code and often times significantly longer.

The main reason we don't write assembler anymore is we don't need to!

it really goes to show how little they know

I don't know – as a developer with many years of experience, from assembly to web technologies, I think I'm pretty qualified to make this comparison :)

No compiler can write C better than even a mediocre programmer

That's not true at all – there are a whole bunch of examples which transpile other languages to C. The point is to work in a system that effectively communicate's ones intentions – that fact that it's C underneath is almost irrelevant.

Everything is assembly underneath, so I don't think anyone would say that it is useless unless they had part of their brain stem missing

I'd argue the same for the combo of Javascript, HTML and CSS, given that it's one of the few cross-platform tool for building user interfaces. Anybody arguing that it's useless is missing the big picture.

HTML and JS have no place on mobile(aside from fools trying to shove them on there, hence my rant), they could be completely removed from the equation and nothing would change

I mean, they clearly do. Otherwise, we wouldn't have a web, and every site that currently exists would be accessed through a native app. That's obviously silly.

and people who actually want to build good products rather than SHIP AS FAST AS POSSIBLE AT THE LOWEST COST POSSIBLE ON EVERY PLATFORM SIMULTANEOUSLY SO WE CAN MAKE THE MOST PROFIT POSSIBLE FUCK IF IT RUNS LIKE SHIT could chug along making great products

No, there's a distinct tradeoff to be made. Let's say you're a service with a small staff trying to publish a mobile app. You obviously need it to work across multiple platforms, given the current state of the market. In many cases, the cost of maintaining two separate codebases, and two separate teams, will simply not be worth the expense. If you are delivering a relatively simple app, then it's something that could quite possibly be built using the web stack – sacrificing some quality of UX in exchange for actually having a shipping product at all.

The UX of a native app will continue to be better for the moment. But the gap has closed significantly in the past couple of years, and I don't see any reason that it won't continue to do so, as platform developers and others work to fix the remaining issues.

The developers that feel they "aren't that bad" are probably ones who haven't used anything else and don't even care to try, which is why they are trying to make them work on mobile.

I've personally developed native applications for Android, iOS and Blackberry, and have also developed a couple of cross-platform apps that ran across all three with Phonegap. The UX wasn't as good as fully-native apps would have been, but building multiple apps would not have been cost-effective in these cases, and the output wasn't all that bad. So I guess that invalidates your point.

Sure there are languages that transpile to C, but they don't run as well as hand written C. I wasn't saying that compilers couldn't write C, I was saying they couldn't do it better than a human.