Code Examples

One thing that bugs me about most code examples on GitHub is that there are little to no comments explaining how the code works in demo applications.

If you’re lucky the code demo is part of a blog post or tutorial that explains how the code works but if you are unlucky you have to manually look up each line of code to figure out how it works.

One thing I like to do is to create sample applications with comments explaining how the code works along with details about the framework and issues to watch out for. So if I open the application several years after I created it I will still understand how it works even if I haven’t coded in that language in a long time.

This is useful to me because I don’t specialize in one programming language or area. I use to be a C++ application developer but switched over to web development in ASP.NET (VB.NET) and I’m currently switching over to Java with Spring Boot now.

So having these little sample applications helps me switch back to a language I haven’t used in awhile.

I created a Spring Boot repository in GitHub that has my demo applications for Spring Boot. The applications have a lot of comments explaining how things work so you should be able to understand how the code is working by reading the comments.

Right now I only have one application that demos REST repositories using Spring JPA with Lombok in the repository. I’m still trying to improve it a little each day.

I’m going to create a version of it that doesn’t use Lombok when I have a chance.