Slashdot Mirror


User: Coryoth

Coryoth's activity in the archive.

Stories
0
Comments
2,929
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 2,929

  1. Re:Comments are a code smell. on How to Keep Your Code From Destroying You · · Score: 3, Insightful

    Refactoring code to make things as clear and obvious as possible is, of course, a good idea. But it is no substitute for actually stating your intentions in the form of comments or contracts. A maintainer coming to search for a bug in code that is clear but uncommented can only discern what the code actually does as opposed to what it was intended to do. Thus if the bug is a result of a gap between intended functionality and what got implemented (as happens often enough to matter) it makes things a lot harder to track down. If you an state clearly and simply what a block of code is intended to do, do it -- it gives a maintainerr something to verify against.

  2. Re:That was just terrible... on How to Keep Your Code From Destroying You · · Score: 3, Interesting

    1.) Use test driven development I'll go you one better. Use specification driven development. That is, use a combination of contracts an unit tests. If your method has general constraints, or your object has an invariant, write it into the code using contracts (and ideally use a system that will let your subclasses inherit contracts, and allow contracts to be sucked up and included in the API documentation); if your methods specification is only easily expressed as a set of mappings from input to expected output, write a unit test instead. When you run your unit tests the contracts will automatically get tested too. Better yet, by using contracts you can help yourself on:

    2.) Write complete unit tests, including bad input by using the contracts as a test oracle and passing in randomly generated data to really flesh out the corner cases. In some cases you can do this in a purely automated fashion at the push of a button. Contracts also have the benefit of: (1) not requiring the biolerplate code of unit tests, so they're faster to write; (2) respecting inheritance which can save you a lot of extra test writing. You can't always easily write contracts for methods, and in those cases unit tests make sense, but you may as well take full advantage of contracts for the parts that can be handled in that manner.
  3. Bringing things together on How to Keep Your Code From Destroying You · · Score: 1

    It is notable that Tip 1, "Comment like a smart person", and Tip 2, "Do error checking. You make errors. Yes, you" can be sensibly combined into "Use contracts". Sure, you'll still need some extra comments to describe the function, but any comments about the parameters a function recieves and what it returns can be usefully written as contracts which provide both documentation and error checking. It also helps you to think about exactly what you intend a function to do, and assists greatly down the line when re-using code by providing clear testable constraints on what a function can and cannot do so you don't accidentally go misusing it.

  4. Re:Origami on Microsoft's Multitouch Coffee Table Display · · Score: 1

    Perhaps Apple fanboys should take this as being a sign that Apple is going to announce something really big at the WWDC in a couple of weeks time! My guess is that the GPP is one the money: a touch screen version of the iMac. Specifically, think of an iMac that looks pretty much the same as the current model, the difference being that everything is wireless of plugged into the stand, and you can lift the screen off the stand and go and sit on the couch and use it as a touchscreen tablet to lie back and browse through web pages at leisure etc. In some ways this is little different than a tablet notebook and a docking station, but its the fine points: having the desktop detup really be a desktop; having a simple and elegant inger based multi-touch interface for when you carry the screen away; maing the docking/un-docking incredibly easy -- just pick it up and go; etc. The point being to promote it note as a notebook replacement, but as a desktop replacement that you can just carry into the next room to show something to your friend if you want etc. Basically just a more flexible lifestyle oriented desktop -- that is, exactly the sort of thing Apple strives for.
  5. Re:Yes, because programmers are too conservative on Is Parallel Programming Just Too Hard? · · Score: 1

    The only solution I see is for message passing in object-oriented programming to become real message passing, i.e. each object having a queue of jobs and a lightweight thread which takes over the remaining jobs in the queue. It's not quite the Actor model, but it is close Take a look at SCOOP for Eiffel then. It is rather akin to that, just slightly more nuanced in that it allows you to state which objects are parallelisable, and which objects need to remain in the same thread/process/processor. In practice it is as simple as the separate keyword, which declares that objects can run independently. From there you just think of method calls as messages. The compiler handles all the details of locking etc. for you autonatically. Even if you don't use Eiffel and never intend to (it is, after all, a nice language with a GPLd IDE and compiler suite) its worth looking at SCOOP just to see what you should be lobbying other OO lanuages to take the plunge and do.
  6. Re:Yes, because programmers are too conservative on Is Parallel Programming Just Too Hard? · · Score: 1

    People will adapt eventually...Yes, it will take a few years before the new languages and new techniques take over, but any major paradigm shift takes time. I'm not so confident. Consider, for example, the OO revolution. It was a new paradigm, which provided a good way to deal with the ever largeer programming projects that were being undertaken. At the time there were a number of languages that took that bull by the horns and produced very nice solutions, such as SmallTalk, and Eiffel. Developer conservatism kicked in however, and what we ended up with was a bastardized kluge of the clean OO concepts hacked onto C in the mess that is C++. Eventually someone was kind of enough to wipe up the worst of the drool, and make the child a little more presentable, and we got Java. I expect to see the same with concurrent paradigms. We'll see some wonderful languages which elegantly implement the new paradigm, like Erlang, but what we'll end up with is whatever kluge can be arranged to make things slightly better in C++ and Java (Software Transactional Memory seems to be the popular option right now). Years later someone will again, clean up the resulting mess and make a language that is merely not quite as slovenly, but still relatively retarded.
  7. Yes, because programmers are too conservative on Is Parallel Programming Just Too Hard? · · Score: 5, Insightful

    Parallel programming doesn't have to be quite as painful as it currently is. The catch is that you have to face the fact that you can't go on thinking with a sequential paradigm and have some tool, library, or methodology magically make everything work. And now, I'm not talking about functional programming. Functional programming is great, and has a lot going for it, but solving concurrent programming issues is not one of those things. Functional programming deals with concurrency issues by simply avoiding them. For problems that have no state and can be coded purely functionally this is fine, but for a large number of problems you end up either tainting the purity of your functions, or wrapping things up in monads which end up having the same concurrency issues all over again. It does have the benefit that you can isolate the state, and code that doesn't need it is fine, but it doesn't solve the issue of concurrent programming.

    No, the different sorts of paradigms I'm talking about no shared state, message passing concurrency models ala CSP and pi Calculus and the Actor Model. That sort of approach in terms of how to think about the problem shows up in languages like Erlang, and Oz which handle concurrency well. The aim here is to make message passing and threads lightweight and integrated right into the language. You think in terms actors passing data, and the language supports you in thinking this way. Personally I'm rather fond of SCOOP for Eiffel which elegantly integrates this idea into OO paradigms (an object making a method call is, ostensibly, passing a message after all). That's still research work though (only available as a preprocessor and library, with promises of eventually integrating it into the compiler). At least it makes thinking about concurrency easier, while still staying somewhat close more traditional paradigms (it's well worth having a look at if you've never heard of it).

    The reality, however, is that these new languages which provide the newer and better paradigms for thinking and reasoning about concurrent code, just aren't going to get developer uptake. Programmers are too conservative and too wedded to their C, C++, and Java to step off and think as differently as the solution really requires. No, what I expect we'll get is kluginess retrofitted on to existing languages in a slipshod way that sort of work, in as much as it is an improvement over previous concurrent programming in that language, but doesn't really make the leap required to make the problem truly significantly easier.

  8. Re:10% of $product market... on A Million Zunes Sold · · Score: 1

    Riddle me this Slashdot: Why is it that when a product achieves ... ...10% of the MP3 player market, it is less than an also-ran. ...10% of the browser market, it is a signal that the world is changing. ...10% of the OS market, it is news that would rival the second coming of Christ. It is a simple matter of prior expectations. An open source project built by volunteers taking on a huge established company like Microsoft? Not much expectation of huge wins there. When you are talking about the OS, rather than just the browser, and you're discussing the bread and butter for Microsoft and the hugely entrenched mindshare, well the expectations for an open source project are very low indeed. On the other hand when you're talking about a huge company like Microsoft throwing its weight into a new market, well expectations are that they'll do reasonably well (it certainly worked for the XBox, despite dire predictions prior to release). A 10% market share for the Zune (if it is that high) is notable, but it is below what one would expect for a company with Microsoft's resources throwing itself into a new market. Is there a little anti-MS bias here on Slashdot? Of course! What the hell did you expect?! The Zune is hardly a failure. Still, it is a long way from taking the world by storm, and given expectations its market share is decidedly underwhelming.
  9. Re:sanctions are inevitable on US Opposes G8 Climate Proposals · · Score: 5, Interesting

    Both the Clinton and the Bush administration have implicitly admitted that the US cannot compete in a free market system if the real cost of pollution costs would have to paid. Certainly that's relatively verifiable from a CO2 emissions basis. While not perfect (what data is?) this table provides a rough analysis of GDP with respect to CO2 emissions. The US does not fare well in comparison to many European countries. On the other hand, the US is also far from the bottom, being streets ahead of China. The US is at the very least notably above the world average. Most of the worst offenders in terms of efficiency are former Soviet States that presumably are stuck with primitive industrial infrastructure, and not much of an economy. Given that table, however, there is plenty of other finger pointing that can go on. Canada, which likes to think well of itself, fares little better than the US.
  10. Re:Reinventing the wheel? on Firefox 3.0 Makes Leap Forward · · Score: 1

    The short answer is that it provides more flexibility to do that kind of searching. You could list all the bookmarks with a certain tag, in order of date they were added; or all the bookmarks you added in the last month; or list the most frequently visited bookmarks (which, epiphany supplies as an automatic category). You don't have to use a database to do this, but if you have a bunch of data that you want to query and sort in a variety of different ways then throwing it in a database (if you've got a small light one like SQLite) provides the most flexible and extensible approach.

  11. Re:As long as it's private. on Creationism Museum Opening in Kentucky · · Score: 2, Informative

    No real evidence has ever been discovered (or much less reproduced) that one kind of animal can bring forth an animal of a different kind: i.e. a fish giving birth to a frog. This is, of course, a straw-man, since evolution suggests no such thing. Evolution claims that if enough small steps are made, the result can be that the accumulated change is large. Your suggestion that no-one has ever observed a fish giving birth to a frog is akin to arguing that a journey of a mile can't be made, because no-one has observed anyone teleporting over that distance.

    Perhaps you are hoping for something akin to the "prime mammal" fallacy though? That argument runs as follows: clearly only a mammal can give birth to a mammal, thus there can have been no "prime mammal" to give birth to the first mammal, because it couldn't have been a mammal itself! It sounds good at first, but it is really just playing with semantics. Our classifications are simply an oder that we impose upon a world that has no such order. And often that imposed order isn't terribly good -- for example, genetically the difference between humans and chimps (which are in separate species) is smaller than the difference between subspecies of certain birds. We carve out arbitrary lines through nature that exist only in our own minds. In nature the lines are not crisp, but instead blurred. See, for example, ring species, which provide a continuous range between two separate species. Such continuous ranges stretch back through time as well, over many generations. Moving backwards we would see creatures that were less and less easily identifiable as mammals until the line begins to blur. We would see animals that we would not be able to class an mammals, yet we could neither (using out current definitions) really class them as "not mammals".* Thus there is no "prime mammal" not because mammals don't exist, but because the line blurs, and nature tramples over our artificially imposed order -- there is simply no clear point where some arbitrary threshold (which ultimately exists only in our minds) is crossed, thus no "prime mammal".

    I would suggest that what you need to provide to support your argument, is some evidence that an accumulation of change cannot continue indefinitely. What you need to provide is some reason why generation after generation of small changes must, for some reason, result in change stopping, or reversing. Without such an argument simple induction on small changes is a perfectly reasonable argument to justify eventual large changes being the result.

    * This is the sort of place where intuitionistic logic, which doesn't accept the law of excluded middle, starts to make a lot of sense.
  12. Re:Lying teachers?? on Creationism Museum Opening in Kentucky · · Score: 1

    I agree wholeheartedly with this. Teachers should teach theory as theory, and fact as fact. Darwin's theories are... theories. Creationism is another theory. And the theory of gravity is another theory. I can pick just as many holes in the theory of gravity as you can pick in evolution -- where by "hole" we of course mean "thing that we don't yet have a comlete explanation for". Using ID style rehtorical tactics it is easy enough to write an argument suggesting that the theory of gravity is wrong and that we should instead teach that what we observe is "an uncaused force" and clearly the active hand of God at constant work in the universe. That theory is no more and no less credible than intelligent design, and just as impossible to refute. It is also just as much not science, and just as worthless as an explanation.
  13. Re:As long as it's private. on Creationism Museum Opening in Kentucky · · Score: 1

    Science is only science when someone can perform an experiment and observe results that coincide with their hypothesis. This experiment must be able to be repeated by other scientists. Evolution is not scientific as none of it has EVER been observed (other than changes in a particular kind of animal over time, which is adaptation, not evolution), it is a matter of faith. It is as much science as many other fields of science. Hypotheses have been proposed, and confirmations of those hypotheses have been found. The hypotheses range from predictions of particular kinds of fossil forms (to be found in particular strata) to be transitional; through to predictions of comparative genetic similarity between organisms. Hell, even the existence of genes and DNA was a prediction of evolution, which posited that there must be a mechanism for traits to be inherited.

    And then, as you note, there is the fact that there have been plenty of observations of adaptation, ranging from the small, through to observed speciation. We've even seen new kinds of biological process generated (nylon eating bacteria). You seem to want to dismiss all this evidence by saying it is "just adaptation", however, each such adaptation is a step, and we've certainly seen adaptations that result in organisms that are every bit as viable as their predecessors. Such small adaptations add up, and the result is evolution.

    I might claim that I can get from a point here, to some point "over there" by walking. You might claim this is impossible. If I can take a step away from where I am now, however, and be just as capable of taking a step as before, then that is strong evidence that, despite "over there" being quite a distance away, I can probably get there. By saying that taking one step after another will never allow me to get there, however, you are saying that somewhere along the journey I will meet some obstacle that will confound me taking any further steps in the desired direction. You aren't giving any reasons why such an obstacle exists, however, nor any evidence that it does. You are simply asserting that it must be there because you dislike the conclusion. Give me a reason why the distance can never be covered by a sequence of steps and I might listen.
  14. Re:Reinventing the wheel? on Firefox 3.0 Makes Leap Forward · · Score: 1

    Sure, just have "Uncategorized" as the default tag and anything you don't tag will get dumped in tere until such time as you provide some info.

  15. Re:Bloat or Performance Issues? on Firefox 3.0 Makes Leap Forward · · Score: 1

    Just to add to "If you're concerned about the impact of 250k of memory then you probably have a lot of things you should be worrying about before SQLite inclusion..."

    If you're desperately concerned about that 250k, then you can get it back by using tcsh instead of bash. All you people complaining about bloat are using tcsh (or even csh, or raw sh) instead of bash to save the ridculous waste of memory and bloat right?

  16. Re:Reinventing the wheel? on Firefox 3.0 Makes Leap Forward · · Score: 5, Interesting

    Look, I love firefox, but I can't really think of anything wrong with regular-ass bookmarks. I have no idea why they need to be in a database of any sort. This seems like a bloat feature to me. Obviously you've never used Epiphany's bookmark system, with searchable tagging instead of hierarchical folders. It's rather nice and, due to searchability, you bookmark a lot more pages without worrying about getting an unmanageable mess of bookmarks. The tagging is nice because it lets you associate a bookmark with several different categories (which is pretty common). In general its just a nicer way to work with bookmarks. As to bloat -- you are aware that SQLite uses less than 250k for the entire database engine? That's hardly bloat, and the gains in bookmark management (presuming the Firefox guys put as nice a frontend on it as Epiphany did) are tremendous.
  17. Re:Bloat or Performance Issues? on Firefox 3.0 Makes Leap Forward · · Score: 3, Informative

    But what does "lite" mean. Well according to the SQLite homepage it means that the entire database engine fits inside of 250KiB fully configured, or less than 150KiB with optional features removed. That seems pretty light to me. If you're concerned about the impact of 250k of memory then you probably have a lot of things you should be worrying about before SQLite inclusion...
  18. Re:What they fail to mention on Dell Ships Ubuntu 7.04 PCs Today · · Score: 1

    all true, except the line about photoshop: not to flame about gimp - but it's no photoshop. It's great and all, but (at the moment) it's not even close.
    Some day I hope they get there, but that day is not today. I believe the point is that, for the average home desktop user GIMP and Photoshop are comparable (or, more specifically, GIMP and Photoshop Elements, which is about as much as an needs, are comparable). Yes, if you're a professional, or have very particular high end photo manipulation needs then you'll probably want photoshop. That's a small market compared to the average home desktop user however.
  19. Re:Owning culture on The Case For Perpetual Copyright · · Score: 1

    Interestingly, it also seems that the same proponents fail to see how much they benefited from ideas and works in the public domain. This is rather pertinent, and interesting because it begins to delve into deep philosophical waters. I think a person would have to subscribe to some sort of mystic of dualist philosophy to be able to claim that any ideas they create have any ex nihilo aspect. Any sort of grounded materialist philosophy is going to have to view any new idea as a potentially novel agglomeration of pre-existing/learned ideas and experiences: nothing we create is truly original -- it may be an original combination of existing ideas and experience, but it necessarily draws all material from external sources to create that combination. Of course the sources may be so lost amidst the stew of mental construction that they are uncreditable, but they presumably must exist. So the real question to ask a believer in perpetual copyright is where they think ideas come from, and listen to the mystical pseudo-religious babble you get in response...
  20. Owning culture on The Case For Perpetual Copyright · · Score: 1

    I think the simplest argument against perpetual copyright runs roughly as follows: ultimately our culture is the sum total of ideas and stories that have been told and retold down through the ages; the very idea that culture is something that should be owned by individuals or companies is bizarre -- it is a recipe for cultural stagnation and failure. Ideas are of limited value when isolated, it is only with other people to understand and share ideas that they begin to take on the true value that has bootstrapped mankind to the stage we are at now. It is through language, and the ability to easily proliferate ideas, to see that they are passed down from one generation to the next and expanded upon, that mankind came to be what it is today. It seems a terribly backward step to try and isolate ideas once again.

    Note that I am not proposing a complete "information wants to be free" approach, but the ultimate value of an idea is realised when it becomes freely available to a society, thus any copyright law should include provision to see that this eventually happens. Rewarding the creators of new ideas is a worthy goal, and I cna see a place for some sort of copyright law. That must always strike a balance, however, with the need for ideas to reach their full potential by being released to society to remember and expand it, or forget it completely, as they see fit.

  21. Re:4-year-olds don't understand on What Can 4-yr-olds Understand About Science? · · Score: 4, Insightful

    I think it's great that you understood so much at such a very young age. The issue of what children understand and their cognitive development has been studied however, and I hate to break it to you, but you would appear to be an exceptional case. Skim through the Wikipedia article on Theory of Cognitive Development and you'll get the idea. At 4 most children are still developing a basic cognitive grasp of the world.

    Let me stress (again) that this doesn't mean you can't teach children of that age valuable lessons about science, it just means you have to be careful with your goals. You can lecture the kids on the scientific method, and they'll repeat it back to you beautifully (kids of that age are incredible sponges for information), but that won't mean they'll understand it. I think you'll hve greater impact by playing to their understanding than their remarkable ability to absorb facts. Teaching them that there is more to the world than what their senses tell them, by demonstrating to them (via nice practical demonstrations that they can take part in) that their senses can be easily fooled, is a very valuable lesson. If that goes well you can cover more.

    By all means don't underestimate kids, but overestimating their understanding will be at least as bad. At that age (and with the sort of time frame we're talking about) it is far better to give them questions that they can think about and explore themselves than answers which they may or may not understand.

  22. 4-year-olds don't understand on What Can 4-yr-olds Understand About Science? · · Score: 5, Insightful

    According to the studies I've seen 4-year-olds don't tend to have a very good grasp of abstract concepts, and in general understand a lot less than we tend to think -- we adults take a lot of knowledge and conceptual understanding for granted. That doesn't mean you can't make things educational, it just means you have to be careful with exactly what your goals are. I'm guessing that for 4-year-olds even getting them to realise that there is a problem (that we can be cued to think we're moving when we're not) would be a good start. You can probably do that by tricking them into thinking they are moving and then showing them that they weren't. That's relatively abstract -- that their perception of the world isn't always accurate -- but it is the sort of thing that they are starting to get a grasp of at that age anyway. They might not fully grasp it, but there is also the fact even if they don't get it at the time, such experiences have a habit of sticking around and helping inform later realisations, so make it memorable and it will be good. The sort of dawning realisation that could occur, that the world is stranger and more than it appears, and the idea that people (such as yourself) explore such things, well that's a good way to start a fascination with science and trying to understand the world.

  23. Re:Finally on Experts Now Say JFK Bullet Analysis Was Wrong · · Score: 4, Interesting

    That is true. However, liquid steel was found in the basement of the World Trade Center weeks after 9/11. Some metal that had been liquified was found in the wreckage; there is no reason to believe it was steel (as opposed to some of the many other metals with lower melting points in the building) -- it was certainly not identified as steel by anyone except those who want to believe in a grand conspiracy.
  24. Re:Bickering on 26 Common Climate Myths Debunked · · Score: 1

    I tend to agree. The ecological impacts are likely to be a result of already highly stressed habitats (in fact the IPCC reports say as much) and the real concern is more an economic one. The world is not going to end, but it might be rather expensive and painful to adapt to the changes as they come. I also tend to agree that a market scheme that appropriately factors in what has been an externality up until now (CO2 emissions) is likely to, in the long term, going to be the most effective approach to getting sustainability on this front (I will admit, however, that I can still see some benefit to short term measures to help accelerate the process toward the required new equilibrium).

    A lot of posters here keep railing against the denlialists and the fear-mongers, ut it seems to me that that is largely because they are listening to their own echo chambers which create straw-men of "the opposition". Most people who I've actually had a serious discussion with tends to be quite moderate and reasonable -- I don't always agree with them, but there's plenty of common ground.

  25. Re:Bickering on 26 Common Climate Myths Debunked · · Score: 1

    With reagrd to Milankovitch cycles, the change in insolation is believed to be insufficient on its own to account for the total temperature change that occurred. Of course resolving the remaining change in temperature can be a matter of looking at feedbacks, for example carbon dioxide, which is released from oceans as they warm. A 1% change can, apparently, be enough to kick off a process of feedbacks that results in significant change. The same thing could happen now, just with a different driver/forcing being the initial cause of the later resulting feedbacks.

    How worried should we be? Well doomsday panics are probably a bit silly, but the difference between glacial and interglacial periods was quite significant: New York used to be under ice. Consider that we will be gettign warmer while already being in an interglacial, nd that we are already at 2/3rds of the forcing required to kick off such a shift -- it seems likely that things will change significantly. There's also the issue of rate; how quickly the solar forcing changed with orbital variation is a matter I am not clear on, but it may well have taken rather longer than 150 years to produce that full 1% change in insolation.

    So the summary is: panic wildly? No, probably not. Be concerned and try to take action where possible? Certainly seems sensible.