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

 



Forgot your password?
typodupeerror
×

Comment Re:*Big Whiff* (Score 1) 107

The students aren't to blame when every single adult in their life is telling them that they have to must a college degree to be a real adult, or when curriculum they should have been taught in middle school is deferred to college. The educational industrial complex, together with widespread classism, has duped these kids before they even have a chance to figure it out for themselves. Heck, we often force them to plan out their own future financial destruction before they even have their first part-time job.

The only solution is to starve the beast. I support wiping out college debt if we *also* outlaw college loans. Pay out of pocket, get a grant, or learn a trade skill and support a family 4 years earlier.

Comment Re: Bad practices (Score 1) 154

As an addendum: in the above example, I said the pointer is not leaked. This is strictly true. But it can lead to a reference to a destroyed object (what you would call a NRE in Java and C#). Thanks to RVO/NRVO, this is much, much less of a concern. If you have a factory function that creates a PBar object, you can create it on the stack in the function, return it as an unadorned PBar, and it will be guaranteed to be returned by the function without being popped off the stack just for leaving scope. This works even if the backing pointer is std::unique_ptr.

Comment Re: Bad practices (Score 1) 154

getBar() doesn't leak because the backing variable bar is not a pointer. It will be allocated and deallocated with its parent Foo object. Nine times out of ten, this is probably the best thing to do.

But if you DO need bar to be pointer to Bar, and you need to return a reference to &bar as Bar*, then that is where the PIMPL design really shines. The wrapper object (of type, say, "PBar", for example) can passed and returned by value 90% of the time with no performance penalty, thanks to copy elision and RVO. This brings you a step closer to writing code just as expressive as Java and C# without littering your code with std::unique, std::forward, std::swap, et al. If the PIMPL is backed with std::unique, you have the added advantage of single-ownership being strictly enforced at compile time. You wouldn't ever pass around Bar, at that point, just PBar. If you need perform mutative operations on the backing Bar object, you would integrate that functionality into PBar.

For me, though, hiding smart pointer boilerplate is only the second-best thing about PIMPL. The best thing is having a place to put custom allocation: std::allocator performs very poorly in applications with a lot of memory churn.

Comment Uncomfortable facts (Score 5, Insightful) 94

1. Microsoft is the largest contributor for open source.
2. The Linux kernel includes code contributed by Microsoft.
3. The Halloween email was twenty years ago. No one on the email chain works at MS, anymore.
4. FOSS beat Microsoft. SCO is dead. The genie cannot be rebottled. Rather than shakes their fists at the sky, MS chose to adapt to the new landscape. This has understandably robbed some people of much-anticipated schadenfreude, as MS seems to be doing quite well.
5. It will never be the year of Linux on the desktop, because the desktop is not important.

Comment Re:And the US Pound too, in certain sense (Score 1) 157

IMXP, Imperial is only used in household, day-to-day stuff. Driving, groceries, recipes, and hanging pictures on the wall. In college, we exclusively used metric in anything math & science-related. That was 20 years ago. When I started grade school 35 years ago in the worst school system in the country, we were still taught both sides of ruler.

I'd say we're more "dual-system" than imperial.

Comment Code, no don't. Engineer? Yes, you do. (Score 3, Insightful) 354

I used to think my degree was worthless because every boss I've ever had in the industry either didn't have a CS degree, or had no degree, at all. Then I realized that much of my workplace recognition over the years was due to the fact that I had a pretty good handle on CS trivia: algorithmic proofs, grammar theory, assembly and all that attendant side knowledge like bit math, etc. So no, I no longer regret getting a CS-degree.

My thinking shifted even more when, 15-20 years later, a lot of new hires I have to mentor learned to code at camp. Let me tell you: they are somehow worse than other folks with no CS-degree. At least an unschooled hacker has that self-motivated spirit that compels them to be competent. All code-campers have is a terrible case of Dunning-Kruger.

Slashdot Top Deals

According to the latest official figures, 43% of all statistics are totally worthless.

Working...