startups and code

Coding Dojo - Code Practice

Back to home

Practice, practice, practice. There are so many times I heard that growing up, and it always stuck in certain things. When I danced, I would rehearse, go to class and practice, learn, and practice what I learned. In jujitsu, I would go 3 times (or more) a week and practice the same moves over and over again. I never thought of applying that same practice to coding, until recently. Yes, I've been coding for over 20 years, yes, I should have figured this out sooner. That is why I am writing about it now. I practice coding all the time, I write code almost everyday... yes, even on weekends. I never thought of myself practicing though. My wife describes my practice as getting ready to get ready. I love that.

Coding Dojo

I go to my coding dojo, and I run through my katas. I setup repos, I setup folder structures, I configure unit tests, I write a level of authentication, I create a start page. I do that all the time in multiple languages/frameworks. I have trained in React, Angular, C#, ADA, C++, and even ABAP. I train. I practice. I do that so I can be ready for the production level of code. Martial artists train so they don't have to fight. I code train so I don't have to fix a production issue at 3am. :-)

Coding Katas

I mentioned a few of my coding katas, but when I analyze what I do, it is important to explain and help new developers to hone their own skills. There are several levels of coding training that is important, but you need to choose your discipline to start. The discipline is not important, but it is important to focus on one and then expand. I don't recommend learning hello world in 15 languages and know nothing about classes, memory management, or thread safety in any. Most of the foundations are the same. The techniques may change, but the foundations are the same.

DevOps Katas

Implement Version Control I almost always use some version of Git now. Doing merges of binaries maybe something to be left to subversion or TFS, but always implement some version of source control. Translation: Setup a github repo, and clone it locally, and be able to push/pull/merge to it successfully.

Setup your folder structure It seems trivial but it is critical to be consistent. Set it up and stick with it. Do you have a source folder, do you have destination folder, do you have images, external libraries, external css, classes, data models, views, controllers, data access layers , etc... Set it up, embrace it, and refactor it over time... you'll figure out what structure works best. Also, know that different frameworks may need different structures.

Create a deployable project If you have created an amazing website and you have no version of it on a live site outside of localhost, it is not finished. Figure out what you are going to use, Heroku, Firebase, HyperDev, Custom Hosting? How are you going to deploy it? If you are still using FTP, there is probably a better way. Here are some deploy tools to play with. For now, I use a webhook from Azure into Github and all done. If it gets merged into the production branch, it is going live.

Create an initial unit test Setup your favorite unit testing tool, mocha, enzyme, nUnit, jUnit, etc... I am like Enzyme more and more for JavaScript testing (Thanks @housecor for the tip). Set one up, and use it moving forward. I use nUnit for all my C# tests. You should always have 1 unit test before you write a line of code, it gets you in a good habit of writing unit tests. That test should fail. Then write a line of code to make it pass. Yes, it is slower, but it will be much more stable as your "prototype" goes to production (again).

I think I'll stop there for tonight. Next up, Coding Katas, quicksort, b-trees, string manips, building classes, etc... Then maybe UI Katas for HTML/CSS. This is going to be fun.

Shout out to Jack Garrett and Brian Johnson for teaching me that I can always learn more. :-)

Now go build something AMAZING!