Categories
ASP.NET C# code General Git Tips

Show me your progress with your commits

Git Commit

I’m currently working in a new application. It’s an ASP.NET MVC site written with C#. We are using the following technologies: Windows Communication Foundation, Knockout, Bootstrap, PostgreSQL, and Git.

I’m working on a new feature that will require me to make changes to the UI, javascript files, add new database tables, add service methods, add unit and integration tests. In other words, I have to modify all layers in our application.

To accomplish this task, I decided to try something different. I want to show my progress with my git commits. I want to complete small tasks and then commit my changes. For this specific task, I started writing a falling integration test. This failing test forced me to create the new database tables needed. After creating the tables, I ran the tests again and this time everything was back to green. At this point, I’m ready to commit these changes. This commit is the beginning of my work and it gets me closest to the final goal. I go ahead and commit this change.

commitTableCreation

After adding the database tables, sql scripts to generate them, and some unit tests, I’m ready to start adding service methods, data contracts, etc. For this task, I follow the same technique as above. My unit tests pass and I have not broken the build so it is time for another commit. With this second commit, I’m feeling productive. I have accomplished something. I can show my progress to my boss or team members with these small commits.

On the other hand, working for a long time without committing your changes, makes me nervous. What would happen if your hard drive fails? It happens all the time. I think we all have experienced losing our work. Many times it was something other than a hardware failure. It was a human error. For example, we deleted some files that were not in source control by mistake.

That’s why I like to commit often. As long as my project builds and my unit tests pass, I’m going to commit my small changes. I know that these commits don’t fulfill a complete feature, but they take me a step closer to my finish line.

After a few commits, I have accomplished enough back-end code that I can concentrate on the UI. Here is the initial version of the UI:

ContractSurvey

It is not perfect. I know that changes are inevitable. I would say that right now I have completed 80% of the task needed to bring this work to completion. I have 20% more to go and I can see the finish line. Seeing the finish line motivates me to do my best and finish strong.

I urge developers to commit small changes and commit often. Remember that these small changes will help you accomplish your goals sooner rather than later.

Categories
Git open source Source Control Tips

Ignoring files with Git

GitIgnore

Git ignore allows you to specify files or folders that you don’t want to track with git. Some of the files that we don’t want to track are files that differ from one developer to another. They might be files resulting from a build. Other files might be artifacts that will change every time you build your project.

For example in Asp.Net projects, all of the dll files go inside the bin folder. Some of the dll files might be coming from a public nuget repository while others are private. Adding the bin folder to the .gitignore file will notify Git to ignore that folder and all of its contents.

If you are using Git, you can create a new file called “.gitignore” and place it in the root of your project. Now add [Bb]in/ to the first line of the file and save it. From now on, any files that reside in Bin or bin folder will be ignore or untrack by Git. There is a public repository at github called gitignore that has common settings for different languages. There is one for Visual Studio and you can find the project here. You can take a look at those settings and copy those to your project.

To read the official Git documentation, go to the gitignore page. I hope this article helps you gain more knowledge about Git and its features.

Categories
General Tips

Follow these tips to get your first job as a software developer

During my last two years of studies, I interviewed with many different companies. Most of them required some experience in a programming language: Java, .Net, Php, etc. I had many friends that had part-time jobs working as web developers. For them, it was easier to secure a full-time job after graduation. For me on the other hand, the lack of experience hurt my chances to start my IT career right after graduation.

To help you get your first job as a software developer, I recommend you follow these tips:

  • Gain experience

The sooner you start your professional career, the better chances you have securing your first job as a software developer. Working part-time and going to school at the same, it’s no easy task. I highly recommend finding a part-time job during summer or find an interesting open-source project where you can apply your knowledge. Employers want students that not only have the academic projects on their resume but also can list real life projects on their resume.

  • Keep investing in your education

Information Technology is a fascinating field. It is always changing. With this in mind, you have to keep investing in your education. If you learned .Net or Java during college and you feel that having learned those programming languages is enough, you are wrong. Pick up a new programming language. Right now, Javascript skills are in high demand. Perhaps you want to learn Ruby on Rails, or Python. What about mobile development? Android and IOS developers are also in high demand. I encourage you to buy books or subscribe to online courses to help you learn new languages.

  • Embrace change

The only constant is change. Embrace it. Many years ago, Android and IOS did not existed. However, every year we saw that phones were becoming smaller in size and powerful. Some said that phones are mini-computers. Software developers need to be ready to change. The technology that is popular today may not be popular tomorrow. Software developers need to have an open mind to technology change.

I hope these tips will help you find your first job as a software developer.