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…
Ask HN: Is web programming a series of hacks on hacks?
681–688 of 688 posts
Re: Ask HN: Is web programming a series of hacks on hacks?
#682Earlier 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…
Re: Ask HN: Is web programming a series of hacks on hacks?
#683Either 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?
#684Earlier 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…
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?
#685There 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…
Re: Ask HN: Is web programming a series of hacks on hacks?
#686Earlier 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…
> 0.0/0.0 == Double.NaN
false
Re: Ask HN: Is web programming a series of hacks on hacks?
#687Earlier 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.
Re: Ask HN: Is web programming a series of hacks on hacks?
#688Earlier 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)