Sloppy Code - thoughts
-
How is it even possible to have badly formatted code in this day and age? You can just press ctrl+shift+alt+windows+1+F and have it automatically formatted.
Formatting is just one piece of the puzzle.
Jeremy Falcon
-
However awful my code might be, at least it's properly formatted... :-) I agree with you; it's the same when I interview a developer that turns up looking like a homeless person: if you can't be bothered to take care of yourself, why would I believe that you'd be any different with your attitude to coding?
So you think Einstein was wrong? ;P
-
While we're on the subject of code reviews, what do you guys think about sloppy code that's not formatted well? I tend to not think I'm that anal retentive, but I admit the poindexter comes out when I see sloppy code that's not kept up to a proper margin, not indented decently, old commented code left in, etc. Oddly enough, the coders that write messy code tend to also have messy cars and homes. It's gross.
Jeremy Falcon
Jeremy Falcon wrote:
Oddly enough, the coders that write messy code tend to also have messy cars and homes. It's gross.
I was going to point out the same fact, interestingly enough. :thumbsup: Edit: I am saying this is "fact" only because I have never seen otherwise. I am sure it really is not a fact. :rolleyes:
-
How is it even possible to have badly formatted code in this day and age? You can just press ctrl+shift+alt+windows+1+F and have it automatically formatted.
People can also make their bed, take out the trash, and do the dishes...but they don't.
-
Jeremy Falcon wrote:
Oddly enough, the coders that write messy code tend to also have messy cars and homes. It's gross.
I was going to point out the same fact, interestingly enough. :thumbsup: Edit: I am saying this is "fact" only because I have never seen otherwise. I am sure it really is not a fact. :rolleyes:
We don't really have time for facts, we mostly go with assumptions instead.
-
While we're on the subject of code reviews, what do you guys think about sloppy code that's not formatted well? I tend to not think I'm that anal retentive, but I admit the poindexter comes out when I see sloppy code that's not kept up to a proper margin, not indented decently, old commented code left in, etc. Oddly enough, the coders that write messy code tend to also have messy cars and homes. It's gross.
Jeremy Falcon
It's so easy to format your code properly... Ctrl + K, Ctrl + D (in Visual Studio anyway). It doesn't delete white spaces, but it does quite a bit for you. I'm amazed at how much badly formatted code I still see! And in my experience if the code is poorly formatted it's poorly written. Comments are as bad, or worse...
// Create a new person
Person p = new Person();NO, REALLY!? Arghhh! And I actually see those kinds of comments... Another thing I can't stand is copy-paste programming. And much too often it's way too obvious. The following is some production code I've had the 'pleasure' of working with (it was an obvious comment that was copy-pasted, but not edited with the code).
// Save the customer
product.Save();I looked at it and screamed in disgust "OH LORD, WHY DO YOU HATE ME SO!? :(( "
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
} -
We don't really have time for facts, we mostly go with assumptions instead.
I'll accept that as a fact.
Jeremy Falcon
-
I'll accept that as a fact.
Jeremy Falcon
You assume too much :laugh:
-
So you think Einstein was wrong? ;P
About what?
-
About what?
-
He looked somewhat disheveled which is not the same as looking like a hobo. Besides, I, like the man, hate wearing socks.
-
While we're on the subject of code reviews, what do you guys think about sloppy code that's not formatted well? I tend to not think I'm that anal retentive, but I admit the poindexter comes out when I see sloppy code that's not kept up to a proper margin, not indented decently, old commented code left in, etc. Oddly enough, the coders that write messy code tend to also have messy cars and homes. It's gross.
Jeremy Falcon
I'm with you on that code should be indented properly. Couple of things I have to add the format of code. Where people have excessive white space between code or methods and silly naming conventions that make code difficult to read
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
He looked somewhat disheveled which is not the same as looking like a hobo. Besides, I, like the man, hate wearing socks.
I think the comments about the looks on one subject also reflects the action in another. If it truly were like that you'd never be fooled, by, let's say, politicians. ;)
-
While we're on the subject of code reviews, what do you guys think about sloppy code that's not formatted well? I tend to not think I'm that anal retentive, but I admit the poindexter comes out when I see sloppy code that's not kept up to a proper margin, not indented decently, old commented code left in, etc. Oddly enough, the coders that write messy code tend to also have messy cars and homes. It's gross.
Jeremy Falcon
ctrl e,d in xaml formats the code, I find I am doing that in all sorts of applications, word, excel, bloody annoying. VS formats the layout for me so it is consistent and neat. Now old comments are another matter.
Never underestimate the power of human stupidity RAH
-
I'm with you on that code should be indented properly. Couple of things I have to add the format of code. Where people have excessive white space between code or methods and silly naming conventions that make code difficult to read
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
"silly naming conventions" like absurd Hungarian notation? There are only two variable naming conventions I prefer - the first is putting a "p" in front of a pointer: int *pInt; I know that's simple, but to just have it so obvious makes it easier for me to understand. The second is adding lsbs to the variable name: "crankshaft_diameter_mm" but I'm losing my love for this. I do work in the embedded world, and all is wonderful as long as the next product version does not roll out. I'm dealing with this now - common code base, version one had 1mm lsb, next version is .1 mm. Sort of elephants the variable names.
Charlie Gilley Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
-
How is it even possible to have badly formatted code in this day and age? You can just press ctrl+shift+alt+windows+1+F and have it automatically formatted.
How does 'just' relate to 'ctrl+shift+alt+windows+1+F'? :) https://www.youtube.com/watch?v=ab8GtuPdrUQ[^]
-
While we're on the subject of code reviews, what do you guys think about sloppy code that's not formatted well? I tend to not think I'm that anal retentive, but I admit the poindexter comes out when I see sloppy code that's not kept up to a proper margin, not indented decently, old commented code left in, etc. Oddly enough, the coders that write messy code tend to also have messy cars and homes. It's gross.
Jeremy Falcon
I would say that poorly formatted code makes it more difficult to maintain (depending on how badly formatted it is exactly), if it's not easy to spot a bug in the slop then it's harder to fix. Of course, if you have something like ReSharper installed then CTRL+E+C :) at which point there's no excuse for sloppy code and the offender deserves a thorough booting!
Eagles may soar, but weasels don't get sucked into jet engines
-
While we're on the subject of code reviews, what do you guys think about sloppy code that's not formatted well? I tend to not think I'm that anal retentive, but I admit the poindexter comes out when I see sloppy code that's not kept up to a proper margin, not indented decently, old commented code left in, etc. Oddly enough, the coders that write messy code tend to also have messy cars and homes. It's gross.
Jeremy Falcon
I don't care overly much as long as it's readable and consistent. And doesn't contain that abomination systems Hungarian, from the Redundancy Department of Redundancy. That said, I prefer Allman style, but I'm not anal about it. And about messy people. I know a guy that owns a show car, and his cars and garage are in immaculate condition while his home is a complete dirty mess (unmarried). It's what you care about. I can imagine the same to be true for coders.
Wrong is evil and must be defeated. - Jeff Ello
-
"silly naming conventions" like absurd Hungarian notation? There are only two variable naming conventions I prefer - the first is putting a "p" in front of a pointer: int *pInt; I know that's simple, but to just have it so obvious makes it easier for me to understand. The second is adding lsbs to the variable name: "crankshaft_diameter_mm" but I'm losing my love for this. I do work in the embedded world, and all is wonderful as long as the next product version does not roll out. I'm dealing with this now - common code base, version one had 1mm lsb, next version is .1 mm. Sort of elephants the variable names.
Charlie Gilley Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
No I can deal with Hungarian notation as It was something that was considered good practice when I started with coding. An example of what I meant about silly naming convetions was..
private ClientPropertyForm m_RW_CPForm = null;
it took me a while to see that this was a supposed to be a read write instance of the client property form.
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
However awful my code might be, at least it's properly formatted... :-) I agree with you; it's the same when I interview a developer that turns up looking like a homeless person: if you can't be bothered to take care of yourself, why would I believe that you'd be any different with your attitude to coding?