The Data Aggregator

Don't Use Create-React-App

(At First)

I thought I'd start my blog off with an opinion piece. When I write an opinion piece, I'll usually try to back it up with real-world reasons (you know, like a good opinion should have). Also, as always, opinions are just that. Do not take this as fact, law, or requirement. But I do hope it at least makes you think about the topic and possibly learn something from it. With that preface out of the way, let's jump in.

Although I'm a front-end developer who's used React for a while, I've never actually used Create-React-App. I've read about it, looked at it, even executed it before. But I would immediately delete the result and move on. Why, you may ask? Because I don't like black boxes. I believe that a growing developer should strive to have as few black boxes in their code as possible. The more you understand about how the code you're using works, the better a developer you'll be.

For example, Backbone is a small but great library for front-end applications. I worked with Backbone (and still do a litte) for the first few years of my web development career and loved it. Sure, it had its quirks and shortcomings, but one of the things I liked most about Backbone was that I understood it. The source code was easy to read; the library was small enough to grok. By the time my use of Backbone started to wane, I knew that library in and out. If something wasn't behaving like I thought it should, I had no problem diving into the depths of the Backbone code to figure out why. I believe this made me a better developer. It trained me to be able to read someone else's code, to parse it, understand it, and use it to its full potential. More importantly, if something went wrong I wasn't lost about where to start debugging it.

Growth Requires Effort

This skill is hard to acquire, but it's necessary. Seeing how other people write code can grow your own coding abilities. You may like how they formatted some things, but not like how the formatted others. You can stare in confusion at the over-engineering they used to complete a simple task, or gaze in wonder at elegant solutions to difficult problems. You'll learn to identify architecture patterns and when to use them.

Beyond just refining your own abilities, you'll be able to use tools more efficiently and effectively. You won't mess up the API calls that lead to hard-to-find bugs. You'll see duplicated efforts before they're committed and correct them. All because you know how the library works and you know what code is being executed when you call it.

Knowing Why

Now, I'll take a timeout here to reword and emphasize my premise: "The fewer black boxes you have in your code, the better a developer you'll be". I say "fewer" intentionally. There's practically no way you'll be able to understand 100% of the code that's running in your product. Frankly, I don't understand React! React is a black box to me. So are Webpack, styled-components, babel, and many other libraries that I use. I have many black boxes in my code. But my goal is to have fewer black boxes. Anytime I run into a bug when using a library, I take that opportunity to learn more about the library. I debug the page, inspect the code, look at the source, and see if I can not only find a fix but know why its the fix. That last part is a differentiator I see between senior and junior-level developers. A junior developer can find the fix for a bug, but a senior developer knows why its the fix. That's usually the first question I ask the developers on my team when they present a bugfix, Why? Why that fix? If your code is a black box you can't answer that question.

The fewer black boxes you have in your code,
the better a developer you'll be

So, looping back around to the title of this post. I don't use Create-React-App because it creates an enormous black box. Not only do I not know how React works, but now I don't know how to configure webpack, setup hot reloading, configure babel, setup unit testing, optimize my production bundle, and all the other things that are abstracted away. All this means is that you've missed multiple opportunities to become a better developer. Sure, you've saved time, but at the cost of improving your craft.

Conclusion

I want to remind you that my title includes "(At First)". This is because Create-React-App is not bad. It can jumpstart a project that has a fast-approaching deadline. It can help you spike a proof-of-concept. It can even enable some developer-friendly tools that you didn't know existed. However, and this is the goal of this post, I want you to see that each of these shortcuts is a missed opportunity. A missed opportunity to learn more, to gain experience, to improve. And to me, that's not worth it.