Self-assessment, how do I become a better programmer?
Tags: productivity, angular
Published: 2020-11-16 02:20:42

The goal of my post here is to figure out #1: what exactly am I doing when I program, and #2: how do I improve each of these steps.  I'm not talking about any of the overhead associated with a programming job but the actual coding work itself.

Right now it seems my work is broken down into the following 4 types of tasks:
A. **Learning/Googling**. How do I do this new thing?
B. **Writing code**. I know (or think I know) exactly what I am doing.
C. **Debugging**.  I know what I am trying to do but it doesn't work.
D. **Being generally confused**.  What are you doing ?? this design/naming convention/object model doesn't make any sense ...

Here are my current thoughts on how I can improve on each of these items.

## A. Learning/Googling
Like most people, I feel like I am always googling questions throughout the day so I assume I'm good at that...  But obviously there are more ways to learn.

#### 6 ways to learn 
1. Read a book
2. Watch a youtube video
3. Take a class
4. Google it
5. Learn by watching someone do it
6. Learn by doing

Since these are all self-explanatory, I will highlight the ones I probably need to think about more.

A. Book reading is probably one of my biggest takeaways here especially as a starting point for learning new concepts.  My typical loop is: 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tc777twg7pyjpx321msg.png)

with a good book reference the loop would probably be modified to the following:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xoss91gh2orew6l1ib68.png)


B.  I have had mixed results with youtube videos and learning.  I feel like they are useful early on when I am first learning a large concept, but less useful after that.

C.  I need to be more active about taking classes.  For me personally I think a 2-3 day class is hugely useful.  It just takes more proactivity on my part to set them up throughout the year.

In writing the next section, I realized I have to make sure that when I learn I make good notes for myself for future reference so I can minimize the re-learning required.

## B. Writing code

I have just recently started using the pomodoro technique thanks to simpleprogrammer.com.  This has worked wonders!  I don't think I have actually quantified it yet, but it feels like a factor of 4x improvement in my output. My takeaways:
* **Make sure to keep doing pomodoros** even when you are squeezing in just a "couple minutes" especially late evening because that is when I am likely to get frustrated.  (Pomodoro technique is basically working for 25 minutes, taking a break for 5 minutes and repeating.  You don't allow any interruptions during this time and you focus on a single task.  I have been amazed at how useful those 5 minute breaks are even when I think I am motivated and focused).
* **Keep writing this blog** as a reference manual for yourself. *Especially blog worthy are the things that I learn that I need to paint a mental picture of a concept to learn.*  A great example of this is directives in AngularJS.  I have wasted a lot of time re-learning directives.  *Huge example of a website I seem to reference all the time that you may find useful as well is this brilliantly simple illustration of how to do SQL Joins.*  https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/

Final update on the "want to do a thing" flow chart is to include this last note at the end for the more complicated concepts:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/epc645mlkw89smta6gkn.png)

## C. Debugging
Learning the debugging tools is a huge requisite for debugging well.  I only recently learned how to do use chrome's built in debugger for the client side code.  This has removed a huge amount of time wasting from writing console.log(everywhere).

Here is a flow of how I think about debugging:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vpcy792hfuvujqu21gwi.png)

I think I need to do a better job admitting to myself when I don't understand a concept I am using and take the time to learn it instead of just "trying something."  I think there is value in trying something, but more often than not I need to acknowledge the tool I'm using I really I have no idea how to use.

The other thing I should improve is make the things I do all the time more efficient.  For example adding a simple crud operation to the whole stack rarely works first try.  Adding a table, a route, an api call and adding it to the object model is very much the same every time!  I'm sure a blog post might be useful here to figure out how to maximize code reuse and sort out a good process here since it is very much the same thing each time.



## D. Being generally confused
Again, I'm not talking about confused in the since of *I don't know how to do this* or *why doesn't this work*.  This is when I understand the problem, but am asking **what are you doing ?? this design/naming convention/object model doesn't make any sense**.  Being confused for me in this way typically means I didn't come up with a sufficient mental model/design or just that I have learned enough that I need to refactor.

If I'm being honest, probably my biggest confusion recently has been on the best use of objects.  I have tried a number of exercises and reading to try to internalize the best way to look at a problem and break it down properly into different objects.  Perhaps I just need to accept that I can't get the objects right the first time and that refactoring the object model is a healthy part of building object oriented code.

I probably need to take a look at a couple of the following books:

[Clean Code](
https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164/ref=asc_df_0134494164/?tag=hyprod-20&linkCode=df0&hvadid=312091457223&hvpos=&hvnetw=g&hvrand=2209049753565152459&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1017003&hvtargid=pla-423658477418&psc=1&tag=&ref=&adgrpid=62820903995&hvpone=&hvptwo=&hvadid=312091457223&hvpos=&hvnetw=g&hvrand=2209049753565152459&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1017003&hvtargid=pla-423658477418)

[Design-Patterns-Elements-Reusable-Object-Oriented]  
(https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=asc_df_0201633612/?tag=hyprod-20&linkCode=df0&hvadid=312280575053&hvpos=&hvnetw=g&hvrand=15807661113430575086&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1017003&hvtargid=pla-395340045790&psc=1)

[Refactoring Improving Design of Existing Code] 
(https://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Signature/dp/0134757599)
(shout out to simple programmer again for this recommendation)

## Summary
Overall I think my biggest takeaway is that  I have some foundational holes with object oriented design and refactoring.

Specifically my takeaways:


A. **Learning/Googling**. 
   1.  Buy a couple of reference books for the new things I am learning
   2.  When I learn complex things that require a mental model, write a blog post to explain them to myself in the future.

B. **Writing code**. Keep using pomodoros even for "quick" coding sessions.
C. **Debugging**.  Write a blog post on the process of adding a simple feature requiring crud operations.
D. **Being generally confused**.  Buy Clean Code, Reusable Object Oriented Designs, and Refactoring Improving Design of Existing Code.




What do you guys think?  Any tips, books, or other recommendations?