insights about software development

Saturday, December 16, 2017

Software: Naming requires creativity

December 16, 2017 Posted by eroltutumlu 1 comment
In this first blog post, I am going to focus on naming variables/functions in software development. Why I want to talk about this is I was listening podcast and there were lots of ideas that make me think deeply about naming. You can check it out the podcast from this link: http://www.se-radio.net/2016/12/se-radio-episode-278-peter-hilton-on-naming/ I highly recommend listening to this podcast.

Let's go ahead through the important bits that run into as I was listening podcast.

Peter Hilton is a writer, and British mathematician he wrote 'Play for Scala' book which is very famous when it comes to web development on PlayFramework/Java.

It was fun to listen because the first question asked by the interviewer is that why naming is so hard? It must be quite straightforward because this is just naming something and the answer was also surprising given by Peter Hilton. Naming is one of the hardest things in software development like validation and caching.

He was saying that naming is an important subject and one of the most challenging thing that you might come across when you build the software systems. It requires creativity. When you create a variable you have to think a bit about the words. The code is for human communication as well as machine communication.

For instance, when you name a function it must be summary of the function. You shouldn't use popular words like Get something or DoSomething because function aims to make something actually. I wanna get the data from somewhere FetchWeatherData, Calculate/Divide are better options instead of using GetSomething. You should avoid using data as well because basically everything can be a data and it is not clear what you mean. Reasonable naming does your code seems like a poem in terms of readability.

Another thing that he was saying that it's better to name in time. Renaming might be harder than name something, in that case, we should think about naming as much as we can do. I think

The idea that sums up the entire text is that you need to think twice when we name something.

So, what do you think?  Any idea is welcome.

Suggested book:

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 / Clean Code from Uncle Bob. It has a chapter named Naming for further information.

1 comment:

  1. I agree with you. Finding an appropriate names in software development is difficult, but it gets easier with experience. You also have to remember to use comments in your coding, so you remember what your code is suppose to do.

    ReplyDelete