443 reputation
29
bio website
location
age
visits member for 1 year, 8 months
seen 16 hours ago

Apr
11
comment Performance Difference between using ToList() vs. new List(IEnumerable<T>)
I would use ToList because it works on many different IEnumerable types. This allows you to change your test array to a different enumerable type if you so choose to in the future, leading to less fragile code. I also find the syntax of ToList more obvious than the constructor argument.
Apr
5
comment ASP.net performance code behind vs app_code
If it's an asp.net "web application" and not "web site" then you should see no difference, as asp.net web applications do not use dynamic compilation.
Mar
14
comment Understanding dependency injection
I agree with @Phoshi, when doing Dependency Injection you are moving the responsibility of the creation of the dependency to the most appropriate place. Say you have a form that save an Order, it is certainly not the form's submit handler's responsibility to know what the SQL database's password is. It's not even the form's responsibility to even know that the persistence is an SQL database. It allows your code to operate on the correct level of abstraction.
Mar
10
comment What sort of information can I extract out of a dll file?
you should be able to read the PE file format, which means any imports and exports the DLL has. However, a lot of viruses are packed / compressed to thwart anti-viruses, so their imports / exports are probably minimal.
Mar
6
comment Why is quality engineering difficult?
I think it is difficult because there's a near infinite amount of test-cases that could be created to test a system.
Mar
3
comment Web design pattern
Domain name is a web-server level construct, You could have both domain names pointing to the same application, and then within your application code, do Request.Url.Hostname (or whatever it is in php to get the hostname) to differentiate between the two.
Feb
24
comment Apple eating problem
Is the speed of eating based upon the number of apples (apples per minute), or by weight (grams per minute)? If it's apples per minute, sort the list by weight descending, and always eat the largest available. If it's done by weight, then the order in which you eat apples does not matter.
Feb
21
comment Why can't native machine code be easily decompiled?
@chuckj thanks for the suggestion
Jan
15
comment Learning the rules of chess
Could a human learn chess just from observing games? My thought is they would not learn all specific rules of the game. For example, how would a human learn that a pawn can not go backwards? Just because it never happens does not necessarily mean it's not possible to do so.
Jan
2
comment Win loss code that does not make 1-0 record better than someone like 20-3
Check out amix.dk/blog/post/19588 (Reddit ranking algorithm)
Dec
12
comment problem with High Cohesion - DRY principle across components
The design documentation should be your unit-tests. Refactoring should be a standard part of your development process.
Nov
22
comment Would adding an @beta doc-comment tag be useful?
It is ideal to have use-cases before you write code. If there's no use-case, then there's no point for that code to exist.
Nov
28
comment Keeping an enum and a table in sync
We make these assumptions all the time, if you think of a table definition, our program assumes the definition is as such when writing a query. The Status table should not be considered dynamic through the runtime of the application, and thus I don't think you should read it as such.
Nov
28
comment Keeping an enum and a table in sync
I don't see why you would change the ID value without changing its meaning. These sort of enumerations would not be auto-incremented, and these are really just for readability for people debugging the database, as typically your application will be making queries, and it would already know what the ID for pending would be. Of course having a Status table gives you referential integrity, but that's becides the point I'm trying to make.
Nov
28
comment Is it useful to unit test methods where the only logic is guards?
This is off topic, but I would change the logic to throw an exception if the part number is 0 or less, or if the part is not available, as in my opinion it would be a bug to allow someone to call that method with a bogus widget, silently masking another problem.
Sep
2
comment Dependency injection with n-tier Entity Framework solution
To be clear that I understand what you're saying: The repository (which the interface exists in business, and concrete exists in Alcatraz.Data.Access?) accepts a DbContext as a its dependency. The business classes have repositories as a dependency. For the dependency injection, I'm doing this manually (so I understand what's going on). The reason I want to be able to set the connection string on the DbContext is I use database sharding so in certain cases I need to have entity framework to connect to different databases (of the same structure). Do I understand you properly?
Sep
1
comment Dependency injection with n-tier Entity Framework solution
About point 2, one goal I was trying to make is to not have CRUD directly within the ui layer. What I mean is I want to make sure only CRUD can happen by going through the business layer, that way it is managed.
Aug
8
comment Return interface or class
IReadOnlyList sounds good when I can get VS2013, thanks!
Aug
8
comment Return interface or class
I guess this isn't really a hard rule then?