Live data from Hacker News

Step-by-step tutorial to build a modern JavaScript stack from scratch

github.com

191–200 of 211 posts

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#191

Earlier quoted context omitted.

No. Is there something you are trying to imply that I'm missing?

This is 2016 and devices have more memory, that's true. But ignoring memory efficiency is ignoring the basic principle of engineering and I see younger folks tend to ignore that more than olders. Having more memory available does not mean that reduced footprints are not better.

Sure, but I'm also not going to optimize dev dependencies. I care about the prod environment, but when one window of my IDE takes up 4x the memory of the app I'm actually developing, I just fail to find a reason to care about my local environment.

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#192
post #14

Earlier quoted context omitted.

Describing that collection of tools as "minimalistic" was indeed a touch of irony. Angular (1.x) might not be "cool" anymore, but it can be pretty darn "minimal" to set up: https://github.com/roboprog/ang-prog-enh (above not quite done, it's for a presentation I'm going to do in December, but it's pretty close) React works better for many things - server side rendering for SEO; endless scrawling wall of chunks of mor…

...and I'm just sitting here, using jQuery..

And that works well for some use-cases, as well.

E.g. - I (only) want to read some hidden link data in the original page DOM, then load some page fragments that are taking longer to generate.

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#193

Earlier quoted context omitted.

Who cares? This is 2016, memory footprint hasn't been relevant in years.

This attitude is precisely why so many software projects nowadays are memory hogs. Not everyone has an i7-powered Macbook with 8+ GB of RAM.

It took my 2 minutes to find a laptop under $500 with 8GB of RAM. My 2011 asus laptop has 8GB RAM. I'm not going to build software with my 2005 Inspiron in mind. Don't expect people to cater to 10 year old machines.

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#194

Ridicule me all you guys want but I still write using just html/css/js and sublime text (no jquery either). And I have written a 30k line project using just that and php. Being a filthy casual has it's upsides. I can do whatever I want insanely quick. Moving projects from machine to machine is quick as well. Only time I use command line is for git. I do have the advantage of having all my customers on a modern browse…

Lately I've been seeing this as part of the problem in web dev. When you start a new project - let's say something like an employee management system that tracks schedules, locations, reviews, etc. - one of the early things you do is probably grab a framework for the back-end; maybe Laravel or Symfony or Zend - or maybe you roll your own (router, controllers, models, views, whatever). You mentally conceptualize and visualize the entire project in terms of delivering "views" to the browser (something not helped by the inaccurate terminology used in most back-end "MVC" frameworks).

Why don't we see the front-end in the exact same way? I have a list of requirements that the interface needs to accomplish - why don't I use a front-end framework (which can actually be a real MVC framework)? Why do we consider all these things for the back-end, but then write just one or two Javascript files for the front-end and add a few libraries like jQuery and/or Modernizr? Where's the consistency? Why do we just throw all our JS code into a single file? Our contemporaries would ridicule us if we did that with our PHP files.

Up until, like, Thursday, I thought this way as well.

I guarantee my next big project (after a few small practice projects) will place the "views" and "controllers" where they belong, completely within the browser. This is where the user interaction happens, and there's no need for a server round-trip every time something gets clicked. The "model" is the data store (i.e. the back-end server) - all the client needs is an interface to it. The back-end will be nothing more than the "model" layer, though it will necessarily have it's own routing and controllers (after all, business logic still belongs on the server where the user can't mess with it). Access is through a REST API, and it delivers nothing but data and URLs for static/generated assets.

Is this more difficult? Definitely. Requires more tooling on both ends? Absolutely. Lets me properly architect and visualize the entire project from front to back without any inconsistencies in perception? Yes. This is not MVC, this is VC/MC.

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#195
post #163

Earlier quoted context omitted.

Who cares? This is 2016, memory footprint hasn't been relevant in years.

Memory is still the number 1 limit I have to deal with, every day. Both on my laptop, and on the server side. It remains highyl relevant exactly because of that kind of attitude.

> Memory is still the number 1 limit I have to deal with, every day

My raspberry pi has a node server deployed on it. I'm confident you can figure out how to manage it.

> on the server side

These are dev dependencies. If they are making it to your server, memory isn't the issue.

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#196

Earlier quoted context omitted.

Well I can't say I agree in the slightest. If you treat JS like a toy, it's gonna act like a toy.

Treating it as something else won't make it something else. It will just require a "minimal" stack of 10 other technologies.

Again, you don't need to believe me, but shoving your head in the sand and pretending it's not useful isn't going to do you any good.

Tons of companies are very successfully using javascript for long-running processes on the server side. And it's not exactly showing any signs of slowing down.

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#197

Earlier quoted context omitted.

The thing is, Yarn is likely to supersede npm at the command line so this is really future-proof.

Until next month, when Flamphf replaces Yarn.

Except Facebook is behind yarn. I'm about as worried about Flamphf replacing yarn as I am about Flamphf replacing React.

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#198

Earlier quoted context omitted.

This attitude is precisely why so many software projects nowadays are memory hogs. Not everyone has an i7-powered Macbook with 8+ GB of RAM.

It took my 2 minutes to find a laptop under $500 with 8GB of RAM. My 2011 asus laptop has 8GB RAM. I'm not going to build software with my 2005 Inspiron in mind. Don't expect people to cater to 10 year old machines.

Not everyone has $500 of disposable income, either. Not to mention that very few phones and netbooks (like Chromebooks) have more than 4GB of RAM (in fact, I'm not aware of any in either category except for the Chromebook Pixel line). Lots of people in the real world are stuck with hardware with 2GB of RAM (or less!).

I develop with those users in mind. I don't expect the average HN-reading programmer to do the same (I've long given up on that), but that doesn't mean it ain't a problem.

Re: Step-by-step tutorial to build a modern JavaScript stack from scratch

#200

Earlier quoted context omitted.

Treating it as something else won't make it something else. It will just require a "minimal" stack of 10 other technologies.

Again, you don't need to believe me, but shoving your head in the sand and pretending it's not useful isn't going to do you any good. Tons of companies are very successfully using javascript for long-running processes on the server side. And it's not exactly showing any signs of slowing down.

Mhm, they have been.

Then they rewrote everything from scratch because as it turns out, javascript on the server side is still pretty damn awful performance wise.

Post reply on HN