Reputation
581
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 9
Newest
 Commentator
Impact
~25k people reached

  • 0 posts edited
  • 0 helpful flags
  • 29 votes cast
Jan
12
comment Isn't the use of NoSQL Databases impractical in a large number of use cases?
"...since they usually live outside the table, you don't need to change your table schemas to support them." That's the same situation between a non-clustered index in an SQL database and an index for a noSQL database, right?
Oct
13
comment What's the difference between fault, error and defect?
I meant software defects (something wrong in source code). Faults include software defects, hardware malfunctions, misconfigurations. Hardware malfunctions can result from design issues, manufacturing issues, lack of maintenance, power fluctuations, ESD, interference, impact damage and so on. Design issues may include firmware defects which are just software defects on another level, but you might not know that when you trace a system failure to a hardware malfunction. It's quite common that a system failure involves a cascade of various faults, triggered by one of them or by external input.
Oct
13
comment What's the difference between fault, error and defect?
Defect is a special case of a fault. Other common fault types include hardware malfunction and misconfiguration.
Oct
4
comment Is it a must for every programmer to learn regular expressions?
@Andrea - There is also a huge difference between "mathematician's REs" and "programmer's RE's". A mathematician can prove that palindromes do not form a regular language. A programmer can write a RE to match them.
Jun
30
comment How do I design a subclass whose method contradicts its superclass?
@Mehrdad - In the specific case we are looking at, the question mark isn't part of the method signature. It's not documentation either. It's not a part of a separate contract formalism. It's just a naming convention. However, that's as much of a contract as you can find in the original post. I don't want to get to the mud of discussing the difference between structured code documentation and ad hoc code comments when there's not a single comment in the original post.
Jun
30
comment How do I design a subclass whose method contradicts its superclass?
@KevinKrumwiede - This answer is explaining this in more detail, and more importantly, showing why it's often clearer to keep classes intended for derivation separate from classes intended for instantiation. However, contracts are more than just signatures and documentation and it is sometimes difficult to establish what they are in real, underdocumented software coded by someone who didn't believe in its reuse.
Aug
10
comment Why is the use of abstractions (such as LINQ) so taboo?
@MatthewPatrickCashatt - Performance drop is simply a kind of an abstraction leak. It's an extra prolific case because standards generally leave detailed performance levels undefined and it is not always clear what is the "correct" way of coding or compiling a construct performance wise. Example? Compare a performance of a prepend-loop and append-loop with a StringBuilder in .NET 2. No difference. Compare the same code in .NET 4.0. Drammatic difference that you could not reasonably have expected as it is an implementation detail of the abstraction.
Aug
2
comment Return magic value, throw exception or return false on failure?
@Virtlink - As per my answer. If the method body is just a few cycles, I'd probably choose TryXxx if I could not return a null or a natural magic value. If it's heavy-weight, I am using exceptions all the time, and I LOVE the unhandled stacktraces that I occasionally see in defect reports compared to corrupt heap or swallowed negative numbers in some other code. Mind you, this is just one team's preference. Find yours.
Aug
2
comment Return magic value, throw exception or return false on failure?
@Virtlink - Agreed on thread safety in general, but given that you referred to .NET 4 in particular, use ConcurrentDictionary for multi-threaded access and Dictionary for single threaded access for optimal performance. That is, not using ``Contains` does NOT make the code thread safe with this particular Dictionary class.
Aug
2
comment Return magic value, throw exception or return false on failure?
@gbjbaanb - Experimented finished. I was lazy and used mono on Linux. Exceptions gave me ~563000 throws in 3 seconds. Returns gave me ~10900000 returns in 3 seconds. That's 1:20, not even 1:200. I still recommend thinking 1:100+ for any more realistic code. (out param variant, as I had predicted, had negligible costs - I actually suspect that the jitter probably had optimized the call away completely in my minimalistic example if there was no exception thrown, regardless of the signature.)
Aug
2
comment Return magic value, throw exception or return false on failure?
@gbjbaanb - Well, maybe. That article uses a 1% failure rate to discuss the topic which isn't an entirely different ballpark. My own thoughts and vaguely remembered measurements would be from the context of table-implemented C++ (see Section 5.4.1.2 of this report, where one problem is that the first exception of its kind is likely to start with a page fault (drastic and variable but amortized one time overhead). But I'll do and post an experiment with .NET 4 and possibly tweak this ballpark value. I already stress the variance.