6,178 reputation
1633
bio website
location United Kingdom
age 43
visits member for 3 years, 7 months
seen 4 hours ago

Jul
2
awarded  Curious
Jun
15
comment Why are most functional programming languages also interpreted languages?
Then again, Haskell is statically typed (and definitely compiled) yet has a similar tiny-but-there run-time cost for calling typeclass members - yet another form of late binding, really - and although I don't know much about ML, it probably has some equivalent too. In my mind, late binding is one of those things that shows that interpreting vs. compiling is blurry - though thinking of particular kinds of run-time work as left-over interpreting is probably a bit odd when the whole point of a program is to do work at run-time.
Jun
15
comment Why are most functional programming languages also interpreted languages?
They're not. The Lisp family used to be commonly considered interpreted (I still have old books that make the claim) but that's not true now and maybe never really was. However, unlike ML and Haskell, Lisp has dynamic typing. That means a tiny bit of work must be done at run-time (unless the optimizer can eliminate it) to determine which implementations of certain operations to use for particular values based on their types - similar to the tiny "overhead" for late-binding member functions in object-oriented programming. Dynamic typing is really just another form of late binding.
Jun
12
comment Can an object oriented program be seen as a Finite State Machine?
@cline - In this case, you're absolutely right, but I think what I had in mind was the kind of concurrency and timing variation that happen in a real-world machine - things like a core running a bit slower because it's too hot, the exact time when the data happens to be under the read head etc. This all fits in the non-deterministic finite automata model you describe, of course, so you're absolutely correct - but the number of states will be insanely huge. I guess I might have had continuous measures such as those temperatures in mind as part of the system state too (not just consequences).
Jun
8
comment programming on handheld devices
@Nav - basically, stop thinking in terms of a device getting "good enough" for development. Having a faster processor and more memory won't mean you can read lots of code at once on a 4-inch screen or type reasonably quickly on a tiny touch-screen keyboard or that your development tools will run on that device. For example that Psion, the screen was crappy but still as big or bigger than some current phones, and there was a physical keyboard that didn't waste screen-space (Psion series 3 and 5 looked a bit like pocket-size laptops).
Jun
8
comment programming on handheld devices
@Nav - it's not about whether the device is "good" in general terms. It's not about a ranking system. A device that's better for one thing isn't automatically better for everything else. A modern phone is far more powerful than the home micros I used for programming 20 or 30 years ago - but now, developers who target phones or tablets work on laptop/desktop computers. Keyboards and larger screens make a big difference, having laptops and desktops available means developers will tend to choose them, and the tools (IDEs etc) aren't really available for phones.
Jun
3
comment Can an object oriented program be seen as a Finite State Machine?
@kevin cline - thanks - and what was I thinking!!! Edited to strike that bit out. Despite what I said about formal study, I know better than that and should have known better back then.
Jun
3
revised Can an object oriented program be seen as a Finite State Machine?
added 986 characters in body
Apr
30
comment If you need more than 3 levels of indentation, you're screwed?
@Izkata - Of course my original "If we interpret it as meaning one word, we'll have big problems." is relevant here. If you're looking to claim somethings incomprehensible because it has more than 7 things in it, you can do that with 8 lexical tokens. Scratch that - there's often more than one thing to understand per lexical token, so you don't even need 8 to be incomprehensible. Remember, my original point was to "fall back on common sense". Any rule simple enough to state is too simple and will sometimes mislead you - that doesn't mean you switch to the opposite simple rule.
Apr
30
comment If you need more than 3 levels of indentation, you're screwed?
@Izkata - If you think you need to analyze every little detail to have an at-a-glance overview, you haven't understood the concept of an overview. Would you apply the same standard to functions? Insist that reading the call isn't enough - you must analyze every detail of its implementation (and recursively, the implementation of everything it calls) in order to claim any understanding of the original call? Just because a little less complexity was moved to the call graph doesn't mean you need to analyse every detail - the visually obvious structural summary from indentation helps with that.
Apr
4
comment Will B-Trees and Other Data Structures Become Obsolete With The Advent of Solid State Drives?
@user955091 - I meant because of cache-oblivious data structures (pedantically meaning structures that are optimal in the cache-oblivious model), but I was a bit overexcited about them back then. Other data structures aren't going to disappear any time soon. For one thing, cache isn't the only performance issue - parallelism makes different demands. Besides, needing key-based ordering is often a special case - normally, hash tables are king. It can be hard to see a "randomized" layout as cache-friendly, but one access to directly fetch the item is hard to beat - you don't need locality.
Mar
18
comment When does implementing MVVM not make sense
@Luke - that's true, but my point was also that you shouldn't let a beautiful design stop you shipping your product. A good design pattern is only good so long as you use it appropriately, and so long as the real world behaves itself.
Mar
12
comment Why would a language let programmer to handle divison by zero
@supercat - maybe you're referring to something like NaN which (in effect) is an error value defined as part of IEEE754 - so that IEEE754 floats are similar, in a way, to a Haskell Maybe type. I would say that is a kind of checked operation and arguably a kind of exception handling that propagates through expressions (rather than calls), though of course the "did an error occur" check must be done explicitly somewhere. The downside of this approach is that, after the NaN result has propagated out through many layers of calculations, it's hard to trace the original cause.
Jan
19
comment 2 closest points between 2 rectangles
@shoham - or you're focussing on the wrong element of a larger problem, perhaps. If you're concerned about the performance, presumably you'll be doing it a lot - meaning there's a larger problem that might have some exploitable structure to reduce how much you do it. Or maybe within that larger problem there's something to gain by building a data structure with all the rectangles.
Jan
19
comment 2 closest points between 2 rectangles
@shoham - one quick example - if you could eliminate "back-facing" corners, you'd only need to check 9 combinations of corners rather than 16. Given that the rectangles don't overlap, that's not so difficult. For each rectangle, calculate a center point. For each edge, calculate (using IIRC a cross product) which direction faces out. Dot products between cross products and other-rectangle centers yada yada - a lot like backface elimination for 3D games. A corner that has both it's edges as "back facing" cannot be a nearest corner and is eliminated. Trouble is, that's more work than you save.
Jan
19
comment 2 closest points between 2 rectangles
@shoham - trying to optimise risks slowing it down. A more sophisticated approach means more complex code, working more slowly per item checked. This is only worthwhile when you can avoid checking large numbers of items. In this case, you might be able to use some kind of nearest-neighbour data structure to help "optimise" your search, but I'm betting it would end up slower. If you really need an optimised approach, you'll need to try several alternatives (including this simple brute force) and measure to see how they work out.
Jan
17
comment Why do we still use floats?
In support of the "boundaries of number size" - huge divided-by slightly-less-huge possibly equals a small rational with lots of digits after the point. Perhaps something like 3.1415926... - a rational approximation of PI. As PI is an irrational number, there's no bound on how precise you might want to be - and therefore no bound on how large those integers might need to be. You could have integers larger than the number of quarks in the universe squared and it's still not enough to give perfect precision.
Jan
9
comment What is meant by “Now you have two problems”?
@Satanicpuppy - more like the "I haven't memorized ever single cryptic notation in every one of the regex notations in use" masses. Many people who hate regexes are perfectly happy with similar notations in e.g. lexing DSLs.
Jan
9
comment What is meant by “Now you have two problems”?
@Euphoric - actually, good code is short - but without being cryptically concise.
Jan
8
comment English term for “Naive user test” or “idiot test”
First-time user?