Become a fan of Slashdot on Facebook


Forgot your password?
Back for a limited time - Get 15% off sitewide on Slashdot Deals with coupon code "BLACKFRIDAY" (some exclusions apply)". ×

Comment Re:Slashdot would lynch him alive... (Score 1) 519

the supposedly rabid atheists around here who "bravely" stand up to those "totalitarian oppressor" church-ladies on here have a huge blind spot / sick fetish for the most hard-core Islamic fascim you can think of.

Then they're not really rabid, are they?

As for me, no, I'm like quite a lot of atheists who think Islam is the problem and there's no way to "fix" the religion. Nice attempt at trying to manufacture a hypocrisy where none exists, though.

Comment Re:C++ is... (Score 1) 153

Resource cleanup is useful both with and without generic programming. You can write typesafe (this has a specific definition), generic code with manual cleanup or with automatic cleanup.

But generic programming is not useful without resource cleanup. Generic programming algorithms, as I keep saying, relies on value semantics. If the algorithms are working on things that, say, have mutable state, then the generic algorithm breaks. Value semantics means type safe automatic resource cleanup becomes a necessity and thus should be included in the definition. People only resist it because it would mean their language can't be generic.

For example, a std::vector is typesafe, in that you can't have type violations (unless you screw with casting---C++ isn't the best example), generic in that it works for all T, but it won't clean up whatever those T*s point to.

No, that's why you store objects in vectors, not raw pointers. If you store objects in vectors, it will clean up all Ts, including smart pointers.

Plenty of languages implement generic programming with reference semantics just fine.

No, they don't. eg Java's generics aren't generic. They're just syntactic sugar for type casting.

Except it is, using the definitions of "generic" that everyone else uses.

"Everyone else" uses incomplete definitions of generic. It's incomplete given the experience of generic programming, namely in C++. Your "generic vector" does not allow generic algorithms to operate on them because of reference semantics and non-generic resource cleanup.

It's not about care it's about parameterization over types. And you can certainly parameterize over types in C, with sufficient effort.

The parametrization is incomplete if it doesn't include type-aware cleanup (and copy and move and even swap).

Picking one example resource out does not make my example incorrect. So well done for ignoring the point and making a tangential, irrelevant criticism rather than addressing the point I was making.

Really? But you thought nothing of reducing "resource management" down to a leaked memory strawman completely irrelevant to the larger picture of value semantics. I love when people accuse me of apparently doing something when they were the ones to actually do it first.

Comment Re:C++ is... (Score 1) 153

Type safety is something quite specific and doesn't in any definition I've seen include resource cleanup.

Which is my point. Just because it's overlooked such that it doesn't figure into other people's definitions doesn't mean it isn't necessary. We have a lot of experience with generic programming, and resource cleanup has been found to be a requirement.

not whether you run out of memory because you forgot to free something.

Memory cleanup is only a small part of resource cleanup. This point has been repeated to death.

But C idiomatically tends to work with pointers more, which are really reference semantics. I mean sure you might leak if you're not super-super careful but you can get type safety and genericity in C.

Which is why actual generic programming isn't possible in C, because it can't emulate value semantics for complex types. If you have to be super-super careful, then it's not generic.

Comment Re:C++ is... (Score 1) 153

Resource cleanup is definitely part of generality. I would argue even part of type safety. Just because it's overlooked doesn't mean it isn't a crucial part of it. Clean generic programming is only really possible with value semantics, and value semantics means resource cleanup for non-trivial types.

Comment Re:Fossils (Score 1) 208

Darwin's work heavily depended on Lyell's ideas of geology, including the idea that geological time is slow. So it doesn't matter if it doesn't get a mention until later chapters. The book was written to make a convincing argument so that it was hard to deny (hence starting of with artificial selection), not list things in order of importance.

Comment Re:Wrong measure (Score 2) 208

Random mutation is long-term. But when a selection event happens, the "hidden" trait isn't created, but selected for. There is no "evolution", but a selection pressure that reveals the previous mutation as a preferential trait

That IS evolution. What else do you think is meant by evolution by natural selection?

Comment Re:Fossils (Score 1) 208

Try reading again:

Senior author Professor Greger Larson said: 'Our observations reveal that evolution is always moving quickly but we tend not to see it because we typically measure it over longer time periods. Our study shows that evolution can move much faster in the short term than we had believed from fossil-based estimates. Previously, estimates put the rate of change in a mitochondrial genome at about 2% per million years. At this pace, we should not have been able to spot a single mutation in just 50 years, but in fact we spotted two.'

The reason why mitchondrial measurements used long time frames was because of the mindset carried over from fossil estimates. The senior author himself says so in this quote from the article.

Space is to place as eternity is to time. -- Joseph Joubert