359 reputation
14
bio website etalabs.net
location
age
visits member for 3 years, 8 months
seen yesterday

Sep
27
comment Is there a good reason to make pure functions non-public?
Foo Create(){ return new Foo(); } can never be pure since it can throw an exception if the allocation fails.
Aug
30
comment What specifically does expressive power refer to?
It should be noted that limiting a program to at most 100 million variables in a given scope imposes some limit on expressiveness. It might make it impossible to implement Firefox, for instance. ;-)
Aug
29
comment Are C static libraries frowned upon?
This is true (speeding up development), but it's really frustrating that it makes it into production. The canonical example is Firefox. The amount of engineering effort (in the form of hideous hacks) that have gone into speeding up dynamic linking symbol resolution so that Firefox loads in reasonable time is utterly crazy. Much better performance could have been attained with much less engineering cost if they were just willing to static-link all of their in-project code (while still dynamic linking system libraries and plugins, if desired).
Aug
15
comment Why can't we use IP address instead of cookies in identifying the client in servlets?
@dirkk: Please don't accuse me of being wrong about something you have no idea about. As Bob suspected, I was talking about wifi. I have access to 8+ cafes and other business access points, plus (lower-quality) city-provided wifi access points along the street, and my phone regularly jumps between them while walking.
Aug
14
comment Why can't we use IP address instead of cookies in identifying the client in servlets?
Using an IP address at all to identify a client is a huge bug. My IP address probably changes several times a minutes while walking down the street accessing a site from my phone.
Aug
7
comment Why do we have postfix increment?
@Snowman: That's not a function call. It's the C comma operator, which is a sequence point, parenthesized to control precedence. The result is the same as x++ in most cases (one exception: x is an unsigned type with rank lower than int and the initial value of x is the max value of that type).
Aug
7
comment Why do we have postfix increment?
@Snowman: Which one? I see no such issues in my answer.
Aug
7
answered Is it bad practice to resolve null arguments to default static variables?
Jun
19
comment Why do most programming languages not nest block comments?
@ThePopMachine: I'm sure of what I stated, that regular has a defined formal meaning, not the meaning you're using, and that the "regular" in "regular expression" was chosen for this meaning. Being non-recursive is one result of its definition.
May
11
comment Is it okay to not completely understand code functionality?
I question the principle of abstraction you're citing, on the basis that, for a large portion of real-world code, the full interface contract is considerably larger than the implementation. In other words it often requires the mental ability to handle more complexity to deal with methods as black boxes than it would require to just look inside. This is not an argument against abstraction but an argument that complexity is something fundamental that can't be abstracted away, and that all software necessarily does collapse (in quality) under complexity.
Mar
29
awarded  Yearling
Feb
19
comment Why is it so difficult to fix buffer overflows?
What pmg said. The only reasons fixing buggy code is hard are (1) you're not familiar with the code to begin with, and (2) the person who wrote it is probably not competent, and therefore the code is really bad and hard to fix. :-)
Oct
26
comment Should I teach my students alloca?
C does not have constructors.
Oct
26
comment Should I teach my students alloca?
If it's a few KB and you're confident you have a few KB, you can just use T foo[5000]; or whatever.
Oct
25
comment Should I teach my students alloca?
The only "responsible" use of alloc is 100% equivalent to fixed-size automatic arrays, and less portable.
Oct
25
answered Should I teach my students alloca?
Sep
14
comment Recursion without factorial, Fibonacci numbers etc
@Zachary: Algorithms that can be implemented with tail recursion (like binary search) are in a fundamentally different space class than those which require real recursion (or your own state structures with equally expensive space requirements). I don't think it's beneficial for them to be taught together as if they're the same.
Sep
14
comment Recursion without factorial, Fibonacci numbers etc
Of course it should be noted that whenever you have the liberty to design your own tree structure, it's almost always better to keep pointers/references to parent/next sibling/etc. in the nodes so that you can iterate over the tree without recursion.
Sep
14
comment Recursion without factorial, Fibonacci numbers etc
@jk: Directories cannot be hard linked, so modulo some leaves that might appear in more than one location, and assuming you exclude symlinks, real world filesystems are trees.
Sep
14
comment Recursion without factorial, Fibonacci numbers etc
@dan04: Recursion is a horrible way to implement almost anything due to the possibility of stack overflow in most lanaguages.