Live data from Hacker News

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

news.ycombinator.com

241–250 of 688 posts

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

#241

Earlier quoted context omitted.

I was building GUIs in pure Win32, with my own C++ wrapper classes for Win32 and later with OWL and MFC. I'd say building Win32 GUIs in C++ was easier than current Web stack. Same with Java AWT and Swing libraries. Objective C / Cocoa is more complex - never really managed to learn it beyond basic stuff, maybe with Swift it's easier. Elm is close to those desktop GUI frameworks, but functional instead of OO. But Tcl/…

> I'd say building Win32 GUIs in C++ was easier than current Web stack. >Same with Java AWT and Swing libraries. I will have to vehemently disagree. I have no experience with Win32 GUIs, but I still have nightmares about wrangling nested LayoutManagers: comparing that to the current state of the web (especially after Flexbox) is downright absurd. I am very happy with: Typescript + (Sass|LESS) + framework (Angular|Boo…

And I have to disagree with you. Doing UIs in native frameworks like JavaFX or even in a pure C++/WinAPI, is much more saner than doing any kind of UI in HTML/CSS. Ignoring flexbox for a second, which is kind of bleeding edge new thing, remind me - how exactly do you vertically center stuff with CSS? :P.

My two main issues with doing UIs on the web are:

- web stack is terribly unpredicatable; you're trying to force an inherently document-layout-oriented model into a free-form 2D canvas, which leads to layouts exploding whenever user switches browser/OS/device/timezone/whatever.

- the code makes no sense; no matter how crappy the Java APIs were (due to deficiencies of the language mostly), the code you wrote at least did what it said, because it expressed the UI concepts explicitly. HTML/CSS is a huge mess of insanity when it comes to doing UI work. I mean, in what reasonable world should the idea "center this" be expressed as "set the left and right margin to 'auto'"? CSS is full of stuff like that.

(And then there are some silly philosophies like "separation of form and content" which everyone touts, but rarely anyone actually follows; see e.g. grid layouts.)

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

#242

Earlier quoted context omitted.

We put people on the moon without benefit of "scalable" languages, we built entire operating systems in C which is notorious for quickly becoming unreadable, and we've somehow built an entire world of content using HTML and CSS. JavaScript is just a language, and while improvements to it are being made constantly, the biggest obstacle is not the language, nor the way browser makers support it, but the absurdly slow p…

> We put people on the moon without benefit of "scalable" languages The computer for the Apollo missions had approximately 64Kbyte of memory and operated at 0.043MHz. My wrist-watch is many orders of magnitude more powerful than that. But the programming effort that went into it was huge (literally: https://cdn-images-1.medium.com/max/800/1*qJnPOGdtk1q7dq17tx... ). If we were stilling coding things that way, we might…

> If we were stilling coding things that way, we might be able to go to the moon but we wouldn't have self-driving cars.

I think that not only we would have self-driving cars, they'd be working much more reliably than proposed solutions of today, and would utilize some pretty clever analog-driven methods.

The problem isn't with JavaScript, the problem is with the culture which glorifies mindlesss throwing of shit at a wall to see what sticks, instead of actually thinking of what one's doing and checking if a given topic wasn't already explored by smart people a few decades ago.

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

#243

One thing I haven't seen mentioned is that while the developer experience is getting more complex, the user experience is getting better and better. That, in my opinion, makes all the messiness worth it. I'm not saying that there's nothing wrong with the state of web dev now, but it's not without reason that we are here today. Remember the days of table-based layouts in HTML? shudder

I don't think the complexity of the web caused better UX. I think we just happen to care a lot more about UX in 2016 than we used to in this industry.

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

#244
post #24

Yes. I feel like we're in the dark ages right now. JavaScript - Dynamically typed, does not scale what so ever. Code written in it becomes 'read only' very quickly. Impossible to refactor. CSS - Also becomes impossible to manage. Who knows if the class you wrote is or isn't being used in HTML or JavaScript somewhere. Same problem, read-only, it only gets bigger and more unmanageable. HTML - At the heart of it, the fo…

React is, in my opinion, a big step forward in reclaiming the front end as a mature UI environment. I have also found that CSS becomes a lot more tolerable with CSS Modules, in combination with React, which allows you to write CSS that targets one component and only that component. By eschewing cascading, you can finally write modular, reusable CSS that avoids side effects and still allows fine-tuning (overriding) by…

Maybe for web applications.

There should be something in the license of JavaScript frameworks & libraries to prevent them from being used in blogs, newspapers, trade publications etc :-/

For now all innovations in JS just seems to provide us with even heavier web sites for no real benefits. I feel I'm starting to dislike JS the way I disliked Flash which would be quite a feat.

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

#245
I think the "design notes" section of the HTML5 spec puts it best [1]:

It must be admitted that many aspects of HTML appear at first glance to be nonsensical and inconsistent.

HTML, its supporting DOM APIs, as well as many of its supporting technologies, have been developed over a period of several decades by a wide array of people with different priorities who, in many cases, did not know of each other's existence.

Features have thus arisen from many sources, and have not always been designed in especially consistent ways. Furthermore, because of the unique characteristics of the Web, implementation bugs have often become de-facto, and now de-jure, standards, as content is often unintentionally written in ways that rely on them before they can be fixed.

Long story short, HTML and its satellites have quite a long history behind them, involving trade wars, religious battes and one or two revolutions (or coups, depending on your point of view)

I think the unique thing about the web "stack" is that for a long time it was the only platform usable and accessible by everyone and controlled by no single entity. This means there was a tremendous amount of people, companies and other entities that tried to influence it's design. Because background compatibility is an absolute must, this lead to hacks accymulating and the whole language getting incredibly messy.

From what I know, there has been at least one approach to start with a "clean slate" and design a better framework - XHTML 2 - but it failed due to missing backwards compatibility and a lack of political support.

The organisation currently in charge publishes the "HTML living standard" (formerly known as HTML5) and has given up on most notions of cleanliness (short of declaring it an explicit non-goal) in favor of backwards compatibility and the ability to move fast.

[1] https://html.spec.whatwg.org/multipage/introduction.html#des...

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

#246

I think it's worth noting that back-end web development is an usually pleasant place. In most other types of programming, many technical decisions are made by the platform and working with tons of legacy cruft is the norm, not the exception. For example, where else can you so freely choose the programming language? Linux Driver? Use C. Mobile App? Java or Swift/Objective-C for Android or iPhone, respectively. GUI App…

This is exactly why I've always been puzzled by the urge to move more and more logic to the frontend. In backend development you have a choice of many mature languages, tools and frameworks which are fairly sane. I'll take that environment as the foundation of a web application any day and apply the mania of client-side javascript to it selectively in cases where we need to minimize server roundtrips.

> why I've always been puzzled by the urge to move more and more logic to the frontend.

This is usually about a mix of scalability, responsiveness, and partition resilience; with the level of importance of those being dependent on the application.

* Scale: if the client makes fewer request of the server(s) then you have reduced server and network requirements. As server resources get cheaper (and the cheap options more reliable) that side of things is becoming less important, but the network requirements extend far beyond you and almost all the way to the user (see the following two points) who might have a very slow connection at times.

* Responsiveness: the more that you can do client side the quicker your application will feel to the user, even if there is a delay in updates actually hitting the global view you can make it look/feel instantaneous (though you do start to have more problems wrt conflict management when people are collaborating). Have a look at the different methods online games (where real responsiveness and the appearance of instant iteration are vital) manage this.

* Partition resilience: if the client can keep working for a while without needing to talk to other hosts, perhaps queuing updates for reply when communication is restored, your application can keep functioning if there is an issue at your end (glitch at your server provider perhaps) or the user's (on mobile and temporarily in a radio blackspot?) or in between (i.e. a routing issue between ISPs). Even partial resilience is better than none: even if I can't see other people's updates until I'm back in a good signal area, if the app calmly tells me so but allows me to continue to add my work and review already locally cached information I can continue to work (or play!) in a way that wouldn't be possible if more of the logic were server-side.

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

#247
post #159

Earlier quoted context omitted.

IMO react is a big step backwards. Adding an abstraction layer almost never produces a better result, it just makes things more complicated.

Abstractions make things more complicated? I think you're missing the basic definition and purpose of abstractions. So how do you define "almost"?

I think the correct term is complex. Abstractions make things more complex, as there are more moving parts. This normally leads to complications when trying to debug some obscure error that you will get when the project gets bigger. At that point you feel for calling on some ancient deity to spite the developer who decided to use this framework 6 months, until you remember that you proposed it as replacement for the last pile of abstractions to hide the failings of the platform. (Yes there is plenty of sarcasm in here :P )

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

#248

Honestly, pretty much everything is hacks on hacks. As a kernel hacker, hardware is hacks, firmware is hacks, kernel is hacks, it's turtles all the way down. The fact that anything works at all is a miracle. Some systems are better than others, but everything has some duct tape somewhere. Designs and algorithms are abstract, the implementation is never as nice. We as engineers have to make the best of what we have, a…

I loled

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

#249

Earlier quoted context omitted.

You can create controls in WIN32 or MFC that would simply be impossible in HTML for a reasonable level of performance

Performance yes, you can't compete with that one because browsers don't let you control the low-level stuff. But the speed of development and the ease of doing complex layouts with css is hard to match (when you master css enough, of course), specially if you're trying to do UI from the code directly, without IDE helpers and visual builders.

The speed of development is very fast for the first 75%, and comes to a screeching halt for the last 25%. The web stack has no good way to answer basic questions like "does the user have arrow keys" or "what is the current mouse position." That's the point that you start to layer on the "hacks on hacks" that OP references.

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

#250

Earlier quoted context omitted.

IMO the browser's strength is really 'zero-install distribution of applications', I don't think HTML/CSS/JS have anything to do with it. Having said that, I think your argument its a straw-man, back-end web development is just a part (sometimes even unnecessary) of browser programming.

This is why I don't understand the purpose of electron apps. Why not remove the electron part and just install and run a local http server written in any language and access it from your browser? No need to download the same 50MB+ for electron every time. The overhead from running multiple browser engines is gone. Basically everything is as it should be. The Kimchi KMV UI is a pretty good example how to do it. https:…

Marketing. People pay more for an application than a web page. Why did YNAB change from being a spreadsheet to an app?
Post reply on HN