6,627 reputation
1641
bio website
location Los Angeles, CA
age
visits member for 4 years, 4 months
seen yesterday

There are only 10 kinds of programmers.

The CSPs (*) and the non-CSPs.

CSP: communicating software programmers


Apr
27
comment Which code is better for branch prediction optimization?
@RobertHarvey: It is premature micro-optimization, except in cases where both conditions are met: (1) the loop is called billions (not millions) of times; and (2) ironically, when the loop body is tiny in terms of machine code. Condition #2 means that the fraction of time spent on overhead is not insignificant compared to time spent on useful work. The good news is that usually, in such situations where both conditions are met, SIMD (vectorization), which is by nature branchless, will solve all the performance issues.
Apr
18
comment Storing a re-orderable list in a database
Can you do a bit of benchmarking and tell us whether IO or Database will be a bottleneck?
Apr
18
revised Storing a re-orderable list in a database
added 214 characters in body
Apr
18
answered Storing a re-orderable list in a database
Apr
16
comment Is it OK to have a method return different types based on a parameter?
If your language supports structs or tuples, it can be used by the function to return any combinations of partial results. stackoverflow.com/questions/3861353/structs-data-type-in-php
Apr
6
comment Separation of Concerns While Creating a Generic Concept of a “Cart Item”
Option #2 is a "factory method" pattern. There is another pattern called "abstract factory", which is one step beyond it, and may solve your problem. Basically, Option #3 is simply shoveling the abstract factory's responsibility onto some existing classes called WidgetController and GizmoController; however, it is possible to decouple the abstract factory from them.
Apr
4
comment Computing integration with the Trapezoidal Rule
The OP might hope to be able to demonstrate the main usefulness of this algorithm for functions that do not have closed form. However, due to the limitation of the chosen input method (interactive console input/output), and the lack of symbolic functions handling (which is outside the scope of OP's original plan), means that the function's evaluations had to be entered point-by-point, which defeats the demonstration of the algorithm's main usefulness.
Apr
3
revised How do you keep consistent self confidence while coding?
added 33 characters in body
Apr
3
comment How do you keep consistent self confidence while coding?
Every rule in The Joel Test serve to improve developer confidence and efficiency. Frankly I have nothing to add on top of it.
Apr
3
answered How do you keep consistent self confidence while coding?
Apr
3
comment Communication between a C# application and C++ DLL
If they live in different OS processes, named pipe is indeed a suitable choice.
Mar
29
revised Should methods always be closed for modification?
added 563 characters in body
Mar
29
answered Should methods always be closed for modification?
Mar
24
answered Dataflow Diagrams - are they used in the real world?
Mar
23
comment C++ why & how are virtual functions slower?
Even a person who can read the assembly code cannot accurately predict its overhead in actual CPU execution. Desktop-based CPU makers have invested in decades of research in not only branch prediction, but also value prediction and speculative execution for the primary reason of masking the latency of virtual functions. Why? Because desktop OSes and software uses them a lot. (I wouldn't say the same about mobile CPUs.)
Mar
20
comment What problems can be solved using Generics?
Can you clarify which of your question is the main question? (1) "What problems can be solved using Generics?" (2) "Are there any code smells or patterns that I should be looking out for?" (On Stackexchange, asking two questions at once makes it more difficult to choose the correct answers.)
Mar
20
comment How often is Inheritance used?
What you're making use of are the customization points of pre-built OOP framework objects. It is an everyday aspect of OOP usage, but OOP is capable of much more than that.
Mar
20
comment What's the next level of abstraction?
How about hardware description languages? It can be used to declare non-von Neumann hardware that can be realized on FPGA. There is also symbolic computation, which is specialized for computer algebra systems. (Perhaps those are not general-purpose abstractions.)
Mar
18
answered What changes are too big to be made easy by proper design?
Mar
2
comment What makes a series of machine instructions an actual process/thread in memory?
The distinction appears as soon as two or more contexts exist in the system, and the kernel provides a way to switch between the contexts.