Coding Strategy

When you start coding do guys start from Scratch? or a template and modify it?

Do you have a strategy to be efficient?

It depends on the person and the type of project.

What is a “template”? When I start a React app, I use CRA to generate boilerplate code. Is that a template? I have a script to build out component folders. Is that a template? Probably not. But I spend most of my time working on large projects at work that we’ve been building and modifying for more than a year.

I mean some people probably use templates in the sense that you mean. If I were mass producing web sites for clients on upwork or something like that, I’d probably have a few templates to use and modify. If a company needed a lot of mobile apps you might have a starter framework so they all have a similar look and feel.

What’s a script to build out component folders? is that a reference guide to code? did you create that yourself? I’m referencing a lot back to the course as I’m learning to code these projects. Is there shortcut(cheatsheet) to references as you code?

That does make sense to have a template when producing web sites and use a starter framework mobile apps.

I wrote a bash script to build out the boilerplate files and folders when I create a new React component, in the format that we use at work. It’s common to put components in its own folder with some specific folders. I wrote a simple script (a small program) that I can give a destination folder and component name, and it will create all that for me, saving us a few minutes of typing and decreases the chance of a typo. It’s nothing magic.

Is there shortcut(cheatsheet) to references as you code?

Not really. I mean, I check documentation and stuff a lot. There are plugins you can get for your editor, etc.

But I’m not really using a “template” in the sense that I think you mean. I work for a company with a few apps and I’m not creating new apps.

I also don’t know how useful a template in the sense that you mean would be that useful. I mean, all the sites/apps would end up looking roughly the same. The only situation where that would make sense (I’m guessing here) would be someone making a lot of cheap sites for low paying customers on upwork or fiver. But a lot of that I assume gets gobbled up by WordPress. I guess you could say that WordPress is the modern version of “template sites”.

But it really depends on what you mean by template. I mean, we don’t code sites from 100% scratch, with pure vanilla JS, HTML, and CSS. People might use bootstrap. Is that a “template”? Probably not in the traditional sense. What about Material UI? I use React - I often start with a CRA base with TS, Redux, Redux Saga, and Sass. It’s not really a template in a visual sense, but perhaps in the code sense.

I’m still not completely sure what you’re asking, but I think the answer is no, not usually in the sense that you mean, except maybe for people making large volumes of cheap sites.

That’s how I see it at least. I’d be interested to hear if others have different knowledge or experience.

If you’re using a framework like React or Angular, there are often cli tools or packages that will create a starting app. There are additional tools that exist for generating a file/component/etc with boilerplate code - although I think that often once people have been doing this for a while they tend to prefer creating their own via IDE snippets or scripts that they write.

If you’re talking about actually starting to create content, I prefer to start by building a very simple skeleton first. I’ll throw up some divs or whatever that might just contain “this is where the introduction text goes” or “add a form here”. Then I go through each element and create the simplest working version of it that I can. After that I keep making additional passes at each piece, adding polish and features (and tests).

first, thank you for discussing this with me! And I appreciate you time and help. I’m super new to this. it’s been challenging but interesting to keep learning.

Plug-in, bootstrap, boilerplate code. I believe that’s what I’m looking for.
Do you have all you functions (i.e. components, loops, arrays, and etc.)written down and copy and paste you build simple skeleton for a new app, program, etc?

I like your thought process on creating new content. I wasn’t sure what to look for but after yours and Kevin’s reply. I found something that will help me reference to and learn, The List of HTML Elements by category as I’m create new content.

Thanks for you time and help.

Do you have all you functions (i.e. components, loops, arrays, and etc.)written down and copy and paste you build simple skeleton for a new app, program, etc?

Not really. I guess I reuse my component script when I need it. I don’t make new apps much but when I do, I have a boilerplate that I use.

I think that you are thinking about short cuts too much. I think you should focus more on just learning to code. As you learn, the tools that are available will make more sense and when they help and when they don’t help will be more obvious. Also, with coding at least, a short cut is a bad thing if you don’t understand what it is doing. You still have to learn the ideas. There isn’t a short cut for learning. If I’m driving to the beach, maybe there’s a short cut, but I still need to know what a beach is, which beach I want, what I will be doing there, what I need to bring, how to swim, how to drive a car, etc. There is no short cut for all of those things. If I don’t know those things, then the short cut is a waste of time and could even be dangerous.

So, again, just focus on learning to code. Worry about short cuts when you start needing them.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.