Become a fan of Slashdot on Facebook


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

Comment Re:A new fad? (Score 1) 271

Kind of seems like a large amount of work for the holy altar of Don't Repeat Yourself. What kind of advantages do concepts (or even templating) give besides algos that can operate on superficially similar data structures?

That's useful enough by itself, of course. Especially if, for example, the "thing which could be repeated" is huge, like an XSLT engine which has to work both on UTF-8 and UTF-16 data.

Then there's ability to separate mechanism and policy with zero run-time overhead.

The grand vision, though, is product line engineering. Real programs often do not stand alone. They are one of a suite or line of products, all of which differ in subtle ways. Templates give you a way to manage those differences in a principled yet efficient way.

Comment Re:Fairness has a role (Score 1) 277

I don't really understand your point. Is it that govts can intervene and tell you to sell at a different price?

The OP was arguing that you can charge what you like for your product regardless of whether the price is fair or not: as long as people are willing to pay it you can charge it. My point is that you do have to factor "fair" into your pricing at some level. If you completely ignore it then you will annoy enough people that governments will eventually act, especially if your profits rely on an artificial monopoly created by those governments' laws.

Comment Re:Still no template definition checking :-( (Score 1) 271

Yes. That's the nature of STL concepts. Unlike Haskell typeclasses, it's not enough just to see that there are operations with the right types, because STL concepts are often defined in terms like "this is a valid expression, which returns a value convertible to bool".

Comment Re:Sounds overly complicated (Score 3, Insightful) 271

The key difference between this and interfaces in Java [...] that algebras in Java are single-sorted, whereas in C++ they are trying to be more multi-sorted.

The primary purpose of an algorithm (or a program, for that matter) is to transform data from one form to another form. Simula-style object orientation, as you find in Java (and in the OO part of C++), associates operations with a single type. This is the least-common and least-useful case, because the interesting parts of programs almost always involve more than one type.

One key thing about the C++ concepts proposal that a lot of people miss is that it many templates have more than one argument. So it's not just a single type we're talking about here, but also associating related types.

So it's not just "adding an interface after the fact". (Although that's a useful feature in itself; how many times have you needed to "decorate" a type from a library whose source code you don't own?) It's bringing the concept of a "class" closer to what that word actually means.

Of course, Haskell's typeclasses are even better.

Comment Fairness has a role (Score 1) 277

'Fair' is where you go to sell your pig, not the means by which you set the price.

That's only partly true. If your pricing is extremely unfair and what you produce is essential to people then governments can get involved and laws get changed to cut you profits, especially if you rely on those same laws, such as copyright and patents, to create artificial monopolies. This is happening with the pharmaceutical industry.

In the past Canada has threatened the patent protections of some firms and more recently the US seems to be finally waking up to the crap that these companies are pulling. So while you may set your price at a level that you think you can get away with, perceived fairness is a factor in what you can get away with and you ignore it at your peril.

Comment Where there is money there is a way (Score 1) 277

The fact that it's only sold in the App store now?

In which case you just connect to the app store for that country from wherever you are - I have accessed the Canadian store from Europe and the US without a problem in the past. If they eventually block that then you go through proxy and if they try to stop those they just end up playing whack-a-mole. Getting the money to the right store would be the hard part but if someone makes it worth their while I'm sure there will be resellers shipping iTunes gift cards to wherever the software costs significantly more.

The only way to preserve a price difference between two markets is to make the cost of getting around whatever barrier there is more expensive that the difference in price.

Comment Electrons (Score 1) 476

So how does this work? Is a domestic consumer is given an electron which has passed through a wind generator, there is going to be hell to pay, but a different pool of electrons must be used to export power from the state.

And sure, with a mix of energy sources, local consumption can be less than generation from coal.

Comment Re:They took the worst part of Python (Score 1) 189

Working in C years back I had to fix some code from a guy who pasted 1500 lines from a different application into the middle of an if statement block. He didn't even have the decency to wrap a function definition around it. It was just splurged into the code. It seemed to work fine but even with the parenthesis matching function in nedit it was hard to work out what block I was in.

In that case python would break, because the compiler reads the nesting level the way humans read it.

Slashdot Top Deals

As in certain cults it is possible to kill a process if you know its true name. -- Ken Thompson and Dennis M. Ritchie