701 reputation
410
bio website 127.0.0.1
location Richmond, VA
age 38
visits member for 4 years, 3 months
seen 2 days ago

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.


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.
Oct
4
comment Inheritance is a null property in the parent a bad practice?
@Jon: At the very least, IMO the property in the base class should not have a setter. But yeah, if Amount only really makes sense for c3 and c4, then it should probably only exist on those classes.
Oct
4
comment Inheritance is a null property in the parent a bad practice?
Let me answer your question with a question. How would you like it if your TV's remote had buttons that never do anything...just because the TV makers planned on building a TV that they would work on?
Aug
27
comment Does a prose to code compiler exist?
Just thought i might mention osmosian.com. They have a whole crappy-but-eh environment built. It's not really a "prose to code", though, as much as it is a programming language that resembles English.
Aug
26
comment Is method overloading anything more than syntactic sugar?
@supercat: Right. That was pretty much my point. The question (although it includes Java code) is largely language-agnostic, so we can't say any particular feature is or isn't "sugar". But in the end, it's all an abstraction over machine language anyway.
Aug
26
comment Is method overloading anything more than syntactic sugar?
@supercat: Your definition of what isn't syntax sugar seems to be expanding. But it's irrelevant. If a compiler were to convert a Smalltalk image to native code, it could easily translate the polymorphism into a conditional branch if that makes things faster. I'm fairly certain Dolphin does just that.
Aug
26
comment Is method overloading anything more than syntactic sugar?
@supercat: Check out Smalltalk for evidence that neither need be built into the language proper -- both are methods, and the decision is handled entirely via polymorphism. (true and false are singletons of different subclasses of Boolean.) (true ifTrue: [do stuff]. runs the [do stuff] block, and false ifTrue: [do stuff]. ignores it. Loops are done by telling a block that evaluates a condition, "run this other block while your own return value is (true|false)". No new flag variables required. You could easily build your own control structures if you wanted.
Aug
26
comment Is method overloading anything more than syntactic sugar?
@ShadowsInRain: Sure they can -- most of them, anyway. What is a + b, if not just a different way of writing a.plus(b) or add(a, b)? You have a couple of essential ones that can't go away, but those would more correctly be delimiters rather than pure operators.
Aug
26
comment Is method overloading anything more than syntactic sugar?
Meh. Smalltalk is evidence that even "if" and "while" could be considered syntactic sugar, depending on which features you consider "essential". (The language has like 6 keywords, and not one of them is for flow control.)
Aug
23
comment Is there a difference between fibers, coroutines and green threads and if that is so what is it?
Note, coroutines and fibers could be considered quite closely related -- possibly even the same thing. If one wanted coroutines, they can be implemented via fibers with very little effort, and vice versa.
Aug
19
comment When is type testing OK?
@supercat: Because if you say you take an IEnumerable<T>, and are not more specific, you're saying you can take any IEnumerable<T>. That is clearly not the case. And the second someone starts getting fancy with your method and it gets into an infinite loop trying to find the last element of an infinite sequence, your code will be entirely to blame.
Aug
19
comment When is type testing OK?
@supercat: Ahh...just noticed that the other interfaces don't say out T. :P However, IReadOnlyCollection and IReadOnlyList, though, do. (And both are probably a better fit anyway, since you're not modifying the list.)
Aug
19
comment When is type testing OK?
@supercat: Neither directly implements IEnumerable<Animal> either; they work due to the covariance of the type parameter. And that covariance extends through IList and ICollection all the way back to IEnumerable. I don't see it skipping a generation.