Skip to main content

Good programming practices


Over the past few days, I have been pondering over the fact that despite having a good hold on OOPs concepts and apply them while writing code to solve a particular use case, I am still not writing good code.


I have been coding for almost 6 years now. 2+ years of professional coding. When I was in college, I was a wild programmer solving programming contests, DS problems. What I mean is that I only coded to solve the problem, did a lot of dirty coding. I never bothered if the code can be reused, if someone else or I myself can understand it if I looked at it after a few days. I did have a good habit of writing comments. 

When I joined work, I learned many different aspects of how the code was written. Many facts were taken into consideration like code maintenance, reusability, testing etc. I still remember a co-worker who told me if you need to write 10 lines of beautiful code, you should have seen 1000s of lines of amazing code. Due to the pressure of getting things done, I hardly got much time to appreciate the beauty of the logic written wholeheartedly.

I was going through few blogs about best programming practices. Thought it would be good to share them. 

This one is my favorite. Very informative and well-articulated blog post. Will you give a good perception of standard principles and how one has to think before starting to write code.
http://williamdurand.fr/2013/07/30/from-stupid-to-solid-code/

This one talks about how to think and work with best practice methods to be a good programmer.

This one is for professional coding. More technical details to be kept in mind. 

PS: Other than these practices, learning about version control is key to quickly get a hang of things when you get to work. I would suggest learning GIT. You will eventually learn VCS but learn how it is done, why it was done like that will help appreciate the beauty of it even more. 
Few places to start off can be https://www.atlassian.com/git/tutorials - detailed explanation.
https://try.github.io - for practice.
There are abundant video tutorials available about VCS, GIT etc. You can go through them as well. 


Comments

Popular posts from this blog

The one where Raj went for Cycling (First time Experience - 50km circuit)

The Past: I met a friend Srini in violin class and got to know that he goes for cycling with a bunch of explorers once in a month. I was excited and told him I had a cycle but haven't done cycling and would love to try. So he told me he will inform when they go for a ride. The Present:  Srini texts me that they were planning a morning ride of approx 50-60km circuit. Even though I was excited, I was a bit nervous if I could push myself for that far. I did think of it for a while and I was like "If not now, then when??? ". I said yes. It was a Sunday morning that we started off. The weather in Bangalore was a big threat as it was raining pretty consistently for the past fortnight. We trusted few weather reports which stated that there is not going to be any rain in the morning and there might be slight rain in the afternoon. Srini started from HSR, two of friends joined in Bellandur, I joined in Kadubeesanahalli junction and two more joined in ISRO junction. The r

Implementing a file monitoring script using python.

The idea is to implement a method where a user will be able to modify an xml file and the modifications will trigger a certain action in the script. This has to be implemented in python. WatchDogs is a python library that helps in file system monitoring. API reference : https://pythonhosted.org/watchdog/quickstart.html#quickstart Useful link :  http://brunorocha.org/python/watching-a-directory-for-file-changes-with-python.html The example scripts provided in the above links give a good headstart to play around with the file system and figure what is the exact use case that you want to achieve. Current use case:  The python script that I run is bundled as a container. There are mounted volumes in the container. So using an external script I am planning to modify the xml file and since the same file is modified inside the container, the python thread that is listening to the file modification event will trigger an action like sending a mail, make an entry to the log file.