752 reputation
410
bio website 127.0.0.1
location Richmond, VA
age 39
visits member for 4 years, 6 months
seen Feb 27 at 4:13

I mostly do web apps these days. E-commerce backends in PHP, Perl, and/or Interchange (an open-source Perl-based app server), or small ASP.net sites. I still remember enough Javascript, VB.net, C#, C++, C, Java, and x86 assembler language to get by, and i like to think i'm pretty good with MySQL or MS SQL Server.


Feb
9
comment Why is instance creation the way it is?
...which wouldn't be a problem if naming conventions weren't as they are. Class is a perfectly valid identifier.
Feb
4
comment Is a 1 < 10 comparison less expensive than 1 < 1000000?
@supercat: CSS z-indexes only have meaning relative to each other. If you're comparing them against hard-coded values, you're doing it wrong. :P
Feb
4
comment Is a 1 < 10 comparison less expensive than 1 < 1000000?
@Falco: In that case, immediates wouldn't even factor in; loading and comparing against a register seems pretty much inevitable.
Feb
3
comment Is a 1 < 10 comparison less expensive than 1 < 1000000?
@LưuVĩnhPhúc: A register can be loaded before the loop. At that point, the actual comparison will be the same number of instructions in either case.
Jan
21
revised class in OOP language and type
added 108 characters in body
Jan
21
revised class in OOP language and type
added 108 characters in body
Jan
21
revised class in OOP language and type
added 108 characters in body
Jan
21
revised class in OOP language and type
deleted 168 characters in body
Jan
21
answered class in OOP language and type
Jan
13
comment What does SVN do better than Git?
I love how "you can fiddle around with history" is allegedly a feature. I'd consider it a bug if it weren't intentional.
Jan
12
comment How do I avoid cascading refactorings?
If you're truly refactoring, though, other code shouldn't have to concern itself with the changes right away. (Of course you'll eventually want to clean up the other parts...but that shouldn't be immediately required.) A change that "cascades" through the rest of the app, is bigger than refactoring -- at that point it's basically a redesign or rewrite.
Jan
8
comment Why would a program require a specific minimum number of CPU cores?
Linux has /proc/cpuinfo and sysconf(_SC_NPROCESSORS_ONLN) (the latter being mentioned in POSIX). Using the info to enforce a minimum performance threshold is still pretty bad form, though.
Dec
16
comment How would you design a programming language?
OOP's failure, frankly, is that hardly any "object oriented" language actually implements it. Most simply shoehorn an object model into a procedural language and call it a day. I do wish Smalltalk had caught on more itself, rather than prompting every procedural-language weenie to say "Eh, we can do something kinda-sorta-maybe like that" and manage to miss the point of OOP entirely.
Dec
2
comment Why aren't there code overviews for open-source projects?
For what it's worth, i've seen enough profiteering off of shoddy documentation to at least wonder whether it's intentional. When the same groups putting half-assed documentation online are more than happy to sell you a book or a training class, it doesn't take much cynicism at all to reach that conclusion.
Nov
28
comment Should I accept empty collections in my methods that iterate over them?
@supercat: If no answer would make sense, then an exception could be reasonable. If an exception would already be thrown, though, it's usually better IMO to just let it be thrown than to preemptively fail. For the file case, you could open the file before starting processing. You'll not only know the file exists, but in Windows, having the file open can keep other processes from messing with it, thereby avoiding the race condition altogether.
Nov
27
comment Should I accept empty collections in my methods that iterate over them?
One could even argue that the whole concept of checking for a file's existence before reading or writing it, is flawed anyway. (There's an inherent race condition.) Better to just go ahead and try to open the file, for reading, or with create-only settings if you'for writing. It'll already fail if the filename is invalid or doesn't exist (or does, in the case of writing).
Nov
27
comment Should I accept empty collections in my methods that iterate over them?
An average of 0 items is already going to either return NaN or throw a divide-by-zero exception, just because of how the function is defined. A file with a name that can't possibly exist, either won't exist or will already trigger an error. There's no compelling reason to handle these cases specially.
Nov
2
comment Which HTTP verb should I use to trigger an action in a REST web service?
Cross-site duplicate: stackoverflow.com/q/15340946/319403
Oct
29
comment Is vanilla JS still considered a library?
@AndrewHoffman: The differences between implementations aren't nearly as big as they used to be; now that IE gives a damn about standards, one can easily write cross-browser-compatible code these days.
Oct
4
comment Inheritance is a null property in the parent a bad practice?
@Jon: Because setters that don't actually set anything violate the Principle of Least Surprise. Most people expect a read/write property to act at least superficially like a field; if they can say o.Prop = 1;, then a subsequent o.Prop == 1 should be true. A do-nothing setter breaks that expectation, and makes it harder to know what stuff like navigation.Amount = 1; actually does.