Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 Internet speed test! ×

Comment Re:Sounds overly complicated (Score 1) 339

I don't think your break down is what this is really about, although perhaps I'm misunderstanding you. There are few concepts (cough...) at play here. One is whether the language itself supports a notion of duck typing or not. Java generally doesn't. You must explicitly implement an interface to adhere to it, and even if your class has methods which do implement it, the compiler still will generate an error or the runtime a class cast exceptions if you attempt to treat it as the desired interface.

If you were to implement concepts in java, I imagine it would have to be permitting a cast as mentioned above by the compiler, rather than treating the types as different. Note that both interfaces and concepts have same compositional power, except that concepts end up being more flexible, as you are generally only enforcing the type in the scope of a particular algorithm, not a class, even if many classes end up supporting the concept.

Back to C++ land. Templates in C++ incidentally fit into a duck typing oriented model, *unlike* Java. Thus, concepts almost existed to provide order to somewhat unwieldy compiler errors from the template system and provide explicit design clarity for those implicit utilizing concepts previously.

Finally, IMHO, modules (and module signatures) implement the idea of concepts quite elegantly (eg. in OCaml).

Comment Re:As a C programmer (Score 3, Interesting) 315

People struggle with pretty much every language, it's just that the bugs are different in each.

Sure, but I would argue some languages are dominating strategies over others. There are bugs which simply don't exist in some languages but do in others. Like null pointers or references do not exist in OCaml (instead, you must use the optional type explicitly).

Slashdot Top Deals

"No matter where you go, there you are..." -- Buckaroo Banzai