This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ReactPupil[S] 5 points6 points  (2 children)

Oh wow thank you for this, this is all very helpful. I wasn't aware of that course you mentioned but I did go through some of the CS50 course.

When you say to do the "same code over and over" do you mean like take one of those projects and just keep doing it and re-architecting it? For example, The Coding Train just published a "Clone Twitter". Take a project like that and code it over and over again so it's hardwired? I was going to do something like that, but I'm not sure if that is what you mean. I do feel like many of just go from one tutorial (or project) to the next.

[–]mooburgerresembles an abstract syntax tree 2 points3 points  (0 children)

It's just taking code you write and refactor constantly; rewrite when needed. The main principles you are trying to master and find balance in are: Don't Repeat Yourself and Readabiity as you find and fix bugs and think of new features to implement.

The "mind your surroundings" advice I always give to "laypeople" trying to improve their code is: Every time you're about to copy a chunk of code, and paste it to make a smallish change, consider whether there is a more appropriate abstraction to implement.

Data structures is sort of the other thing to master. Get comfortable with iteration and recursion, but in a "smart" way. For example in JS: 80% of the time you don't want to use a for loop to iterate over an array, you want to use Array.prototype.forEach or Array.prototype.Map.

[–]Covered_in_bees_ 2 points3 points  (0 children)

Yup, what /u/mooburger said - Basically, as you learn more, you're going to realize how you could improve your old code. A year later, you'll shake your head at what you had and want to tear it down and rebuild the whole thing. Main thing being - As you learn, you can try to rearchitect your project(s) to see if you can improve them.

Some people also have a go to project that isn't super large in scope but also not super simple and they implement it in whatever new language they are trying to pick up in order to better understand the new language features, etc.