Reputation
58,824
Next tag badge:
187/100 score
18/20 answers
Badges
11 174 256
Impact
~2.0m people reached

Jan
21
comment Why does integer division result in an integer?
@soandos: The way Pascal and Python both do it: have a distinct integer-division operator, but the standard division operator always returns the mathematically correct result. (Or--for the pedantic--as correct as you can get given the limitations of FP math.)
Jan
21
answered Why does integer division result in an integer?
Jan
20
comment Composition over inheritance but
@DavidArno OK, whatever. Go ahead and believe that, while the rest of us go on being more productive than you. ;)
Jan
20
comment Composition over inheritance but
@DavidArno That's just plain ridiculous. Inheritance is one of the most useful, productive features ever developed in the entire history of programming. As with anything useful, there are plenty of ways to abuse it, but used properly it massively increases the power and productivity of your work.
Jan
16
answered C# / VB.NET build expression trees only from lambda expressions — why?
Jan
13
comment Code Reviews: Working around the Github Pull Request limits
It's quite simple actually: just drop a few screenshots in your email. (As they say, a picture is worth a thousand words.) You're right about scriptability, though, which is the point I made: command lines are for scripts and programs to talk to each other, but very poorly suited to being a user interface.
Jan
13
comment Code Reviews: Working around the Github Pull Request limits
Ugh. -1 for advice that's literally more than 30 years out of date. Command lines are for scripts, and for programs to talk to each other; if you're using it as a user interface, you're Doing It Wrong and have been ever since the introduction of the Macintosh.
Jan
11
awarded  Good Answer
Jan
9
comment Is declarative programming overrated?
Why would anyone want a static AOT compiler? Because the hardware you're running on isn't likely to change, so why waste execution time recompiling, doing the same exact work with the same exact results over and over and over again, every single time you run the program? JITs are good for scripts, and (depending on the circumstances) for development time, but for deployed software, AOT wins every time.
Jan
9
comment Why are statements in many programming languages terminated by semicolons?
@kevincline Skype: written in Delphi (Pascal.) Microsoft attempted to change this after they acquired it, but they couldn't port it successfully, so now they're buying Delphi licenses. Ever watch TV in the US? The station probably runs on software by WideOrbit, written in Delphi; they're the market leader by a huge margin. Ever been to a theme park? There's a good chance the ticketing system was written in Delphi. Pascal is all over the place; it's just that it provides such a strong competitive advantage that a lot of people try to keep quiet about it so their competitors don't find out.
Jan
8
comment Circular dependencies: Recursive grammar parser (e.g. json)
Yeah, I've heard of parser combinators. They exist in plenty of languages, and they've always seemed like a really bad idea IMO.
Jan
8
comment Circular dependencies: Recursive grammar parser (e.g. json)
@donquixote: If the exact grammar rules aren't known at compile time, you'd want to use a different parser generator. Something like OMeta, which is more complicated and slower than ANTLR, but highly dynamic and customizable. You can plug in new rules very easily with it. I don't know why you keep trying to come back around to this idea of "composing smaller parsers into larger ones" but it really sounds like a disaster waiting to happen! My advice is, just don't do it.
Jan
8
comment Circular dependencies: Recursive grammar parser (e.g. json)
@donquixote: It's a parser generator, a very good one. You write up some special source code in ANTLR format which describes the grammar of the language you're trying to parse, and feed it into ANTLR, and it generates a parser from that. The generated parser is pretty complicated and it's essentially a black box, (even though the entire thing is open-source,) but it's widely used and well-tested.
Jan
8
comment Circular dependencies: Recursive grammar parser (e.g. json)
@donquixote If the grammar is too complex to easily get right in a simple, hand-written RDP, my advice would be "use ANTLR", not "split it up into multiple parsers." The bigger and more complex a grammar is, the more likely it is to contain mutually-recursive grammatical elements like in this example, which means your problem never goes away.
Jan
8
answered Circular dependencies: Recursive grammar parser (e.g. json)
Jan
8
awarded  Guru
Jan
8
awarded  Good Answer
Jan
8
awarded  Nice Answer
Jan
7
awarded  Nice Answer
Jan
7
comment Given a herd of horses, how do I find the average horn length of all unicorns?
Of course, this assumes that the only difference between an ordinary horse and a unicorn is the horn. If this is not the case, then things get a lot more complicated very quickly.