Reputation
14,650
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
5 41 61
Newest
 Good Answer
Impact
~327k people reached

Aug
17
comment the right way to generate my Django model/db_table
If you are making a simple app from scratch, define your models and have django deal with it for you. That's one of the primary reasons to be using django in the first place.
Aug
17
comment the right way to generate my Django model/db_table
Why are you reimplementing a database on top of an existing database?
Aug
13
comment Do mocks violate the Open/Closed principle?
"In other words, a test should fail if the method doesn't work, but not because the implementation changed", this is not always true. There are plenty of circumstances where you should change both your implementation and your tests.
Aug
10
comment Null values handling in big scale applications
letting the runtime throw an exception doesn't mean you can't catch it. But a null reference exception is one of those things that's almost always an unexpected error, which is not going to be something the user will be able to do anything about. Furthurmore, since a null reference is an invalid situation the overwhelming majority of the time, all the time spent putting in useless redundant messages is time you can't spend doing things that are actually useful.
Aug
10
comment Null values handling in big scale applications
If null is not valid, then don't even bother checking for it, and let the NullReferenceException happen on its own. Otherwise you'll have tons of code throwing that which the runtime will do for you anyway.
Aug
10
comment Does function pointer have the same expressive power as function as parameter?
Essentially, you just have a lot less input from the compiler making sure you're passing the right thing to the right place.
Aug
7
comment How to scale a C# server application
For what benefit? There are other much more useful skills to have before addressing a vague concept of 'scaling'.
Aug
6
comment Are data type declarators like “int” and “char” stored in RAM when a C program executes?
@user16307: the answer is "it's complicated". I think you should try writing some assembly programs, as that will really teach you how the computer, as a machine, actually does things.
Aug
6
comment Are data type declarators like “int” and “char” stored in RAM when a C program executes?
@CharlesE.Grant: exactly. See what happens if you have a printf() call but mix the data types with your format specifiers.
Aug
6
comment Are data type declarators like “int” and “char” stored in RAM when a C program executes?
@user16307: dont think about stuff regarding exe files, that will just confuse you more. You need to walk before you run.
Aug
6
comment Are data type declarators like “int” and “char” stored in RAM when a C program executes?
@JörgWMittag: indeed. I thought about mentioning a buffer overflow as an example but decided it would just make things more confusing.
Aug
6
comment Are data type declarators like “int” and “char” stored in RAM when a C program executes?
@user16307: The code in the program will tell the computer to fetch that address then to display it according to whatever encoding is being used. Whether that data in the memory location is an ASCII character or complete garbage, the computer is not concerned about. Something else was responsible for setting up that memory address to have the expected values in it. I think it might benefit you to try some assembly programming.
Aug
5
answered Are data type declarators like “int” and “char” stored in RAM when a C program executes?
Jul
31
comment Understanding factories
Use factories when you are unable to know at compile-time what Type you need. Otherwise, just use new.
Jul
30
comment What exactly is copyrighted, the text of the code itself, or the design?
@gnasher729: That's how it's supposed to be. Reality, with the multitude of issued patents on time travel and perpetual motion devices, says otherwise.
Jul
27
comment What would be a reason not to embed JS in C?
I'd say a large amount of possibly not-needed complexity is definitely a reason not to do something.
Jul
22
reviewed Approve Handling if-statements with a known duration
Jul
22
comment Handling if-statements with a known duration
What makes you think this is automatically more performant than just passing over the if statement a few times. Have you tested this to determine that it actually is? Do you iterate often enough to matter even if it does? Does shaving a few microseconds off your execution even matter? I'm guessing the answer to all of those is 'no'.
Jul
14
comment One table for all transaction VS. Table for each user
@Ixrec: only for some X
Jul
12
comment The Critical Functionality of an API has changed, what should I do?
That's actually a terrible way to deal with stress.