|
I can't believe you missed the "u" in "Misdemeanours". From what I know, Brits love "their" grammar.
My additions:
Misdemeanours:
n) Unnecessary async wrappers for synchronous methods
n+1) Abusing var (for C#)
n+2) Under-usage of sealed (for C#)
Crimes:
n) Spawning unnecessary threads
n+1) Using dynamic for "predictable" types (for C#)
n+2) Making everything "public" with no thoughts whatsoever
I ain't got no signature.
|
|
|
|
|
I can think of lots, but most has been covered.
Here's two crimes that make me cringe:
- Bad comments (which is most), like commenting the obvious, wrong comments, comments with bad spelling and/or grammar, etc.
- Christmas tree coding. if (...) { if (...) { if { ... } else if { ... } } else if { ... } } } Something like that (add a few layers, format it nicely and it'll start to look like a Christmas tree).
- Just usage of a lot of if's in general.
|
|
|
|
|
I often get accused of commenting the obvious but I was taught to, and still do for complex algorithms/methods write what I want to do in terms of words as a comment (my intended function).
Then I write the code underneath. The comments were there before the code, so it'd take me more time to delete them.
Sorry - if you find it hard to just scroll past that stuff...
|
|
|
|
|
What people forget is that each comment is a line of code that has to be as carefully written as everything else and that if the code changes so should the comments.
In the end, if there's lots of bad comments, people learn to ignore comments and miss the actual good comments!
I've actually written a tip about it, Write comments that matter[^], because I see so many comments that add absolutely nothing to the code.
I haven't seen your code, so I don't know if you do any of the stuff I describe in the tip, but if you do I ask you, for the sake of programmers everywhere, please reconsider this bad habit of yours!
|
|
|
|
|
Unsorted pick lists and dropdowns. This kind of thing is easy enough for even a blank slate intern to get right.
Do what thou wilt shall be the whole of the Law. - Liber AL vel Legis 1:40, Aleister Crowley
|
|
|
|
|
DropDowns with more than a dozen items or only two items. DropDowns for numbers. Three DropDowns instead of a single DateTimePicker.
|
|
|
|
|
incorrect indentation combined with single statement control flow (no braces)
Java/C/C#/C++
if (condition)
originalSingleStatementForIf;
futureStatementThatNeedsToExecuteInAddtionTo_originalSingleStatementForIf;
FIX: Always use braces!
if (condition) {
originalSingleStatementForIf;
futureStatementThatNeedsToExecuteInAddtionTo_originalSingleStatementForIf;
}
|
|
|
|
|
Regarding A, I hate to say that sometimes you are left with no choice. It is part of the unavoidable friction that ensues when someone would not listen to reasons, not even in front of overwhelming evidence.
|
|
|
|
|
0) Using camelCase when not using Hungarian.
1) Using Hungarian.
|
|
|
|
|
Some crimes I've seen in the last few years:
A) Introducing dependencies without checking to see if they're reliable.
B) Introducing dependencies that are just a C# wrapper around a REST API.
C) Deciding that automating builds/deployments isn't worth the time.
D) Manually deploying changes to production without committing them to source control (after which of course you go on leave).
F) Being a lead developer and insisting that all columns in a database be nullable.
G) Giving full sa/admin/root permissions to someone/something because you don't know what permissions it actually needs - have to confess I've been guilty of this in the past.
H) Using {PopularFramework}.js because it's popular
I can't seem to think of any misdemeanours though.
|
|
|
|
|
On C) I detest fully automated Build/Deploy.
Build to Dev (automatic on commit).
Deploy to Test as a non-automatic function (ie, someone has to press the button).
Deploy from Test to Live ditto.
Whoever pressed the button has to respond to the user calls when it crashes.
|
|
|
|
|
On F):
I really don't like nullable columns. In the last couple years I have set every single column (except date columns) to NOT NULL - but always with a default value (0 for numbers, '' for strings, 0 for bit etc).
I thought maybe the Default thing would slow the DB down. Nope (MS-SQL Server 2012).
I figured I would discover some logic errors just as bad as Null errors. Nope.
All good
|
|
|
|
|
I totally forgot to announce a Rulechange!
We apply Mastermindrules since some ppl (including me) were sometimes so desperate they were cheating a little. To cope with that we changed the rules.
You can read the rules by following my Sig
Thanks
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
In addition to posting the solution (1.1), it needs to be flagged in the subject.
|
|
|
|
|
Why?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
No, because that is asking for an indication of when it's solved, not "it's a bit right"
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
No. 1.1 is under "Game Over" in his rules. When the game is over, the solution is posted and the thread needs to be identified.
|
|
|
|
|
I see!
I see, I see, I see - we are talking at cross purposes.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Which is why I identified the bullet in question. Twice.
|
|
|
|
|
So should i do that?
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
Sure. It would be nice to know which thread has the winning answer.
|
|
|
|
|
I guess Rule no. 1.1.1 should do the trick eh ?
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
|
No that would destroy the pun fun
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|