Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Comment Re:Given how C++ is taught. (Score 4, Insightful) 345

"Smart pointers" are great -- if you don't care about performance (in which case, why are you not using Java?).

Since when does Java's performance even come close to C++'s in benchmarks? C++ performance is generally very close to that of C's, and in some cases exceeds it (example: qsort vs. std::sort - C++'s use of templating allows for inlining of the sort function code)

Smart pointers have very, very little overhead. The worst is std::shared_ptr, and it's still only adding a reference counter, and that's only used on pointer copy and deletion. And if you have a use case that requires std::shared pointer as your smart pointer of choice, then this is counting that you'd have to be doing anyway in some form or another.

  From the benchmarks I've seen, most people see about an additional 5%-ish overhead in debug mode with std::shared_ptr vs. raw pointers in pointer-heavy code. In a release build there's generally no measurable effect (the difference being, in debug mode it can't inline the dereferences).

Comment Re:Knowing when not to (Score 1) 345

Quite true, with a caveat. Each feature in every language provides a balance of power to the developer versus a learning curve and potential gotchas. Different programmers will have different balance of opinions on where each feature lies on this spectrum. Each must decide in each case, "is this worth it to me for any potential difficulties I may encounter, and what about any others who work on this in the future?" (each alternative option will also bear such decision-making). There is rarely a single hard, fast rule to determine "use this, don't use that". Consequently I personally recommend to each coder that as they learn of a new feature, they try it out (in a personal project or little task, not some big critical system) and see what role it has on the development process and the maintainability of the code. Some may be overwhelmingly positive. Others may turn out to be overwhelmingly negative. Only experience with the feature can help one determine that.

In my case, I've had good enough experiences with most C++ features that unless I know that a project is also going to be worked on by people who are C++-phobes, I find that they're well worth using. But even in my case I've come across features that I wouldn't even use in personal projects. For example, once several years back I tried out std::transform extensively in a hobby program I was writing - by the end I was convinced that, at least in the sort of use cases I was encountering, it only serves to complicate code, increase development time and decrease legibility. I went back in and modified all of the code to use "for (auto i : list)" loops, and contrarily was very pleased with the result - it led to something that even a C++ novice could understand while simultaneously reducing code size and improving code clarity. So guess which I avoid today and which I use extensively? ;)

But there are no hard, fast rules, and reasonable coders will of course differ.

Comment I have a theory (Score 2) 292

Stats from the last congressional election:

o 14% approval rate -- that was a poll
o 94% re-election rate -- that was actual voters.
o In the same election, national turnout was 36.3%.

I think the advent of the net's new accessibility to information outside of the laundered and agitprop driven channels, the money-based reasoning of SCOTUS, the lobbyist factor, the obvious malfeasance of Fox news, MSNBC, the blatantly unconstitutional legislation coming out of congress... and so on... all combine to give a very large portion of the people who might otherwise vote a sense that the system is so massively corrupt that there just is no point to it.

When you ask them -- polling asks them -- they tell you that. That's why the 14% approval rate.

But the only people voting are the droolers who watch MSNBC and Fox. They're agenda- and plank-driven (abortion! guns! perverts! terrorists! taxes! etc.) and that's driving them to or from one party or the other. And *they* are controlling the narrative here; that's why the polls just aren't -- and won't be -- working in the current context.

It's just an idea. But the data is hard data. Something has to explain it. It's too skewed to be any kind of random happening.

I actually do vote, but I have to say, it's pretty damned fruitless. This is a red (very red) state, and so that's the way the pendulum swings here, regardless of how I vote. If I vote progressive on something, it's not going to happen. If I vote conservative on something, it would have happened any way. This is not encouraging.

The only thing less productive than voting for progressive ideas here is voting for a third party candidate. Neither one does any good at all in terms of biasing the political system, but at least the progressive vote isn't buried or simply not mentioned. Sneered at, I think might be the most accurate term around here, actually. But they at least talk about it.

Comment Re:This is great (Score 3, Interesting) 163

Of course it saves the rhinos. You put 100 times more fake stuff on the market and the price for rhino horn collapses, meaning people stop hunting them.

The brilliant part is that this makes use of something that's normally a bad thing - China's extensive peddling in fakes - to achieve a good result. I doubt it'll stop the really high end of the market, the sort of people who would instruct their buyer to send what they buy sent off to a lab (I don't think some rhino DNA alone would fool a lab, surely it looks different under microscopic examination), but for the rest of the market, it's a neat idea.

Comment Re: Nothing that money can't buy (Score 5, Informative) 65

Why do you think over a dozen observatories have been built there? Think it's cheap to sent giant pieces of delicate scientific equipment from the mainland? TFA doesn't even mention the actual reason why Mauna Kea is one of the best places on the planet for optical telescopes: seeing conditions (aka, how much celestial objects "twinkle" on average. Outside of deep Antarctica (Dome A, not far east of the South Pole), there's no other better known location on the planet (a couple are pretty close, like La Palma and La Silla, but none exceed it). Good seeing requires high altitude with the area around being as perfectly flat and uniform as possible for hundreds of kilometers.

For optical telescopes, seeing is the most critical factor for resolving fine details. And this telescope is all about resolving fine details. Adaptive optics help counter seeing problems, but the better your seeing baseline, the better the final result.

Comment What portion will get it "free". (Score 1) 277

It seems that the author and /. still believe that hobbyists, pirates and hackers make up a significant fraction of the total number of PC users. Regular people and businesses buy new laptops and PCs all the time, and they will not be getting Windows 10 "for free". MS knows they will get just as much money, and probably save a bunch by no longer fighting with this comparatively small number of users.

Comment Re:Do not... (Score 0) 290

If you want to open a business in a free country like the United States and advertise your business as a communication platform there is NO problem requiring that business allow open communication by all.

"Private." "Requiring." I do not think those words mean what you seem to think they mean. Free speech, as the constitution mentions it, applies to what the feds are not allowed to do with regard to the speech of the citizens. It's not a mandate enabling them to force the citizens to participate in things they aren't interested in. It just means that the government can't stifle you. A private entity is something else entirely. You may not like it, but there it is.

You should go read Facebook's terms of service. It'll be educational. I promise.

Slashdot Top Deals

Testing can show the presense of bugs, but not their absence. -- Dijkstra

Working...