Hacker News new | ask | show | jobs
by diggan 3689 days ago
I've never understand what these kind of boilerplates are for. Well, kinda understand if you're doing projects that takes just a few weeks to complete. Otherwise, you're just better off starting with your own boilerplate.

I mean, how does updating work? If you improve the scaffolding, people need to merge in their changes? Why is this not a CLI tool that would be effortless to update?

Although I must say it's impressive work made on this, and that it's cool to be able to generate many things, I fail to see any big value in using these kind of boilerplates.

7 comments

You don't merge from the boilerplate. Once you've started, that's it.

Boilerplates exist because, quite honestly, modern web/JS development is a hot mess. First, setting up a new project is the definition of analysis paralysis -- too many options and microdecisions. Second, there's a new library or a new, breaking update to your existing framework every other week. When you're busy actually working on a project, it's hard (and useless) to keep up with all the changes. So if you work on something for, say, 2 months, the next time you need to start something new, it's likely you'll have to spend some time updating your own project base and making sure dependencies work the way they're supposed to. Things will probably have changed in unclear ways.

Unless you're reusing a stack that might be out of date/not maintained anymore, the time from "start project" to "start actually coding" when starting a new web project is terrible.

Having a boilerplate to start from relieves you of all that stress, since you know it's more or less maintained and guaranteed to work out of the box.

A few years ago I'd never have started from boilerplates. I'd look up examples for certain patterns, but always start from scratch, many times reusing some of my own stuff. Nowadays, my approach is the opposite: I take a boilerplate with the combination of things I need, and change it a bit, adding or removing things here and there.

Updating doesn't work with boilerplates at all, but a CLI tool wouldn't really fix that — what you'd really want is a codeshift[1] for each new version, which we're looking into right now! (you probably also don't need to update them at all)

We've added tons of removal guides for each major feature, so people can take the parts they want from react-boilerplate and discard the ones they don't want! I see it more as a reference implementation that gets many small details right, a thing you clone and the cut to your liking to keep all those small details intact.

Does that make sense?

[1]: https://github.com/facebook/jscodeshift

So it's not like a library or framework, it's just a conglomerate of useful things that will diverge into "your own stack" after starting to develop and you have to update your deps like you would with your own boilerplate, the only thing that it saves you is starting a new project. Which is enough I think :)
Exactly, that's an excellent summary. :)
Boilerplates are used on large projects:

- so you can postpone learning some of the more esoteric stuff until you actually need it, rather than guessing at the beginning

- Spending a day setting up boilerplate at the beginning of a 6 month project doesn't seem like a big deal vs spending a day tweaking the boilerplate throughout the project, but early time on a project is important, it let's you get feedback earlier.

> so you can postpone learning some of the more esoteric stuff until you actually need it,

This is the main appeal for me. I want to get something off the ground quickly and start learning the core concepts - not get sidetracked into understanding a peripheral tool.

it also lets me learn by example, with a clear ipicture of how a tool or library or whatever fits into the puzzle.
> so you can postpone learning some of the more esoteric stuff until you actually need it

If you don't actually need it then why are you deploying it into production? IMO, while these boilerplates are an excellent way to get familiar with some popular tooling, I think it's a terrible idea for people to be deploying code into production that they don't need or even understand.

> I mean, how does updating work? If you improve the scaffolding, people need to merge in their changes? Why is this not a CLI tool that would be effortless to update?

You hit the nail on the head! This is a huge problem. We had a scaffold that included isomorphic rendering. At one point we discovered a potential XSS vulnerability in how we were serializing the initial state. Updating was trivial but we had to manually patch multiple apps.

We wanted the same thing and it didn't exist so we created it. https://github.com/TrueCar/gluestick

You're right, this could be a CLI tool. But the difference is only how you start - clone a boilerplate or run a command to generate one - a pretty small difference compared to the actual framework you end up with, which I think is an important milestone.

I see Redux+React as becoming the next Ruby on Rails due to the set of conventions it promotes. These conventions will have the same benefit to companies and developers switching between projects/developers and getting up to speed very quickly due to the same structures ( actions / reducers / etc ) being used by multiple projects.

Personally, I do small side project, and every time I want to do something new, the ratio time spent to setup vs time spent to actual code is 80:20.

Typically I just need react + router + bootstrap, and if I can choose, I prefer gulp. The whole ecosystem evolves too quickly, so every 2-3 months I need a fresh boilerplate.

This said, most of the changes I to from boilerplate to app are pretty much confined, and it's not hard to update the boilerplate below... problem is that often time people release a boilerplate, then abandon the project.

We're definitely not abandoning this boilerplate, ever. There's a core team of a good dozen people that are committed to maintaining it, including myself.

Even if I don't want to do it anymore, there's a good 20 people that know the project just as well as I do, if not better!

Given this is a complete rewrite, I guess updating doesn't work at all. But at least in that sense it gives you an authentic experience of modern web development!