5,294 reputation
11025
bio website
location Pretoria, South Africa
age 34
visits member for 3 years, 3 months
seen Dec 22 at 9:04

I am a software developer during the day and hobbyist developer during the night (when time permits). Interested in all aspects of software development, although experienced mainly in the MS environment and languages.

C#, SQL Server, ASP.Net / MVC3, WinForms / WPF, WCF, Object Orientation, Code Generation, CSLA and other business frameworks.


Dec
4
comment Best OOP Practice in C#: Passing the object as parameter VS creating a new instance of the object
I'm not sure I agree with the premise: ... is essentially a Copy Constructor. Objects are passed by reference* in C# (which this seems to be, although I guess it could be something else). This code could be as simple example of DI, where does the copy constructor come in, am I missing something? * To be clear, the reference itself is passed by value, but the object referred to is not copied.
Oct
31
comment What is the actual reason that locks (sentinels) in OO are hard to reason about?
+1 especially for your 3rd point, which I believe is particularly true. There also tends to be a push to keep locks as fine-grained as possible (speaking generally) for performance reasons - very granular locks would prohibit concurrency.
Oct
27
comment Algorithm for a UI showing X percentage sliders whose linked values always total 100%
I understand... my issue is just that expressing something like a 60 / 30 / 10 split will require more than 3 actions, because when fiddling with the 30 / 10 part, the 60 keeps moving around. It gets progressively worse with larger lists, and is only really suitable for extremely vague input, since you will never get it to the number you have in your head.
Oct
27
comment Algorithm for a UI showing X percentage sliders whose linked values always total 100%
One suggestion would be to allow the user to switch between two modes, essentially one where the sliders are linked to each other, and one where they are not (and switching back to "relative mode" would re-normalise the distribution). This would allow side-stepping some of the issues you mention, but add so much complexity to the UI that it might just be easier to get the user to type the values in.
Oct
27
comment Algorithm for a UI showing X percentage sliders whose linked values always total 100%
Similar questions have been asked over on the UX site, although IMHO they have not been answered in a particularly satisfying way. I'm curious to see if there are any good solutions. Although to be honest, I find that having the sliders linked to each other causes more trouble than it's worth even for the user - it becomes difficult to end up with the distribution you'd like, since you keep altering your already entered values as you go.
Oct
17
awarded  Revival
Oct
15
revised Using ng-init to initialize data in Angular controller
Mostly formatting, summary
Oct
15
answered Using ng-init to initialize data in Angular controller
Sep
24
awarded  Autobiographer
Sep
13
awarded  Yearling
Aug
15
answered How to get a database on my filesystem that I can use in my application
Jun
20
comment What is the ideal length of a method?
@Calmarius agreed, but both of those statements are an argument against 6000 LOC functions.
Jun
20
comment What is the ideal length of a method?
@Calmarius the difference is usually that 6000 line functions tend to contain local variables which were declared very far away (visually), making it difficult for the programmer to build up the mental context required to have high confidence about the code. Can you be sure about how a variable is initialised and built up at any given point? Are you sure nothing is going to mess with your variable after you've set it on line 3879? On the other hand, with 15 line methods, you can be sure.
May
27
comment Is backing up a MySQL database in Git a good idea?
@AlbertoSolano I see; but reading the question ("can I backup my DB in in GIT?") and then your first statement ("it's fine to store the backup file..."), it seems like you're saying the opposite. The rest of the answer seems to be saying that it's neither here nor there, while I suspect most people think it's a train-wreck waiting to happen.
May
26
comment Is backing up a MySQL database in Git a good idea?
Not the downvoter, but I think this approach introduces an ever present merge conflict which is not particularly conducive to the branch-often, merge-often workflow that most git users prefer.
May
26
comment Is backing up a MySQL database in Git a good idea?
By "can't diff it", I mean "meaningfully".
May
26
comment Is backing up a MySQL database in Git a good idea?
@wobbily_col A non-text, binary based format has limited value in the context of source control. You can't diff it, you can't branch / merge it, etc. So, while you certainly CAN use git to store the DB, most people prefer to script the DB structure as well as the necessary data. It's a compromise between having a bit more work, but providing the above list of features. You'll have to weigh up whether or not this is a good idea for your solution. Otherwise, you can probably get GIT to store the DB directly, it's just not exactly the best fit for the task.
May
21
comment Why encapsulate container variables?
@ElectricCoffee a good rule of thumb is to always use them, unless you're sure you won't ever need them in the future (which should be rare), AND there's a critical performance requirement (which is rare in many environments). Software engineering considerations generally trump (premature?) optimisation, until proven otherwise.
May
16
comment Benefits of Java in education?
@Jasper I think it's important to understand that everyone's definition of "pretty" will vary depending on a variety of things (personal history, level of proficiency, types of projects attempted). Without keeping that in mind, I doubt you'll be satisfied with any answer. As a sidenote, I'm slightly curious how it is that you were happy with both Pascal as well as Python, since they are nothing alike (IMHO).
May
5
comment How to determine what throws an exception
@Mark unfortunately, since .Net doesn't really have a "throws" declaration which would formalise the exception contracts, we're left with searching source code / extracting the information you'd like. Kirie's answer is a good start, you could also just download the source and grep it yourself. Having said this, an exception like "NotSupportedException" is extremely broad by its nature, so you're unlikely to get narrow, specific pointers. It literally just says "you did something illegal that we couldn't express via the type system itself". So basically, almost anything.