5,427 reputation
22128
bio website
location
age
visits member for 2 years, 6 months
seen 1 hour ago

Engineering Manager for Sony Network Entertainment who wishes he was doing Python but is instead managing a web development team.


22h
comment What license is this source code published under?
I don't think that is correct. That's an article on an O'Reilly site, and I would suspect that the licensing is the same as for book examples
Nov
17
comment Which algorithm best fits the following problem
A definitive answer to this would earn you a hell of a lot of money.
Nov
14
answered Python - defining exit method before importing
Nov
12
comment What did people do before templates in C++?
I'm not sure about Microsoft's first C++ compiler, but I'm pretty sure Turbo C++ 1.0 had no template support.
Nov
12
comment What did people do before templates in C++?
This link has interesting historical info: drdobbs.com/cpp/c-programming/184409040
Nov
12
comment What did people do before templates in C++?
I remember another pattern, which was to create a Object class and demand everything stored derive from that. Unfortunately, my brain is not coming up with concrete examples. It certainly wasn't as popular as void *. Also, I worked with at least one system that used an enum, stored along with the void *, to save type info.
Nov
12
comment Is it good practice to rely on headers being included transitively?
I have personally witnessed "don't worry if it compiles" turn into "our application takes 30 minutes to compile when you add a value to an enum, how the hell do we fix that!?"
Nov
12
awarded  Guru
Nov
11
comment Should we add constructors to structs
What I mean is, if you start finding complicated logic in the constructor, it is likely that you should make it into a class. (IMHO) But it's really just a style question as the only actual difference between struct and class is that one defaults to private and the other to public.
Nov
11
comment Writing an Operating System in C
The answer is "yes".
Nov
11
comment Should we add constructors to structs
It depends on what these constructors are doing. I think it is completely reasonable to have a constructor on a simple struct if it is just setting field values in basic ways.
Nov
11
comment memory needed to store a function in javascript
Right, definitely. I agree with everything in your answer, but I thought it important to bring what sizeof.js was actually doing into the mix.
Nov
11
answered memory needed to store a function in javascript
Nov
11
comment memory needed to store a function in javascript
Looking at the code of sizeof.js it's pretty clear that it's meant entirely as an estimate, not as any sort of controlled measure of truth.
Nov
11
comment memory needed to store a function in javascript
Since in browsers, JavaScript files themselves are likely kept in memory, and since JavaScript clearly keeps function text around (because it can display it in the console log, web inspector, etc.) you can probably say in most cases, the function takes up at least as much space in memory as its text. If JIT is involved, there's probably a bit of additional overhead. In the end, I think it is meaningful in that memory is being used. It may just be impossible to determine the exact number in bytes.
Nov
9
comment What's the meaning of this quote attributed to Arthur C. Clarke?
I don't think it is about English. The core question is why reading computer manuals without hardware might be frustrating. For instance, if I asked about the famous Fred Brooks quote about nine pregnant women having a baby in a month, wouldn't that be about computing?
Nov
9
answered What's the meaning of this quote attributed to Arthur C. Clarke?
Nov
9
comment Including extra headers that I do not really need
This is a little misleading because including a header full of nothing but templates will have no effect on the including file at all if the templates aren't used, and thus should have no effect on the resulting executable. (It will increase compile time though.) Headers may include global objects, but that isn't really about the templates themselves.
Nov
9
comment Why does utf-8 waste several bits in it's encoding
Sure. Your scheme is more information dense but does not have an important feature UTF-8 provides. In general, people prefer the safety, which is why UTF-8 is possible. Besides, to really prove your scheme is actually more efficient, you'd want to provide statistics using real text. You may well find that in most real text, your scheme saves a very trivial amount and thus the savings isn't worth it.
Nov
9
answered Why does utf-8 waste several bits in it's encoding