Comments on: What Makes Readable Code: Not What You Think https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/ Wed, 28 Mar 2018 06:59:49 +0000 hourly 1 https://wordpress.org/?v=7.0 By: Ways to Write a Cleaner Code | Become a Better Programmer https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1670 Wed, 28 Mar 2018 06:59:49 +0000 https://simpleprogrammer.com/?p=1928#comment-1670 […] If you are writing some technical lines of code it doesn’t mean that it has to be less readable. The lines of duplicate codes are not only harder to read than a concise and elegant solution, but also helps in increasing the chance for an error. The tremendous thing about programming is that you can express commands in reusable, neat, and ingenious ways. […]

]]>
By: Conciceness vs Readability – Étienne van Buuren https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1668 Fri, 20 Oct 2017 10:41:22 +0000 https://simpleprogrammer.com/?p=1928#comment-1668 […] What Makes Readable Code: Not What You Think […]

]]>
By: Extreme DRYness | Coding for Smarties https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1667 Tue, 06 Jun 2017 20:15:07 +0000 https://simpleprogrammer.com/?p=1928#comment-1667 […] it doesn’t read well at first. According to this post on readability, readability can be measured by the level a developer would need to be to adequately understand […]

]]>
By: What makes readable code | A snappy title https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1666 Fri, 05 May 2017 07:56:55 +0000 https://simpleprogrammer.com/?p=1928#comment-1666 […] colleague shared this very interesting post on readability of code.  This is an issue I face most weeks – teaching in FE, where I work […]

]]>
By: Zack Macomber https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1669 Mon, 26 Sep 2016 14:21:00 +0000 https://simpleprogrammer.com/?p=1928#comment-1669 It’s really pretty simple…your mother should be able to read your code and GENERALLY understand it…also, if a beginner can’t understand your code then I believe you’ve failed to write good code.

]]>
By: boris https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1665 Sat, 09 Jul 2016 13:57:00 +0000 https://simpleprogrammer.com/?p=1928#comment-1665 I personally hate it when people have one liner functions that are used only ones.
for example , But if it is a complex condition and it is used many times in the code then it is really handy since you are able to change it really fast. But if it is used only once then just put it in a bool variable and not a function.
if ( coinBalanceIsPositive(coins) )

bool coinBalanceIsPositive(Coins coins)
{
return coins.balance() > 0
}

I also find it really useless if function names contain a reference to the object itself.
for example. because you already know the type of the object so there is no need to write more verbose code.
class AddProcess {
startAddProcess (){…}
}

Also long methode name are more verbose and thus less readable. Instead of writing a long methode that says well it does xyz on object A it might be better to write an abstract name for it and then you can overload it later on for other objects.

drawCircleOnPaper(circle,paper);
should be paper.draw(circle);

The most important thing is consistency if you can do the same thing in slightly several different ways then you have to change something.
dataManager.getCircle()
static_cast(dataManager.get(“circle”));
static_cast(dataManager.get(id::Circle));
dataManager.searchFor(“circle”);
then you should pick one of the methods and not all of them.

Also as a company use auto formatting tools share the settings files and don’t bother your developers how they need to write code.
bool bla(){

}
bool bla()
{
}
bool()
bla
{
}
or foo(int bla, bool bla) vs foo( int bla , bool bla ) vs foo( int bla, bool bla )
The auto formatting could even let the programmer format the code as he likes locally and format it correctly when pushing to the repository. I generally prefer the way to type and then let the formatter do the work if the company requires a special flavour.

]]>
By: New Features? Better Weed Them Out - Simple Programmer https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1663 Fri, 15 Apr 2016 20:17:39 +0000 https://simpleprogrammer.com/?p=1928#comment-1663 […] located in the code associated with the new feature. Unfortunately, bugs tend to magically appear in other parts of your application, which had already been thoroughly tested and proven in real life. You probably […]

]]>
By: Richard Terris https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1662 Thu, 11 Feb 2016 21:02:00 +0000 https://simpleprogrammer.com/?p=1928#comment-1662 This is a very interesting topic. My personal opinion is that as developers we shouldn’t code for the beginner because they won’t be novices for very long, but the code will always be poor if we write it that way…

I think it better to write the best and most efficient code, and if a novice is going to be reading it, they will likely learn from reading it, whereas if I deliberately wrote more verbose code simply to cater for someone with less experience, my output wouldn’t be as good as I could make it and in say a years time when that person is no longer a beginner, what use is my verbose code then?

Nevertheless, the points in the post definitely made a lot of sense.

]]>
By: John Picadilly Reed https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1661 Mon, 07 Dec 2015 05:50:00 +0000 https://simpleprogrammer.com/?p=1928#comment-1661 In reply to Adam Davis.

I’m a noob and I agree with you. I personally think spaces are more readable than dots, no semicolons are more readable than semicolons, and that omitting return types or type hints on methods is confusing, so I basically follow my own style guidelines rather than the “official” one. I mean I have a good reason for doing it (just compare “spot.bark.volume.increase();” with “spot bark volume increase”, but still

]]>
By: kassler https://simpleprogrammer.com/what-makes-code-readable-not-what-you-think/#comment-1660 Sun, 26 Apr 2015 15:34:00 +0000 https://simpleprogrammer.com/?p=1928#comment-1660 Experienced developers know how to write code that is understandable without knowing what the application does. This is almost the opposite to

”An experienced developer reading code doesn’t pay attention to the vocabulary of
the programming language itself. An experienced developer is
more focused on the actual concept being expressed by the code—what
the purpose of the code is, not how it is doing it. ”

The first step is to learn the language, next step is to be able to create apps with the language. That is the step you are describing. The third step is to create wonders with the language. You are then able to adapt the coding style for what is best to the task.

Experienced developers know how to handle +100K lines of code, how to code so that new developers can understand and work with the code with minimal introduction

]]>