Reputation
29,405
Next tag badge:
97/100 score
21/20 answers
Badges
3 59 106
Newest
 Enlightened
Impact
~1.1m people reached

Mar
28
comment What are the advantages of strictly maintaining separate data | algorithm | interface layers?
and its used as an architectural system in languages that do not have OO, such as C. There, you'd have a POD that is passed to a function that implements an algorithm (note: with no access restrictions). So it sounds like you might have a this style implemented in OO language constructs.
Mar
28
comment How to distribute, one virtual token to each person in this world, and make sure nobody gets more than one?
@jmoreno yeah well, those kids with their wierdo, communist upbringing.. we never wanted them in our society anyway. They'll probably grow up to be terrorists too. That said - nobody should be forcibly tattooed.. its so last decade. Implanted rfid chips automatically linked to their facebook account (made for them by Facebook corporation at birth, of course) is the only way for today.
Mar
28
answered Dynamic git URL for Jenkins builds
Mar
28
comment Should static data be stored in a database or somewhere else?
@PieterB hehe, I think you made an assumption that the OP didn't know what he was asking. For all I know, when he says "the data will never change", he really means "the data will never change". Sometimes I'm as guilty as everyone else here assuming the questioner didn't get their question right and giving the answer I want them to have too :)
Mar
27
comment Should static data be stored in a database or somewhere else?
@PieterB it was just an example off the top of my head. Would 'number of days in a week' be a less nit-pickable example for you?
Mar
27
comment Should static data be stored in a database or somewhere else?
@CurlyPaul bung them in code, if they change you'll probably have to update the code too anyway. Only put them in a sqlite/xml db if it makes your coding/testing easier.
Mar
27
answered Should static data be stored in a database or somewhere else?
Mar
25
awarded  Quorum
Mar
25
comment Reason for (post/pre) increment operator in Java or C#
the person who complained about rounding was probably an accountant! Always round towards 0, then they get to keep the difference :) There are 4 different ways to round an integer - so the problem was really one of not understanding the requirements your users expected. Incidentally your 1.5=>2, -1.5=>-1 rounding is defined by the US Meteorology office in 1966.
Mar
24
answered Reason for (post/pre) increment operator in Java or C#
Mar
24
comment Why are header files bad design?
fair enough, though at times I wish for a header file - when I see a C# partial class spread over many files with some extension methods added in for good measure. IIRC the C++ committee want to get rid of headers, but I guess they'll have to mandate changes to compilers to emit a binary standard.. which would be a good thing in itself, especially as it means you wouldn't be locked into a proprietary editor and/or compiler.
Mar
24
comment Why are header files bad design?
@Zeroth oh well, you just made the case against Interfaces, and WSDLs, and IDLs :( I think you might be taking the DRY principle a little too far.
Mar
24
comment Why are header files bad design?
basically your post is "headers are bad because someone types them out, and they're good if generated automatically by the compiler". In no place do you make the case for or against header files themselves :)
Mar
24
comment Are header files actually good?
@Petter I think you misunderstand, conceptually they are no different - a header exists to provide an interface in the C language, and though you are right - you can combine the 2 (as many do with header-only C code) its not a best practice that I've seen followed in many places. All C# devs I've seen split the interface away from the class, for example. Its a good practice to do this as then you can include the interface file in multiple other files without pollution. Now, if you think that this split is a best practice (it is) then the way to achieve it in C is by using header files.
Mar
20
comment why no native compiler of C# or other “productive” language?
are you saying that C# will happily generate code for an infinite recursion of types based on a parameter. I believe C++ will refuse to compile a self-referential template. C# should not either as you would easily end up in a neverending code-generating loop (not to mention the WTF-ness of such code)
Mar
19
comment why no native compiler of C# or other “productive” language?
C++ happily does such things - check out the stl for examples of deeply nested container types. Even in these cases, the code is still only generated when referenced.
Mar
19
comment why no native compiler of C# or other “productive” language?
@RobertHarvey someone who has a JIT compiler that performs all the optimisations an offline compiler does. Which is nobody, as no JIT compilers perform those heavy optimisations.
Mar
19
comment why no native compiler of C# or other “productive” language?
templating in C++ will generate only the functions that are actually used (and infinite number is wrong - you're limited to the number of types in the language/your code, so you'd have to create an infinite number of them to cause this problem....) C# could generate the same code as C++ before runtime if it wished. Incidentally C# creates generics the same way C++ creates them, only it does it at runtime rather than compile time. So theoretically, C# could barf on an infinite number of functions too
Mar
19
comment Asterisks in Multi-line comments
I think its for readability - as the comment text will be automatically lined up without the need for several spaces or a tab, as some sloppy programmers are wont to do. FYI, Visual Studio does not do it for C++ comment blocks.
Mar
19
comment Processing csv files (alternative to business logic in DB)
@DocBrown oh yes, sprocs aren't magic, but if you write a SP then it is contained in the DB and not spread over a load of files spaghetti-like. That's really what I meant. Also, if you've designed a system that uses them, you can mock them out in the business logic easier than if you have SQL embedded into your code.