Reputation
4,821
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
1 15 29
Impact
~322k people reached

2d
comment Is testable code better code?
My two cents on time: time is tricky, I have seen a number of procedures fail because they sampled the time too often and took incoherent decisions based on this always changing time. I personally advise getting the "now" instant once, at the start of the procedure, and always refer to this instant afterward in general. Timing routines (such as measuring elapsed since the start) can be done without exposing the internal instant.
Jun
9
comment What is the “type” of data that pointers hold in the C language?
Actually, conversion to an integral type is also specified, specifically to intptr_t and uintptr_t which are guaranteed to be "large enough" for pointer values.
Jun
4
awarded  Popular Question
May
21
comment When NOT to use virtual destructors?
Also I think in most cases destructors need to be virtual. Nope. Not at all. Only those who abuse inheritance (rather than favoring composition) think so. I have seen entire applications with only a handful of base classes and virtual functions.
May
12
comment Should I return from a function early or use an if statement?
@mk7: Log an inline wrapper function, which forwards arguments and result, and log what you wish; it will be more reliable than expecting that no-one adds a new return without logging. Note that I expect the need for fine-grained logging to be rare; otherwise you need TBs of logging space quickly.
May
5
answered Why does C provide language 'bindings' where C++ falls short?
Apr
13
revised Is it okay to have code smells if it admits an easier solution to another problem?
deleted 1 character in body
Mar
25
comment Is there a reason to have a bottom type in a programming language?
@Zaibis: It's an addition of functionality, but is not part of the function signature. Thus if you have a handle on a function, this "property" is lost.
Mar
24
awarded  Nice Answer
Mar
24
answered Is there a reason to have a bottom type in a programming language?
Mar
10
comment Why aren't `void *`'s implicitly cast in C++?
@MikeNakis: Then feel free to integrate it, since comments are meant to be ephemeral :)
Mar
9
comment Why aren't `void *`'s implicitly cast in C++?
Programs (whatever the language) are meant to be read. Explicit operations stand out.
Mar
4
comment Releasing open source software too soon
@Davidmh: That would be my main concern too, "once burned, twice shy".
Oct
8
awarded  Yearling
Oct
3
comment Databases: Where should the application logic run?
@Gili: It certainly made things slower though I do not think it was that much (remember the "lugging MBs on the network" comment); and I don't have numbers any longer nor am I inclined to investigate and re-create the situation (honestly, I have better things to do). It's a compromise, things got slower but we reduced the footprint.
Oct
3
comment Databases: Where should the application logic run?
@Gili: actually moving the queries help in that when a procedure/query is running it is consuming memory that can be released once it completes. For example, imagine having to do action X (taking some time) on N elements: the cursor/query generating the N elements can be freed once those N elements are turned over to another process, and said process may act to process X on one item at a time. With a stored procedure (or just a single big query) instead the cursor may occupy a lot of memory for the whole time.
Oct
3
comment Databases: Where should the application logic run?
@Gili: actually, it's real-life anecdote, not a strawman argument; note however that I did not specify CPU-bound, high memory consumption can also be an issue (when multiplied by the number of clients).
Oct
3
comment Databases: Where should the application logic run?
@Gili: Well, there is indeed a development cost; whether it is superior or not depending on how much it costs to spin up a new service in your architecture (where I work, it is so simple that there is actually less expensive than delivering a new library). However, you then benefit from all the advantages you listed... and perhaps one more. In performance, you have missed the fact that databases today are "central", and taking workload off a central point toward distributed applicative servers allow scaling more easily (to be balanced with lugging MBs over the network).
Oct
3
comment Databases: Where should the application logic run?
@HLGEM: If you are not allowed to change some applications, then the discussion about best practices/recommendations is moot. Obviously such discussion is only worth if you can actually take the decision in the end (or present arguments to someone who can take it).
Oct
2
comment Databases: Where should the application logic run?
"If the database needs to support multiple applications," => then you implement an application providing the functional API over the database, and this application will have sole access to the database :)