Reputation
325
Top tag
Next privilege 500 Rep.
Access review queues
Badges
1 7
Newest
 Nice Answer
Impact
~24k people reached

  • 0 posts edited
  • 0 helpful flags
  • 87 votes cast
Sep
13
comment Should we encourage coding styles in favor of developer's autonomy, or discourage it in favor of consistency?
I was actually coming here to ask a very similar question just now - when automatic code formatting tools are available and convenient, is it more important for those tools to not be run (and preserve inconsistent personal styles) or to have a style enforced?
Sep
13
comment Recursion without factorial, Fibonacci numbers etc
That's generally better served by a process queue as opposed to recursion in the traditional sense.
Sep
13
comment Recursion without factorial, Fibonacci numbers etc
Binary search is often formulated as a recursive problem but it's trivial (and often preferable) to implement in an imperative way.
Aug
22
comment Philosophy behind Undefined Behavior
boost::weak_ptr's implementation is a pretty good template to start with for this usage pattern. Rather than tracking and nullifying weak_ptrs externally, a weak_ptr just contributes to the shared_ptr's weak count, and the weak count is basically a refcount to the pointer itself. Thus, you can nullify the shared_ptr without having to delete it immediately. It's not perfect (you can still have lots of expired weak_ptrs maintaining the underlying shared_count for no good reason) but at least it's fast and efficient.
Aug
17
awarded  Teacher
Aug
16
awarded  Editor
Aug
16
revised Is it a good idea to use Header(“Content-Type […]”); in the core file of a CMS?
deleted 1 characters in body
Aug
16
answered Is it a good idea to use Header(“Content-Type […]”); in the core file of a CMS?
Aug
10
comment Philosophy behind Undefined Behavior
Also remember that not every CPU has an MMU to guard against invalid accesses in hardware to begin with. If you start requiring your language to check all pointer accesses, then you have to emulate an MMU on CPUs without one - and thus EVERY memory access becomes extremely expensive.
Aug
10
awarded  Supporter
Aug
1
awarded  Autobiographer