Live data from Hacker News

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

news.ycombinator.com

641–650 of 688 posts

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

#641
post #392

Earlier quoted context omitted.

I think you may be misunderstanding my point. If you have to invoke a brand new JS framework with limited uptake and many competitors, and "one of a million" CSS frameworks, in order to declare this problem solved, you are perpetuating the problem . I don't want to knock these tools too hard, because I can readily believe that (eg) Flow, or Typescript, or whatever we'll all be using next week, is much better than usi…

My thinking on this is that everytime someone has tried to unify these tools it hasn't gone well. Think about Google Web Toolkit, or Microsoft's XAML. It's better to have everyone experimenting, blogging and doing their thing, and the best ideas rise to the top. 2015 was probably the worst time to be a web developer on a greenfield project. You had Angular deprecation and the Flux wars, and Babel 5 -> 6 migration. I…

Did GWT or XAML really try to unify things?

Back in 2009, I worked on a complex SPA using GWT. With GWT, you could pretend to know nothing about HTML/CSS by just using the ugly build in components, but none of the GWT users I met did that. Our app used a Model-View-Presenter structure, dependency injection, and event bus for asynchronous communication to let components know when their data had updated, plus UIBinder templates for defining the look of components (which are mostly just HTML and CSS). So although it was nicely structured, it was very much a web app, and the development experience felt pretty comparable to what I experience in React today.

XAML is mostly just a way to declaratively specify the layout and structure of UI components. Actually, I think it's just a declarative syntax for creating a hierarchy of object instances. If I remember correctly, the XAML and its corresponding C# file are both partial implementations of the same class, since .NET allows partial classes.

Now, I'm not saying that I think the current state of JavaScript tooling is the worst thing ever. But I do think that that some of the 2009-2010 era JavaScript frameworks provided a more sane and cohesive development experience. React and Angular are nice, but I also remember that in 2010 it felt pretty neat to create an interface in OSX's Interface Builder, and have it show up in my browser exactly the way I'd drawn it.

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

#642

Earlier quoted context omitted.

You could of course write something that compiles to JavaScript. There's a ton of options, some are even pretty nice (I like ClojureScript; want to try out Elm).

Elm is client side only.

Then use PureScript.

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

#643
post #396

Earlier quoted context omitted.

Exactly. Intuitively, I don't think the problem can be solved with the same "let's glue together a bunch of stuff and call it a stack" approach that got us here.

I'm hoping it is. We have ended up with really good tools compared to what we had before. Think about using commonjs requires, compared to the craziness of the Rails asset pipeline and sprockets, or manually specifying js files. We just need to standardize the glue...

The best part will be when we're all standardized on ES2015 modules instead of commonJS modules. I agree with you that CommonJS requires are nice to use, but since they're not statically analyzable the way ES2015 imports are, optimizing compilers like the Closure Compiler can't really analyze your entire application, including its dependencies.

Once we've completely made the ES2015 transition (at least for front end modules), we might be in a position to see some really great front end tooling.

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

#644
post #412

Earlier quoted context omitted.

> Node allows you to run isomorphic JavaScript that runs on both your server side and client side But then you're writing JavaScript on the server side, and I think I'd rather shove live weasels down my trousers than write one line more of JavaScript than I absolutely must.

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 whether I just accidentally did a bad division, `(4 / "cake") === NaN` will lie to me.

There are LOTS of quirks like this. JS is like a floor with boards missing all over the place. Yes, if you've walked on it every day for years, you've already stepped in every hole and know where they are. But that doesn't make it a good floor.

A good language is consistent. JS is not.

The fact that it now has fast implementations has nothing to do with it. This car goes 300mph, but don't use the left turn signal on Tuesdays because that sucker will blow you up.

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

#645
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…

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) .…

>> A modal web application today takes an absolute minimum of five programming languages and three frameworks:

I haven't done it myself, but you could try to replace most of your stack from the database up, with a single language:

http://www.swi-prolog.org/FAQ/PrologLAMP.txt

You'll still need the three stooges but at least you'll have a single language behind them.

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

#646

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…

This feature is apparently called "tagged template strings"; more on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

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

#647

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.

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?

#648

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) .…

this is a bit disingenuous. the back-end technologies are quite stable and based on not-perfect-but-reasonable semantics. Django/SQLALchemy don't change that much. Front-end on the other end is a mess. JS/HTML/CSS as tools are clearly unfit for the current needs.

I think backend frameworks do change. I think the difference lies in the velocity of change.

Front-end frameworks tend to move laterally; e.g. implementing a new design pattern or changing the workflow with an existing API.

Back-End frameworks tend to move vertically; e.g. adding new features or abstractions and developing generic bootstrapping procedures.

I'm glad you brought up Django here. I work with Django as my primary back-end. I think it does a great job abstracting the stuff you don't normally need to worry about while persisting the ability to modify it if need be. It seems like every update to Django is designed to make the developer's life easier. It doesn't require complicated build tools. It has a built in dev server. It includes a fantastic and secure ORM. It has it's own easy to use templating language. You can build an entire web application with Django and no 3rd-party packages if you wanted to. Contrast that with something like Node/Express/whatever and you can see the two different camps of developers a bit more clearly.

Sure, maybe my Python runtime is slightly slower than a Node runtime. Maybe the lack of async request handling(not really a problem with channels or celery) means I can't handle as many concurrent requests. Here's the thing. Hardware is cheaper than developer time. If I have an overloaded server, I can just spin up another with the push of a button and pay 10 bucks to run it for a whole month. 10 bucks is like 20 minutes of developer pay.

That's not to knock on Node, it has it's use cases, but the ecosystem it exists in is one of infinite dependencies and breaking changes.

In conclusion, I think back-end frameworks do change. I believe that changes to back-end frameworks have a different velocity to those on the front-end. I also believe that the changes made are a direct result of a framework's ecosystem. I hope that made sense.

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

#649

Earlier quoted context omitted.

Honestly from the programmer's perspective, it's really just one framework: .NET. I know that .NET abstracts away other frameworks such as the Win32 API, but generally you don't need to know any Win32 API etc. to make a Winforms / WPF / etc. application. With modern "web application" style development, it seems these days you need to know multiple frameworks by default, for better or for worse. More to the point, .NE…

I'm not sure what sre you talking about, if you program with c# and wpf, you need to know xaml and their weird syntax, you need to know prism which is a framework to properly organize your UI, you need to know a server language like asp. Net if you want to deal with backend code. Prefer winform? That's much like react without using jsx, and if yoy want fancy graphics is much more complicated than html. Now sure you c…

I would have to disagree on the last sentence -- there is nothing in any definition of a software framework I know about that suggests that a software framework cannot encompass more than one function. .NET indeed does have a much larger solution stack then most web frameworks, for better or worse (there are advantages and disadvantages to this approach). But that does not disqualify it from being a framework in my opinion.

Web programming is more fragmented in nature, for better or worse. I think that was more my point with the first paragraph (and also a response that most .NET programmers don't need to care too much about any backbone frameworks .NET was built on). .NET provides you with a full front-to-back ecosystem. With web applications, you usually chose, at minimum, some form of Javascript framework, some back end framework, and some form of style framework. (Full stack frameworks for some reason have not taken off in the web ecosystem.) Even that description simplifies some of the fragmentation, due to the bewildering amount of choice. If you want to implement a Flux pattern in React for instance, there are over a dozen versions out there to chose from.

I don't think this necessarily says anything about app complexity or speed of development at all, agreed. Complex apps are going to be the same. I do think that the current fragmented, churn-y nature of the Javascript ecosystem can be a barrier to entry for simple apps at the moment; for that reason, I'll welcome the day when the Javascript ecosystem reaches peak "Javascript fatigue", becomes a bit more stabilized.

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

#650

Earlier quoted context omitted.

Google and Tesla beg to differ.

For a very restricted definition of "self-driving" ... but fair enough, in the context of the parent post, the self-driving cars we do have are impressive pieces of software

Google's cars are operating on city streets you know. They're up to over 1.5 million miles.
Post reply on HN