Catch up on stories from the past week (and beyond) at the Slashdot story archive


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

Comment Re:There Is No Rivalry (Score 1) 265

Yeah, because we've never sent anything to Mars before. Tell me about something that is not just a cheaper version of something that's already been done. I'm talking about LEADING the way. It's much easier to do something once the costs and issues are known and you can estimate profits - and Mars is well known. Still waiting on corporations doing something completely unknown.

Comment Totally expected it (Score 0) 566

That the MRA types would take an article reporting a law suit that ALLEGES, as though it were already established fact. Because apparently being sued for something means it must already be true without having the claims tested in court. But hey, whatever you need to start foaming at the mouth over dem feminazis.

Comment Re:Don't forget all that legacy code. (Score 1) 531

What would originally be a simple bulk deallocation now requires calling ~2 destructors per entry (one from the main object, one from shared_ptr).

But what was the actual cost of the main object constructor? All it has to do is call the shared_ptr destructor. Did the compiler not optimize it away enough?

And by bulk deallocation, how would that have been possible if you didn't use manual deallocation for each object in turn anyway? Would you have implemented the struct with the data embedded in the object, without an extra indirection? Or maybe put that data in its own vector/array, as is common in graphics/games programming? If so, they should have done that whether or not there was shared_ptr. It sounded like more thought needed to be given to the data design, rather than the fault of managed memory.

shared_ptr also requires a thread-safe reference count, which is a slowdown in itself.

Assuming an inherently multithreaded process, if you are sharing ownership of an object amongst threads, you would want reference counts to be atomic. If ownership is not shared - you shouldn't be using a shared_ptr.

I'm certain you can avoid most of the slowdown with shared_ptr if you already know what can happen, but there's still a developer who uses it without knowing what will happen ahead of time.

It sounds like the problems started out with an ignorance of data design and the purpose of shared_ptrs (ie, declare shared ownership rather than a catch all for Java-like allocation of objects).

Comment Re:Memory-unsafe is a BS meme (Score 2) 531

And yet, the compiler that Linux uses is now written in... C++ and in the process of converting C style code into C++ style where it makes sense. Because the C code was too unwieldy. Linus wrote his original dive log program in C + GTK, and then was forced to switch to Qt because GTK's attempt at OO made everything unmaintainable.

LLVM and Clang are written in C++ also.

Wrapping things in abstractions is necessary and is done in the Linux kernel all the time with macros, which are less maintainable and more impenetrable than templates. There certainly are things in the kernel that would benefit from being templated rather than macro'd.

Comment Re:Don't forget all that legacy code. (Score 1) 531

I tried using some of the "safe pointer" stuff - depending on which one is chosen, there is a performance hit depending on which safety mechanism you choose. For example, the auto-deallocate safety net slows things down a lot, while bounds checking tends to be less of a problem.

With shared_ptr, the performance hit is with the reference count updating, so you should still pass a shared_ptr as a reference when possible.

With unique_ptr and the std containers (of movable types), I can't imagine the auto-deallocation would cost any more than manual deallocation in C since they are really just the equivalent of one manual deallocation call.

Comment Re:Just like Citizens United (Score 1) 843

So your argument is that we must be hypocrites or "phony" or "selective" if we don't just lie down and take it.

How about this? We regret this route was taken, but that's what you get with CU.

Or how about this? We heard it was right that money = speech. But now that we've wisened up and decided to play your game against you, now you're all butthurt about us not lying down and taking it.

Comment Re:Already approved (Score 1) 69

Yes, it was invented through a fear of learning and incompetence. It's literally designed to handhold the developer and limit the features that are useful, like multiple inheritance and operator overloading. And it certainly didn't (and I would argue, still doesn't) handle resource cleanup especially well - it's not just about freeing memory safely and reliably, which C++ does better than Java, even before smart pointers, but also other resources like locks, instead of relying on the programmer to remember to release locks etc.

Yes, Java has become a bedrock of enterprise development. But that's because enterprise development is boring and enterprises generally don't like to hire competent people or use state of the art technology. That's why enterprises require LTS versions of stuff and stick with J2EE instead of going to EE 7 or whatnot.

Just a few weeks ago, there was an article posted here about Java 8 features like streams and lambdas. The reaction? Most people hated it. Gee, you don't think fear of learning and incompetence may have something to do with it? I, as a C++ developer, learnt Java 8 streams and lambdas and was writing "enterprise code" in a day with it. It was super simple and made complex things super simple, and yet people were nitpicking the syntax only because they were unfamiliar with it but tried to hide their fear by saying "it sucks" etc. I only need to see the attitudes of programmers themselves regarding new features that you can see a culture of fear of learning and incompetence.

Comment Re:Already approved (Score 1) 69

I certainly don't. It played a large part in cementing a culture where programmers learn to hate having to learn advanced parts of a programming language, and then, due to their own limitations and fear of learning, decide it's better to create yet another program language that has its own set of problems that either their parent language had solved in advanced features, or they reinvent the car crash from another language.

Comment Re:Religion of Science (Score 1) 527

But if one does call in, the officials certainly would listen, check the footage for the player the tosser is claiming has an infraction, and decide if it's a prank or not.

Yes, and that's what also happens in science discussions too. People with the knowledge can decide if the person is "pranking" or otherwise unqualified and dismiss their claim. The thing about golf tournaments is that only golf enthusiasts would call in - it's self selecting. But with science, every precious snowflake has decided their ideas are worth as much as someone who dedicate their life to scientific research.

Nobody checks their claims, until the clamor builds to a roar.

Yeah they do. And every crackpot theory has been found wanting, and even debunked multiple times. But all a precious snowflake has to do is to disregard to explanations given and just repeat and repeat. So then the mainstream science crowd are pretty much justified in insulting the peope who, frankly, started the insults first by pretending that their uneducated opinions are equal to scientists.

Slashdot Top Deals

Despite all appearances, your boss is a thinking, feeling, human being.