Live data from Hacker News

Ask HN: Is web programming a series of hacks on hacks?

news.ycombinator.com

681–688 of 688 posts

Re: Ask HN: Is web programming a series of hacks on hacks?

#681

Earlier quoted context omitted.

Very cool! In that example though... where's the array? And don't backticks do string interpolation?

Backticks by themselves will do string interpolation. But backticks with a function name in front will do something a bit different. In this case 'sql.query' is a function and the JS will pass it an array which represents the contents of the backtick string. There the function can do what it likes and return a result. 'sql.query' builds a proper (and safe!) SQL query and executes it. The backtick feature in ES2015 is…

Neat! Thanks for the awesome explanation!

Re: Ask HN: Is web programming a series of hacks on hacks?

#682
post #58

Earlier quoted context omitted.

This post makes me sad. Javascript, CSS and HTML can all be used powerfully, performantly and in a managed way where anyone can come on board and contribute. Facebook, Google and Microsoft all use the web stack to run huge companies. To broadly paint this web stack that so many people poured countless hours into making, as 'impossible' to use is doing it a great disservice. But hey man, that's just like your opinion.

What's sad is the zillions of hours wasted by engineers on an inherently flawed stack. What's sad is how ridiculously complicated it is to create and manage relatively simple UIs. What's sad is an entire generations of programmers growing up and thinking this is normal. Programming is supposed to be about creating platforms for each other so we can continue solving higher (and higher) level problems. This web crap ha…

What's the alternative? The division of platforms is a fact and how can you deal with it by only programming native apps? This is the best solution people have come up with. You talk as if it's all a hugr waste of time. I don't think so.

Re: Ask HN: Is web programming a series of hacks on hacks?

#683
Reading through all these comments, I feel there's one salient question left unanswered: What's the alternative, then, under such a divisive landscape of various OS and standards? Surely it's infeasible for the vast majority to develop native applications for each and every platform out there, for everything we want to do? The current web application solutions are the best people have come up with. If they're indeed so rubbish and we're in a "dark age", then why hasn't an alternative triumphed? It's not like companies with money and might haven't tried over all these decades, they just simply didn't succeed. There is a reason why web application is being so widely adopted, and attributing all to "errors and flukes" makes no sense.

Either you unite all the platforms to make them one, which I'd rather not for diversity's sake, or you accept the fact that there has to be something out there that supports all of them, which isn't going to be an easy feat no matter what.

By the way, I surely also hate CSS, and JS to an extent, but my experience programming UI in other platforms haven't been exactly pain-free either. The hate might have been a bit overblown. The nature of computer programming in its current form just simply fits badly with UI design. That's the fact.

Re: Ask HN: Is web programming a series of hacks on hacks?

#684

Earlier quoted context omitted.

I think it's when you get beyond the niceties of the delivery system that is the web to making complex apps compared to other environments is where the complaints stem from. Also, the JVM, Flash and Silverlight would have have all been able to provide a similarly nice delivery system across all platforms if they had been the equivalent of the web. But instead, they were used as plugins.

But i'm talking about complex applications. I'm not talking about your average website, but full blown 100k+ loc applications. It's so much nicer than the alternatives that many developers are making desktop-only applications using those technologies. I don't know if that is because of familiarity, or if it's actually a better platform, but I know that when I did the "move" from GTK and swing applications to HTML/CSS…

This guy gets it. Spot on. I just simply don't understand all those people claiming web is a terrible mistake/fluke or whatsoever. It's nonsense. Big companies with money and might tried all over the decades, and failed. Web is there for a very good reason. It's certainly not perfect but it's not that evil as people make it out to be.

Either you unite all the platforms to make them one, which I'd rather not for diversity's sake, or you accept the fact that there has to be something out there that supports all of them, which isn't going to be an easy feat no matter what, and web is already doing quite fine.

By the way, I surely also hate CSS, and JS to an extent, but my experience programming UI in other platforms haven't been exactly pain-free either. The hate might have been a bit overblown. The nature of computer programming in its current form just simply fits badly with UI design. That's the fact.

Re: Ask HN: Is web programming a series of hacks on hacks?

#685
post #141

There are billions of dollars made annually that depend on the web being a complicated clusterfuck of spaghetti. It's all about tracking and targeted advertising that wouldn't be possible if a random website couldn't indirectly load a script that indirectly loads a script that loads an image that indirectly drops cookies from a thousand different domains based on a hundred things just sniffed from your browser and th…

Huzzah. Puppet would be recognized for the degenerate mess it is if it wasn't marketed so well. I know everyone has the best intentions, but brogrammers, tech savvy sales and marketing rejects, were the death-knell of quality at all costs. It was hard enough before, but money has ripped the guts out of a fine institution.

Re: Ask HN: Is web programming a series of hacks on hacks?

#686

Earlier quoted context omitted.

JavaScript is a fantastic language. I don't get this animosity towards it. A decade ago it was made fun of by people who "use real programming languages" but JavaScript has grown up. It's actually very good and very fast. ES6 brought improvements but honestly ES5 is still a great language.

JavaScript is not a fantastic language. It does a lot of things that make no sense. It converts between types in nonsensical ways. Eg in Ruby, you can't accidentally do `5 + "hi"` and get "5hi". If you really want to treat the number as a string, you can do `5.to_s + "hi"` and it works, but you don't do such crap accidentally. In JavaScript, `4 / "cake"` returns `NaN`, which is sensible, but if I wanted to check whet…

NaN is not equal to NaN by the IEEE 754 standard. JavaScript, and many other modern languages, implement floating point numbers by this standard. E.g. in C#:

> 0.0/0.0 == Double.NaN

false

Re: Ask HN: Is web programming a series of hacks on hacks?

#687

Earlier quoted context omitted.

Totally agree. The lack of understanding of JavaScript's paradigm from some people make them blind about the language power, it has the enough amount of every needed paradigm there, including OOP, functional and evented. I see in the comments here people complaining about things like dynamic `this` when they just don't understand it's one of the biggest powers of JS.

JS is not object oriented. A prototype is not the same thing as an object. There are no classes in JS.

Ok, tell me where on "object-oriented programming" is the word "class". Objects are not necessarily related to classes. And yes, a prorotype is a object that you can extend from, as well as from any other object, like prototype-based OOP works.

Re: Ask HN: Is web programming a series of hacks on hacks?

#688

Earlier quoted context omitted.

So using the right tool for the job is a poor metaphor in programming? Or is it advice that gets continually ignored?

Well, when HTML/CSS/JS are the only tool for the job, they're the right tool for the job, that's for sure. Maybe HTML5 isn't the best option for mobile apps, but they can be used, and it even has advantages in some areas (ease of cross-platform development, for instance)

but it could be a lot better, and thats the whole point of the thread.
Post reply on HN