Live data from Hacker News

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

news.ycombinator.com

591–600 of 688 posts

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

#591
post #550

Yes, the web was meant for building pages , not applications , and that shows. HTML and CSS are horrible at laying out apps (even with flexbox). Which is why using front-end libraries is critical. Have a look at https://webix.com - it's amazing how expressive that widgets library is: 10 lines of code for a master-detail tree+grid layout. As for the server side and the client-server communication, nothing really beats…

Also, while JavaScript has been a hacky language, ES2015 and ES2016 have really upped the game:

* Classes

* Modules

* Block-scoped variables

* Multi-line strings

* Default parameters

* Template Literals

* Arrow functions

* Promises

* Async/await

And JavaScript keeps eating the world:

"In three months from today, 98% of all Walmart.com traffic will be serviced via Node APIs and displayed with React.js according to Alex Grigoryan, Director of Software Engineering at WalMart Labs. Three months after that, SamsClub.com, Walmart’s second biggest property, will be 100% javascript based. Even their iOS and Android experiences will eventually be done in React Native, a javascript technology that’s made to replace native Java/Objective C coding." -- https://medium.com/presence-product-group/javascript-and-nod...

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

#592
post #165

Earlier quoted context omitted.

Angular feels clean enough, but how do you implement internationalisation properly? How do you switch to angular 2 now that angular 1 is obsolete? Same thing with bootstrap (v2 is largely incompatible with v3 which is mostly incompatible with v4)... Backend is okay; frontend really is a clusterfuck, because it seems all built for short-lived, one shot applications. I build professional applications that have to live…

I was using node.js for a while and having to deal with the same bugs over and over again. Usually the bug would be passing the wrong type or mistyping a name. I started using Typescript and things got a lot better. Scala.js is great and all, and probably a good choice if you're using Scala on the backend, but Typescript works a bit better because the Javascript it generates is pretty close to the original. If you se…

The difference is that Scala is a vastly better, designed language. It's not something like Typescript which tries to salvage JavaScript without being able to fix the worst parts.

Scala also has much better, more mature tooling and IDE support.

The build system is also amazing, not the mess cobbled together in JavaScript that is changing every second week.

In addition to that you have stable, existing and mature libraries which work on multiple platforms, achieving _real_ cross platform support. (Not this "if you make JavaScript run outside of the browser..." nonsense.)

Plus, the quality of libraries is so much higher because they aren't written by JS kids with a maximum attention span of 5 minutes.

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

#593
post #284

Earlier quoted context omitted.

Why is native/normal feel the end-all-be-all of UI systems? I've never quite understood why this is so desirable. Or why the answer seems to be using a shoddy UI system stuffed in a browser frame.

Because chances are that whatever custom UI/UX design you come up with isn't going to be better (or even as good as) OS UI toolkits that've been designed by experts, battle tested for decades, and used for every type of application known to man. Applications with native UIs also tend to give a a better impression of responsiveness, and they reduce mental load for your users since they're don't have to relearn much (i…

>Applications with native UIs also tend to give a better impression of responsiveness

Not just an impression. They often are actually more responsive. Except when they hang, which does happen sometimes, but then so do web apps.

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

#594
post #546

Earlier quoted context omitted.

Windows has its own legacy baggage and I wonder about the proposition that the mobile OSes' Unix underpinnings aren't relevant. Depends on what you're doing, I'd think.

Windows might have its own baggage, but with Windows 8 they have brought the original design of .NET from the ashes and assuming the current path is to maintain, those of us that like Windows will have a nice OO ABI alongside safe languages compiling to native code. All the mobile OS relevant APIs don't have anything to do with UNIX. All the Objective-C, Swift, Java, JavaScript, C++ APIs available on those OSes don't…

>alongside safe languages compiling to native code.

Which ones do you mean? F#, ..., ???

>All the Objective-C, Swift, Java, JavaScript, C++ APIs available on those OSes don't depend on being implemented on top of an UNIX kernel.

Interesting point.

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

#595

Earlier quoted context omitted.

If anything, this understates the problem. A modal web application today takes an absolute minimum of five programming languages and three frameworks: * HTML * CSS * JS * A server-side language (eg Python) * SQL And then come the (leaky) abstractions on top of them: * A framework to make JS bearable (eg Angular) * A framework to make server-side bearable (eg Django) * A framework to make CSS bearable (eg Bootstrap) .…

What you basically do, is hiding and abstracting facts. That comes at a cost, namely when someone has a special requirement, then that person has to dig very deep into your framework. It's almost the same like Java GWT or Vaddin. If you stick to the recommended way, everything is just fine, but don't ever try to solve some exceptional problem because then you are in a world of pain where it's just smarter to embrace…

I assume you're talking about https://anvil.works here. That tension ("hiding facts") is there in every abstraction, but there are some luxuries to the way we do it. By putting a whole, consistent layer over the top of the web platform (in our case, Python and a traditional UI toolkit with a GUI designer), rather than patching little holes in usability here and there, we can prevent you from stubbing your toe on (eg) Javascript-isms every five minutes.

The tradeoff is that if you want to use an obscure feature of the underlying platform (and boy does the web have those), you need to explicitly abandon our abstraction. There's always an escape hatch for this - you can drop down and write HTML/JS/CSS if you need to. (And something similar on the server side too.)

All abstractions leak. Anvil leaks deliberately and rarely, whereas abstractions built in the classic HTML/JS/CSS world leak constantly and unpredictably. We think that's worth the trade-off.

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

#596
post #591
post #550

Yes, the web was meant for building pages , not applications , and that shows. HTML and CSS are horrible at laying out apps (even with flexbox). Which is why using front-end libraries is critical. Have a look at https://webix.com - it's amazing how expressive that widgets library is: 10 lines of code for a master-detail tree+grid layout. As for the server side and the client-server communication, nothing really beats…

Also, while JavaScript has been a hacky language, ES2015 and ES2016 have really upped the game: * Classes * Modules * Block-scoped variables * Multi-line strings * Default parameters * Template Literals * Arrow functions * Promises * Async/await And JavaScript keeps eating the world: "In three months from today, 98% of all Walmart.com traffic will be serviced via Node APIs and displayed with React.js according to Ale…

You mean eating the visible world. There's all the code which isn't public facing that runs everything else. For that matter, JS is dependent on layers of code not written in JS, some of which is visible.

Also, it's not like other programming languages don't have the features you listed. JS is playing catchup.

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

#597

The web platform is disorganized and has many missing pieces. It has also grown quite a lot in the last couple of years, so it’s virtually impossible to understand all of it. As long as you’re disciplined about learning from the relevant blogs, it will “become better” (but it may take months).

How can you know what constitutes "relevant" though? There are loud voices in the community that seem right at first but the more you learn, the more you realise you may have been led astray. I guess that's a way of learning, but that particular path to enlightenment is covered in litter.

For the record, you inspired me to add an “Ask me anything” section on my Web Platform Daily website. Cheers!

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

#598

Earlier quoted context omitted.

If anything, this understates the problem. A modal web application today takes an absolute minimum of five programming languages and three frameworks: * HTML * CSS * JS * A server-side language (eg Python) * SQL And then come the (leaky) abstractions on top of them: * A framework to make JS bearable (eg Angular) * A framework to make server-side bearable (eg Django) * A framework to make CSS bearable (eg Bootstrap) .…

> If anything, this understates the problem. A modal web application today takes an absolute minimum of five programming languages If you're going to call HTML a programming language than when you talk about server-side work you must include XML as a programming language (I see markup far different, more simplistic than a programming language). CSS is simply properties applied to the same markup but I digress; I coul…

> If you're going to call HTML a programming language [...] CSS is simply properties [...]

Whatever they are, they're complicated. They've each got syntax, enormous sets of tags/keywords to learn, and quirks coming out of their ears. There are even people down-thread pointing out that HTML+CSS is Turing complete.

> God, you don't need any of these [abstractions]

With respect, almost everyone else in this thread seems to disagree with you. I'd challenge you to find a major public-facing web app written with - let's be charitable - fewer than two of the frameworks on that list.

I do tend to agree with you on the merits of SQL, though. We built a very simple database for Anvil, that doesn't do anything except store and retrieve tuples of data, and for anything more complicated, we say "great, SQL is over there" :-P

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

#599

Earlier quoted context omitted.

> You can pick a nice ORM (like sequelize) I'm gonna stop you right there. Node is a helpful tool and I enjoy using it, but Sequelize was nothing but pure pain when I used it. You're much better off running raw SQL, or using a query builder like KnexJS. I would never use Sequelize for more than a 1-table read or update.

honestly, in JS/Node, I find it easiest to use a SQL adapter that can handle template strings as parameterized queries... const results = await sql.query` SELECT ... WHERE foo = ${bar} `; if (!results && results.length) return; await myQueue.add(results); Which works unbelievably well... There's not nearly as much need for boilerplate/translation layers in what is already a dynamic environment. I wrote a wrapper for…

Maybe I'm missing something, but that looks like SQL Injection ready to happen.

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

#600

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.

Javascript, CSS and HTML can all be used powerfully, performantly and in a managed way where anyone can come on board and contribute. I disagree. Compared with other languages and technologies used for similar purposes, none of JS, CSS or HTML is particularly powerful or efficient, nor do any of them provide particularly good tools for helping new developers get up to speed or co-ordinating large teams working on the…

Great summary of many valid issues.
Post reply on HN