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

 



Forgot your password?
typodupeerror
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:Survival Mechanism (Score 1) 339

It's not like charismatic people need to be put *somewhere* in any given company. There are plenty of unemployed people. If they were actually so bad for these companies to warrant putting them in the positions of least harm potential, we may as well make all the humble unemployed people CEO's, and fire all the narcissistic CEO's to reduce harm even further.

Comment Re:Indeed (Score 1) 315

There are different types of simplicity. There is simplicity involved in creating something and the simplicity of using it, and these 2 things are often opposed to each other. Raw pointers are simpler to create than smart pointers (the language feature, not an instance). They are easier to understand than smart pointers. They are harder to use correctly than smart pointers. How many bugs are a result of improper pointer use?

And if you look at code that uses raw pointers and the same code that has been modified to use smart pointers, the code that uses smart pointers will look simpler. It will look the same minus all the delete/free calls, and minus some NULL checks.

So yes, smart pointers are more complex in some sense. But if you consider the problem of enforcing the proper use of pointers, rather than just deferring that problem to the next programmer, smart pointers are a very simple solution to this problem (e.g. as opposed to something like garbage collection).

Not solving problems is simpler than solving them. I am all for not solving problems that don't need to be solved. But preventing pointer misuse seems like a problem worth solving, and it is solved elegantly with smart pointers.

This is just one example of something you can do with a more complex language like C++ that you can't do in C.

Comment Re:Indeed (Score 2) 315

I don't think you can call yourself a C++ expert and be "totally unable to deal with" a C++ codebase that uses a different subset of C++ than what you would have used.

You can certainly be a C++ expert and be totally unable to deal with a very poorly designed codebase, but that is true for every language (even C).

Maybe there are more experts in the C language, because it is a simpler language and therefore an easier language to become an expert at. I would be totally in favor of using a simpler language for a project if there were no benefit to any of the more advanced features provided in C++, but that is rarely the case.

The 4 things I listed are insanely powerful tools for making safer and more maintainable code, and these things come with little to no performance overhead.

Comment Re:Indeed (Score 4, Informative) 315

It also has good features, many of which provide you with an alternative to the bad features of C.

Constructors/destructors (RAII) > manual initialization/deinitialization.
Smart Pointers (made possible by RAII) > raw pointers
Polymorphism > function pointers
Templates > macros

If you are subscribing to a streaming movie service and you have the choice between netflix and a site that only allows you to watch "Armageddon (1998)", does it make sense to choose the latter because netflix has more bad movies? No of course not, because you don't have to watch the bad movies on netflix, and you can even choose only to watch movies better than Armageddon.

C++ is netflix. Nobody watches all the movies. Everyone watches the movies that are good from their point of view (even though many of those people are just wrong).

Comment Re:The Electric Graduate Student (Score 1) 239

That doesn't mean it's not hard. That just means it's a hard thing that no one needs to do anymore for any reason other than... educational purposes.

I'm not saying not to use the tool. Use the tool. Maybe running as fast as Usain Bolt is hard for some people. I use a tool called a car. Running is super easy for me.

Comment Re:force them (Score 1) 239

Running isn't hard either. Most people can run. It's only hard when you say something like "You need to be able to run a 5 minute mile". Some math is not hard just like some running is not hard. If you lower your standards enough then you can make it so math is not hard for 95% of people. You can also raise your standards enough to make it hard for 99.99% of people.

Even seemingly simple things like algebra can be really hard. I have had many calculus classes where the actual calculus wasn't so difficult, but the algebra was a nightmare. There is also nightmare calculus as well.

Comment Re:Here's an idea (Score 1) 360

I've been to a few theaters that are basically restaurants, with menus waiters, tables, and reclining chairs. I thought it would be annoying to have everybody ordering and eating food during the movie, but the seats were far enough apart to not be very distracted but what other people were doing, and the cost was probably high enough to preclude idiot teenagers and adults who act like idiot teenagers.

I don't really go to the movies anymore because I have 2 screaming babies, but once a year when we hire baby sitters and go out, I appreciate the more luxurious experience. I am already blowing at least $100 on a babysitting, trying to save money by being next to some middleschool shithead talking loudly through the whole movie seems like a waste.

I don't need super crazy sound. I don't need 3D. I just want some comfortable chairs, good food, low distraction.

Comment Re:My gripes with the first 2 (Score 1) 548

I guess it depends on what you consider an "error", which can depend on context. I am definitely more comfortable with the statement "Returning Null to indicate a catastrophic failure condition is unacceptable". I am currently unaware of any languages that do not allow you to abort ( or something equivalent).

The original article's problem with returning null, was the requirement to check the return value for NULL that is created. And yeah, I agree that's not ideal, but my point was that there is not *always* a much better alternative (i.e. *sometimes* it is acceptable).

Furthermore, there are ways of indicating an error other than returning NULL that still require a check equally as onerous(and easy to neglect) as a NULL check. So the problem isn't just returning NULL, but error-prone error-handling systems in general.

Comment Re:Start learning encryption if you haven't alread (Score 3, Insightful) 325

You can easily protect data with encryption. It's harder to protect meta data. For example: with proper encryption we may never know what Devin Nunes was actually watching on pornhub. To actually hide that Devin Nunes was on pornhub requires something like TOR or a VPN.

Comment Re:How? (Score 1) 325

Some might abstain from selling customer data. But there are lots of politicians and lots of ISPs. Surely *some* family values congressmen will get disgraced as perverts. We may also catch some of them googling stuff like "How to launder money" or "How to discreetly ask for a bribe" buried deep in all the internet porn searches.

Comment Re:Be open minded (Score 1) 548

There certainly is some truth to it, but it is a bad argument against mechanisms that prevent mistakes.

Unfortunately, everyone makes mistakes. This is why such a huge amount of software development effort is put into mechanisms preventing human errors that would otherwise have occurred. It's not like these mechanisms are just for the bad programmers, and Knuth and Dijkstra don't need to use them. It also frees human time for real problem solving that would have otherwise been spent bug hunting.

Slashdot Top Deals

Refreshed by a brief blackout, I got to my feet and went next door. -- Martin Amis, _Money_

Working...