Reputation
2,731
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
2 8 19
Newest
 Enthusiast
Impact
~81k people reached

Aug
27
comment What optimizations can be done for soft real-time code in C#?
In my experience object pools are useful for recycling large arrays (such as buffers). For small objects the runtime tends to do well without manual pooling.
Aug
27
comment What optimizations can be done for soft real-time code in C#?
1) Did you actually notice problems? Thanks the to background GC, your threads should only stop briefly for certain parts of the GC, but many other parts can run in parallel without interference. 2) How many milliseconds are we talking about here?
Aug
26
comment Are there any downsides to replacing js confirm boxes with “mark record as deleted”?
1) Both a flag and moving it are forms of soft deletion, since the data is still available. A flag is the conventional implementation. 2) I'm talking about reusing a value on a field which has a unique index (usually not the primary index) once the record occupying it has been deleted.
Aug
26
comment Are there any downsides to replacing js confirm boxes with “mark record as deleted”?
A unique index is the biggest pitfall with softdelete I encountered so far.
Aug
26
comment Are there any downsides to replacing js confirm boxes with “mark record as deleted”?
I'd update the application to use soft delete even if you decide to keep the question.
Aug
21
comment Passing functions into other functions as parameters, bad practice?
@ZevSpitz I know, I have a pretty functional programming style. But the OP's example of passing callbacks to a function which run on completion of an asynchronous operation is one that I wouldn't use in .net since Tasks are nicer to use.
Aug
20
comment Why does Linq to Entity Sum return null when the result set is empty?
I wonder if it's a bug in the specification (also known as broken-by-design), or if that was just a bug in the code (i.e. this wasn't designed at all).
Aug
20
comment Passing functions into other functions as parameters, bad practice?
The main reason for avoiding callbacks is that your language or library already supports a better alternative. For example in .net there is the Task class which you'd return from the asynchronous method.
Aug
18
comment When is type testing OK?
1) If the type you're checking for is an interface 2) If there is a limited amount of subtypes.
Aug
18
comment In the days of modern computing, in 'typical business apps' - why does performance matter?
Another example: If processing one element takes 30 CPU cycles or 10ns (which is quite cheap), the algorithm will already take a full second if you only have 10000 elements. 10000 elements isn't much in many contexts.
Aug
15
comment There's a most performant way to check that a collection has exactly 1 element?
The third one is horrible: 1) It doesn't work if the sequence returns null elements 2) It enumerates the sequence twice
Aug
15
comment There's a most performant way to check that a collection has exactly 1 element?
Your second solution doesn't dispose the enumerator. Add a using block.
Aug
15
comment Difference between reverse lookup tables and rainbow tables
Rainbow tables are a specific lookup table compression technique so the size of the table is not linear in the number of passwords.
Aug
14
comment Why were magic methods implemented in C#?
@svick foreach(T x in sequence) applies explicit casts to T on the elements of the sequence. So if sequence is a plain IEnumerable and T is a value type it will unbox without any explicit cast being written in your code. One of the uglier parts of C#.
Aug
14
comment Calculate Pi to N number of places
You can take a look at Mini-Pi. Same author as y-cruncher, but simpler and slower.
Aug
6
comment Non Existent Keys Returning Null Instead of Exception
@EliasVanOotegem I did not recommend ignoring those notices. I only explained why the original coder might not have noticed or cared about those messages.
Aug
5
comment Omitting “destructors” in C is taking YAGNI too far?
Note that this doesn't apply if the only time you do allocations is during startup, which is a pattern I'd seriously consider in memory constraint devices.
Aug
5
comment Non Existent Keys Returning Null Instead of Exception
Accessing a non existent key returns a value (null, undefined or something like it, forgot the details) and continues execution. The message you're seeing is only a notice, you can hide them by changing the warning level to exclude notices in your configuration.
Jul
7
revised Is it okay if we use an arbitrary string as UUID?
deleted 4 characters in body; edited title
Jul
6
answered Alias variable vs multiple use of getter