1,874 reputation
11924
bio website
location
age
visits member for 4 years, 3 months
seen Aug 11 at 22:29

Oct
26
comment Biggest mistake you've ever made
@Dean: It wasn't the biggest mistake I've ever made... I was just clarifying the difference in behavior here with C# vs Java
Oct
26
comment Biggest mistake you've ever made
This is much more of a problem in Java, where == is a reference comparison. In C#, == does a value comparison on strings, same as .Equals() That said, there are some differences, see Jon Skeet's answer here: stackoverflow.com/questions/3678792/…
Oct
25
comment What would you change about C# if you could?
Reading Eric Lippert's blog post linked above, iterator blocks are implemented in a way that assumes iterators can't be contained in anonymous methods. Eric specifically says that if they did away with this restriction they'd have to write a new pass that handles nested iterators and anonymous methods simultaneously. So it doesn't seem the two algorithms they currently use can "trivially work in serial" as you suggest.
Oct
21
comment Are null references really a bad thing?
[cont.] As I understand, Java performs a similar analysis. As for why, for starters you might want to have a look at this wikipedia article and links therein: en.wikipedia.org/wiki/Definite_assignment
Oct
21
comment Are null references really a bad thing?
@Geek: In C#, fields (that is, data members of class objects) are automatically initialized to their default value when the object instance is constructed. For references, the default value is null. However, local variables in class methods are not automatically initialized. Customer c where c is a local variable is not equivalent to Customer c = null. Instead, the compiler attempts to determine whether the code will definitely assign a value to the variable before the variable's value is read, and if not, it gives an error.
Oct
20
comment When do you know it's time to move on from your current job?
Most of these seem like the extreme case. That is, I'd definitely look for something else if I had a job like this, but even if none of these are met, it might be time to move on if you just feel like you aren't learning as much as you could, or you'd me more interested in something else, or you aren't being paid what you feel you're worth or whatever. I guess what I'm saying is it's OK to look for something better even if your job isn't hell. The big question is "Is it providing me with more happiness than misery?"
Oct
19
comment Maintainability of Boolean logic - Is nesting if statements needed?
Agreed. Why on earth would I care if my code will run the same when copied into another language?
Oct
19
comment Do you write bad code when under pressure?
I believe this is the Joel On Software post you had in mind: joelonsoftware.com/items/2009/09/23.html "A 50%-good solution that people actually have solves more problems and survives longer than a 99% solution that nobody has because it’s in your lab where you’re endlessly polishing the damn thing. Shipping is a feature. A really important feature. Your product must have it."
Oct
19
comment Are null references really a bad thing?
+1 for the Option pattern article. I wasn't familiar with option types before this thread. It seems using option types and pattern matching has some of the same benefits I liked in Note to self's answer.
Oct
19
awarded  Good Answer
Oct
19
awarded  Mortarboard
Oct
19
awarded  Nice Answer
Oct
19
comment Why should we use low level languages if a high level one like python can do almost everything?
Obligatory Joel on Software link: joelonsoftware.com/articles/fog0000000069.html
Oct
19
awarded  Nice Question
Oct
18
answered Make a big deal out of == true?
Oct
18
comment Are null references really a bad thing?
I included "arguably" for the people who will say "It makes perfect sense, it's just NaN!" :)
Oct
18
comment Are null references really a bad thing?
But surely lots of common programming constructs allow for nonsensical code, no? Division by zero is (arguably) nonsensical, but we still allow division, and hope the programmer remembers to check that the divisor is non-zero (or handle the exception).
Oct
18
comment Are null references really a bad thing?
It might be helpful if you included an example where it takes a lot more effort to deal with nulls. In my admittedly over-simplified example the effort is about the same either way. I'm not disagreeing with you, I just find specific (pseudo)code examples paint a clearer picture than general statements.
Oct
18
comment Are null references really a bad thing?
Wow, that's pretty cool. In addition to catching a lot more errors at compile time, it spares me from having to check the documentation to figure out whether GetByLastName returns null if not found (as opposed to throwing an exception) -- I can just see if it returns Customer? or Customer.
Oct
18
comment Are null references really a bad thing?
At least in the languages I've worked with (for instance, C#) there's a difference between an uninitialized variable and one which is initialized to null. null is a special value that indicates that the variable doesn't reference any object. You certainly use programming logic like c != null in my example.