Reputation
35,413
Next tag badge:
96/100 score
28/20 answers
Badges
5 72 130
Newest
 Nice Answer
Impact
~1.4m people reached

Feb
4
comment Code size overhead by including unnecessarily extra header files
@LightnessRacesinOrbit Your comment says it well. Maybe a new question needs to be raised: "If a colleague puts a static instance of a class in a publicly visible header file, should we remove his C++ credentials and put him in the VB team?" :-)
Feb
4
comment Code size overhead by including unnecessarily extra header files
@LightnessRacesinOrbit sure including a header that contains a static means adding program code, but I hope I answered the spirit of his question.
Feb
4
comment Individual developer in a big company
you're not working for your own applications, if you're employed to program for them that makes you an enterprise developer.
Feb
4
comment Where do you put your profiling code?
@RomanReiner integration tests, as the name says, are ones that you run on the final built system, so you can see if the joins between units work. Its also a place to see if data flow works and performance is acceptable. So it doesn't go with any file or assembly, but the overall product - its an 'external' thing.
Feb
4
comment Where do you put your profiling code?
add it to your integration test suite and run it with those. You should already have a bunch of end-to-end (or similar) performance tests anyway.
Feb
3
comment Is using getters in XAML view-models a bad thing?
@Shaamaan why would you use private setters? Update the variable directly, or if there's a lot of common logic involved then use a utility method. So I guess - it depends.
Feb
3
comment App db creation at first run
@KernelPanic oh I see. hard-code them. Your SQL is part of your overall codebase.
Feb
3
comment App db creation at first run
@KernelPanic doesn't this say - write them to the DB at startup, so you can read them from the DB. Hardcoded settings cannot be read as customised settings.
Feb
3
comment Is using getters in XAML view-models a bad thing?
@Shaamaan that depends - if you're asking "should I cache results inside my getters" then that's a fair response.I tend to use a dirty flag to indicate if the data has changed and requires a call to OnPropertyChanged, but YMMV.
Jan
31
comment API design dilemma: to REST or not to REST
@RichardTingle its not the ideal, but you do need to swap hashes between server and client - usually by encrypting a temporary key with the server that send you your stored hash encrypted with it, that you then compare. But you can do the same thing in the opposite direction. The moral here is not to try to implement security from a 29 word comment!
Jan
28
comment Are C and/or C++ viable/practical options for web development?
@Abdul depends on what you want to do, or how much processing is done in the service compared to the data IO getting
Jan
28
comment Is this approach scalable?
I really think you need to understand the difference between M_ and T_ tables. My gut says they are more complex than you expect, or why would you not just use one and ignore the other completely. Your example seems to ignore T_Customer already.
Jan
28
comment Splitting one class into subclasses to save memory
@ValentinTihomirov then you need to be clearer. You talk about saving 8 bytes for 1 member variable because it matters to you, and then ignore 8 bytes overhead for some objects. Doesn't make sense that you refine the question to only include parts you want to consider and ignore everything else. I can't read your mind to understand what you wanted so I tell you what is relevant. Objects that use OO have RTTI and other information contained in them that you do not see. If you need to consider the memory usage of objects you need to take that into account just as much as members.
Jan
27
comment Splitting one class into subclasses to save memory
@ValentinTihomirov you can't optimise the member variables away, obviously. But you don't have to pay the overhead of a vtable. The vtable is part of every instantiated object.
Jan
27
comment Splitting one class into subclasses to save memory
@ValentinTihomirov a plain C++ class with no virtual methods can be optimised to nothing. Every call to one of its methods can be turned into a simple 'static' function. Its only when you have virtual methods does the compiler not know if a method is overridden or not at runtime.
Jan
26
comment Splitting one class into subclasses to save memory
@ValentinTihomirov I don't know, maybe in my example each letter also has state describing if it is bold or italic as well. Then it shows that some letter As might not be the same, and require different handling.
Jan
26
comment Splitting one class into subclasses to save memory
@ValentinTihomirov C++ will only have the 8 byte penalty for classes that have a vtable - ie those using virtual inheritance. Without that, the C++ compiler will optimise every class down to just its member variables.
Jan
26
comment Splitting one class into subclasses to save memory
@VincentSavard I think in this case he's concerned about perf impact of his architecture, which is different to the usual profiling to locate bottlenecks. Sometimes you have to consider the performance impact of your program up front to save having to rewrite it completely. Besides, its always worth a little thought first before jumping into coding.
Jan
26
comment Is a TCP client/server a good solution for a system which can be controlled by a GUI running on multiple platforms?
@BasileStarynkevitch I stuck an embedded webserver (civetweb) into an existing app, it was so easy to use and get working I now recommend that approach to everyone :-)
Jan
25
comment For what reasons Java and C# initialize static data on demand?
although C++ can load modules dynamically and it doesn't know about them until runtime either. What happens when you load a dll is that any statics are initialised at dll load time. So I think your explanation is incorrect. Java/C# probably do it because of optimisation - init onl;y occurs when the JIT first sees the bytecode and turns it into real code.