|
honey the codewitch wrote: He's an overachiever. He can't stand the thought of doing something he's not good at. A blessing and a curse.
I'm an underachiever, but the rest I can relate to.
|
|
|
|
|
Given the subject line for your post, I thought someone's dog/cat had posted here...
Software Zen: delete this;
|
|
|
|
|
i'm kind of cat-like
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I just saw someone wondering why their code to take a screenshot of the client machine wasn't running properly on the asp.net webserver.
he was snapping the desktop using winforms.
i can't. i just can't with this.
this isn't even a programming problem. It's a basic logic problem.
"It works fine on my local machine"
*headdesk*
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Welcome to the wonderful world of QA: "you ain't seen nuthin' yet".
|
|
|
|
|
I have though. It's why i have my silver streak.
My first thought was "he must be management that made a wrong turn somewhere"
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: he must be management that made a wrong turn somewhere Or he will be management in a few more years
|
|
|
|
|
don't scare me like that. you're almost certainly right though.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I feel your pain.
Every time I see single line if statements without braces I think about rage quitting myself
|
|
|
|
|
okay, that's fair.
but when i did try to use braces, i made a bug, which you caught. I lost my mojo.
Removed the braces and replaced them with a return and everything worked fine.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
string result = null;
if (something)
{
variable.GetString();
}
return result;
string result = null;
if (something) return variable.GetString();
return result;
string result = null;
if (something)
return variable.GetString();
return result;
string result = null;
if (something)
{
return variable.GetString();
}
return result;
string result = null;
if (something)
{
result = variable.GetString();
}
return result; As you see, you can either agree with me or be wrong
|
|
|
|
|
good luck trying that technique whilst writing a state machine.
sometimes you still need a goto.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I would like to see you programming a PLC in LAD or a PIC in Assembly without using JMP (a.k.a. goto)
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|
As many things in life... if used properly is not bad.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Actual code from one of my projects (there are entire files like this)
public static int GetDistance(this string x,string y){if(string.IsNullOrEmpty(x))return string.IsNullOrEmpty(y)?0:y.Length;else if(string.IsNullOrEmpty(y))return x.Length;int n=x.Length,m=y.Length;int[,]d=new int[n+1,m+1];if(0==m)return n;for(int i=0;i<=n;d[i,0]=i++);for(int j=0;j<=m;d[0,j]=j++);for(int i=1;i<=n;++i)for(int j=1;j<=m;++j)d[i,j]=Math.Min(Math.Min(d[i-1,j]+1,d[i,j-1]+1),d[i-1,j-1]+((y[j-1]==x[i-1])?0:1));return d[n,m];}
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Did you just minify C#?
I'd know this to be a joke if you were literally anybody except you, except you're you...
|
|
|
|
|
yes. yes i did.
would it have been better or worse if i told you i just write code that way?
It's part of my "let me substitute this source sharing system for Microsoft's lack of static linking in .NET"
if i had a reliable way to distribute these files as binary and link them into other .NET modules i wouldn't use this method, but ILMerge is dodgy last i checked, and last time i tried to make a tool using it it got flagged by my virus scanner.
These files aren't intended to be modified. They are generated from other files, which are merged into one big "code brick" with all source dependencies included so you can just drop it into your project - like a static linked library.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: would it have been better or worse if i told you i just write code that way? Neither, you'd just write according to my expectations
|
|
|
|
|
When you get to be as old as I am, brackets and whitespace just aren't important anymore.
Now get offa my lawn!
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: When you get to be as old as I am, brackets and whitespace just aren't important anymore.
You young'un. Must be a cyclical thing, 'cuz I need them now more than ever.
|
|
|
|
|
perhaps.
Honestly though, I used to be a stickler about coding style when i worked in shops.
And as I was usually lead I was the one who enforced them.
Maybe that's why I am so fast and loose these days. It's kind of liberating to be able to make stuff for (mainly) me and code it my way i guess.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
You should swap that code for Damerau-Levenshtein distance, which also handles transpositions.
I can send you the code if you'd like. I'll even minify it for you if it's to hard to read.
|
|
|
|