4,861 reputation
22247
bio website
location
age
visits member for 4 years, 2 months
seen Sep 16 '13 at 22:05

no blog, no github yet.


Aug
16
comment How can programmers improve their UX skills?
Some people naturally care about simple UI; others could care less and do not want to waste their time.
Aug
16
comment How to migrate my thinking from C++ to C#
#1 is a hard one for me, would like to know the answer myself. #2 - could you give a simple C++ code example and explain why you need that? For #3 - use C# to generate other code. You can read a CSV or an XML or what have you file as an input and generate a C# or an SQL file. This can be more powerful than using functional macros.
Aug
16
comment How to figure out design pattern for this particular solution?
The stated design is synthetic and therefore is useless to me. I want to help, but I can only solve real problems. What is the actual and not hypothetical problem that you are trying to solve? Something that a customer is paying you to figure out or something you need for a real life hobby project - what is it?
Aug
7
comment Abstract class + Inheritance vs Interface
One thing that is really cool about interfaces is that methods can accept them as parameter types. I do not have a great example, but it is very powerful. You can accept an IEnumerable interface type for a parameter and not have to care about the particular implementation. You cannot achieve the same with a class hierarchy - you will end up dragging a much bigger view into an object (if you will) than you actually need.
Aug
5
comment Trying to understand the 2N lnN compares for quicksort
Part of the answer, copied from en.wikipedia.org/wiki/Quicksort "So, averaging over all possible splits and noting that the number of comparisons for the partition is n - 1, the average number of comparisons over all permutations of the input sequence can be estimated accurately by solving the recurrence relation:" For some reason we are off by 2 here - n-1 vs n+1.
Aug
5
comment Why is an anemic domain model considered bad in C#/OOP, but very important in F#/FP?
"Note: I'm specifically interested in the differences in C#/F# that could change the opinion of what is good/bad" - whose opinion? Note that you used the word "opinion". Do you suffer from being a conformist? Then stop. You are not obligated to write a bunch of oop code in order to use C#. You could use structs when all you need is data, but you must be careful with structs as they get copied by value, and other stuff. Sometimes all you need is a bunch of stateless functions. You have to create a class to encapsulate them, though not in VB.Net. This is just a restriction of the C# language.
Jun
13
comment Which design patterns would I use for this algorithm?
Design patterns are often overused, and in this case you definitely do not need one. Just split things into small functions, keep single responsibility principle in mind.
Jun
11
comment Inheritance using non-abstract base class
Perhaps this is a question that is data/statistics-based in nature? It would be cool if I could run some sort of oop complexity tool on a library and then have it propose an alternative design and run another type of complexity evaluation tool and then tell you the two scores? The UI widget class hierarchy does make a lot of sense. One should be able to prove so statistically somehow, with the help of algorithms that analyze ASTs. There are some other libraries that also use a lot of inheritance whereas they should not. I wish there was a tool that could measure just how bad things are.
May
28
comment How can degree of order in a list be measured?
Why do you ask for this? Are you trying to produce something random that also "looks random"? Be careful, fo randomness does not look random. I would not test an individual list to see if it is random enough. I would test the shuffling algorithm by examining thousands of outcomes.
May
15
comment Examples of general purpose algorithms that have benefited from running on a GPU?
String concatenation, sleep sort
May
9
comment When are chained assignments (i.e. a=b=c) bad form?
Having small functions, one could also throw an exception when something bad happens and have the caller decide whether the function should be called again or not - makes it easier to do a limited number of retries.
May
8
comment When are chained assignments (i.e. a=b=c) bad form?
Specifically in the context of Winforms - if you have just two buttons/controls, then write out two lines. If you have a bunch of them, then perhaps save the logical groups of them in a set, and then apply an attribute change to the whole set with aid of a helper function. Still, as Robert said, try to minimize state! Frankly, try to simplify the UI first. You can also logically separate controls by groupboxes, or give them a specific Tag, and then can change all controls in a given GroupBox with tag = "foo" to have .Enabled = someCondition. Speed will matter less than clarity.
May
8
comment When are chained assignments (i.e. a=b=c) bad form?
Related: stackoverflow.com/questions/5590392/…
May
1
comment Pairwise testing, not possible to say which combinations is faulty?
Do you think this is applicable to performance testing? If P(A, B, C) is my "performance function" - e.g. how much RAM / CPU it took to to execute a function with given parameters A, B and C, then would having this result help interpolate the answer for any possible combination of A, B and C?
Mar
19
comment How can I apply Six Sigma in a software development environment?
crosstalkonline.org/storage/issue-archives/2006/200604/…
Mar
19
comment How can I apply Six Sigma in a software development environment?
It's not that six sigma is great; it's that the manager who let his employees design circuits from scratch should have been fired.
Mar
19
comment How can I apply Six Sigma in a software development environment?
I had to take the first six sigma training and while my company paid for it, I wish I could get my time back. The instructor was clueless, the exercises were fun little games but ultimately pointless. Six sigma is about statistics and it is applicable to dumb, repetitive, well defined tasks, the kind of tasks that are often being outsourced to robots. Writing good software is a creative process. Six sigma helps good software engineers just as much as Calculus lectures would help Tom Cruise act. Just the fact that you asked this question disqualifies you from working with me or my colleagues.
Mar
15
comment Fast algorithm for finding common elements of two sorted lists
@Chewy Gumball, duh, thanks, changed to O(n).
Mar
14
comment Fast algorithm for finding common elements of two sorted lists
You can do it in O(n) without using hash tables, sets or any other data structures that are not simple arrays or linked lists. The fact that the lists are sorted helps you - inside of a while loop (not for loop) you would move a pointer to left list and a right list conditionally. The exact details can be somewhat messy, but because both lists are sorted, you only need to traverse each one once, going in one direction only. In fact, you do not need to be able to access them by index at all. The step is similar to a merge step of the merge sort algorithm.
Mar
4
comment What is the functional-programming alternative to an interface?
The answer would be language-dependent. In Clojure you can use clojure.org/protocols, where the only soft area is the types of parameters that the functions must operate on - they are an object - that is all you know.