11,660 reputation
12851
bio website
location
age
visits member for 4 years
seen 17 mins ago

Oct
26
revised Do GC generations have any purpose (for an application programmer) other than answer to “tricky” HRs' questions?
added 207 characters in body
Oct
26
answered Do GC generations have any purpose (for an application programmer) other than answer to “tricky” HRs' questions?
Oct
22
comment Implements > extends, but what about variables?
Why do you need a field (which other best practices dictate shouldn't be public to begin with) rather than a getter/setter?
Oct
22
comment Why are floating point numbers used often in Science/Engineering?
@slebetman You appear to say "science = natural science", which is not the consensus to say the least. Mathematics and philosophy share a foundation in logic, and philosophy has a sub-discipline concerning the discussion and interpretation of mathematical study and results, but the two are nevertheless quite distinct fields of study. Mathematics does not use the scientific method though, since it's not empirical and doesn't even begin to attempt to make statements about the observable universe (I hope I've phrased this in a way that includes Platonists).
Oct
21
comment Why are floating point numbers used often in Science/Engineering?
To add to the points made above, not only do you not care about precision beyond a certain point, you can't get arbitrarily precise results because many of your inputs are measured quantities that have some inherent error.
Oct
21
comment Robustness and pointer safety in C++
Crashed processes can be restarted by a watchdog. A more serious problem may be use-after-free and out-of-bounds bugs, which can corrupt data (or allow exploits) without crashing.
Oct
20
comment Why does a bytecode VM use stack or registers opposed to direct operations?
It can certainly be executed, but nearly anything can. It's not something anyone should use when direct execution is at all interesting. There is no advantage, and the downside of having to implement phi nodes. You can pre-process the SSA code to remove them, but then you're essentially doing register allocation and your actual VM becomes a register VM.
Oct
20
comment Why does a bytecode VM use stack or registers opposed to direct operations?
SSA isn't typically used for execution, only as an IR for easier analysis (and mapped to registers and/or stack slots before execution). LLVM is not a VM in the sense of this question.
Oct
18
comment Why is inheritance generally viewed as a bad thing by OOP proponents
@RonaldMunodawafa No, subtyping is still a thing in Python, as are interfaces, they're just handled differently (not checked statically, less formalized).
Oct
18
comment Why is inheritance generally viewed as a bad thing by OOP proponents
@RonaldMunodawafa Passing a child instance in place of a parent instance is just run of the mill subtyping, which can equally easily be achieved via interfaces.
Oct
18
comment Is there a good name for this pointer template?
How would Foo detect that the object is deleted?
Oct
16
comment How to prevent third party misuse of what is intended to be a private api (avoiding what happened to Snapchat)?
When you wrote that the private API calls need to require authentication, I agreed. But it seems we were thinking of different things. A private API call, i.e. an action that 3rd party apps should not be able to use, should demand authentication of the app, via an API key or something similar, regardless of whether the action being performed also requires user authentication.
Oct
15
comment Decimal vs. Integer; Given a fixed range of values, which is preferable for accurate computation?
@RLH You make a number of assumptions that strike me as unwise. A lot of calculations can easily take a detour outside the range your inputs and final results lie in, especially if the order of operations is subject to change or the actual formula is transformed algebraically. Requirements do change more often than one thinks (even if you take this very observation into account). The answer to what you wrote here may very well "ints are preferable" but in your actual situation the opposite may be the case.
Oct
14
awarded  Nice Answer
Oct
13
answered Illegal in PHP: Is there an OOP design reason?
Oct
10
comment What drawbacks are there to condition-based scope?
@KarlBielefeldt I might, after seeing OP's reaction to judge the level at which the question resides, and whether OP can come up with any additional details.
Oct
10
comment What drawbacks are there to condition-based scope?
I accidentally a word in the comment above: "it's often infeasible -- sometimes literally impossible". tl;dr PLT is hard.
Oct
10
comment What drawbacks are there to condition-based scope?
It's not even clear to me how to formalize this properly, in particular the "same condition" bit. You can't just check if the condition is syntactically the same, since it might evaluate differently the second time (consider anything non-deterministic, or anything dependent on mutable state altered in rest of initialization). Even if you restrict it to bare variables as in your example, if they're not local (the one in your example isn't) it's often -- sometimes literally impossible -- to computationally check that it isn't changed between the two conditions.
Oct
8
comment Is hash calculated before/after compression?
Yes, strike that. I figured out what was really bugging me: Many checksums are calculated over arbitrary payload which may very well be compressed (e.g., TCP, many network protocols building on TCP, torrents, Ethernet frames, IPv4). To checksum the uncompressed data, the part doing the checksum has to know about the compression taking place.
Oct
8
comment Does C++ abuse the stack?
If anything, C++ makes stack allocation less necessary (or rather, free store allocation easier) because RAII and standard classes utilizing RAII make it far easier to delete correctly.