2 Comments

I would like to point out that StackOverflow isn't a Q&A site. I know it's confusing but Jeff Atwood, one of its original creators, complained at length about this years ago on his blog. It's a Wiki, not a Q&A site. It's a reference site. That explains their dysfunction, doesn't it? The points attributed to a question and its corresponding answer are meant to be an indication of the question's long-term viability and the answer's veracity. They basically only want questions with "universal" answers; questions that aren't specific to you.

You ask for an answer to "A in scenario X" but they aren't interested in that. They'll tell you "B is how we do things in scenario X". Moderators will kill your question if it's unlikely to add anything of value to this idealised version of a Wiki that lives inside their mind's eye. Everything about that site is fucked because its creators and its users have fundamentally different views on how the site is supposed to be used. Jeff Atwood and Spolsky did a terrible job of realising their vision. Hopefully chatGPT will kill that dinosaur.

You can use React the minute you have a fundamental understanding of JavaScript. Think of JavaScript as Lego. Your job is to design each brick. A brick is constrained by its manufacturing process. In the world of JavaScript that would be a function. A function doesn't necessarily receive an input but it should always return an output and is no different from having to write a linear equation.

The owl consists of a certain number of design layers. Think of "layers" as a series of components stacked together neatly. Components are functions and nothing else. React forces you to write components a certain way and that's a good thing. That kind of structure allows us to collaborate with others. All you gotta do to make progress here is to understand how components are written.

When you design your app you must think in terms of components and how they're stacked together. You can do this on paper. HTML is essentially the skeleton of your app, CSS is how you present yourself to the outside world (e.g. skin, clothing), and JavaScript how it moves (e.g. muscle movements). This perspective is useful in deciding how to structure your components. Where does an "arm" fit into the whole of it? You can and should include your CSS within each component. HTML is basically nothing but a 2D surface of a stack of Lego. Create an outline of your app in the same way. Then ask yourself a few questions: "What data does this component receive as input if any?", "What does this component return?", is it data or a view (e.g. layout)? It always returns something, some HTML it needs to render, but when should it render this view and how often?

The next thing on your list should be to answer questions like "how is data transferred from component to component?" In other words, data flow. If you can visualise how data will flow through your app you can create anything you want. The only other prerequisite is an understanding of the browser context which I'm assuming you possess.

Finally, I want to caution against using chatGPT. It's designed to please you and that can be dangerous. It's certainly a helpful tool. It can teach you how to think like a developer if used properly. I just want your readers to know that it's very much a people pleaser and that it might make you a lazy thinker. ChatGPT is superior to Google and I use it often but don't forget to develop trust in yourself.

Expand full comment
author

Another great comment.

As a rule I try to keep chatGPT to less than 50% of my coding time. I know things are going seriously badly if I’m having to use it all the time

Expand full comment