Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

Comment: Re:Answer (Score 1) 318

by Grishnakh (#49789803) Attached to: How Much C++ Should You Know For an Entry-Level C++ Job?

So yeah C style C++ can be real crap.

It's better than C++ style C++, which wouldn't even work in a hard real-time system.

But I would prefer to see straight C used in these systems instead. I worked briefly on a project to compare an existing C++ system with one done with straight C and the SLOC was vastly smaller, and even the memory footprint was significantly lower. I don't think it's even that C++ itself can't be written tightly, it's that the C++ stuff has gotten really bloated by the way they define requirements and architect the systems; automatic code generation with DOORS doesn't help at all.

Comment: Re:Answer (Score 2) 318

by Grishnakh (#49787129) Attached to: How Much C++ Should You Know For an Entry-Level C++ Job?

*shudder* Are avionics really written in C++?

Yes, but only a subset of it. Things like exceptions aren't allowed.

Is memory deterministically pre-allocated in such systems? That would certainly make it safer, but less flexible.

Yes, that's the whole idea. They aren't meant to be flexible, they're meant to do exactly what they're designed to do and no more, in a completely deterministic fashion. These systems aren't all things with UIs, they include all kinds of systems on an aircraft, which frequently don't have any UI at all except maybe some switches. On a car, an ABS computer would be a good example of one of these systems. There's no display or UI or anything of the sort; you just plug it into the car, and it sits there monitoring wheelspeed and brake pressure and when it sees a wheel locking up it releases brake fluid pressure to that wheel (it's a bit more complex than that, esp. on cars with dynamic stability control and traction control where these are all tied into the ABS, but this is the general idea). A system like that doesn't need to free memory, it just needs to allocate what it needs when it powers up, and then run its program continuously, monitoring inputs and controlling outputs (implementing transfer functions etc). All the tasks it'll ever have to do are well-defined, and all start up when the system powers up, and all get a timeslice.

Comment: Re:Answer (Score 1) 318

by Grishnakh (#49786853) Attached to: How Much C++ Should You Know For an Entry-Level C++ Job?

And you never run out or memory since you've got an infinite amount of it?

If you did things right, you never run out of memory because you've planned every allocation and you have enough for them all.

Minimizing memory allocation/deallocation is a must, sicne these are functions with unknown and unbounded latency

Right, that's why they allocate all the memory up front and never deallocate it.

Comment: Re:What a guy (Score 2) 375

by Grishnakh (#49785799) Attached to: Obama Asks Congress To Renew 'Patriot Act' Snooping

Perhaps the presidency changed him, or perhaps his campaign was a lie to co-opt the enthusiasm of the masses. I don't think we'll ever really know.

What a rube. Anyone who has more than one digit in their IQ knows the answer is the latter.

Well, there is that theory about newly-elected Obama being sat down and shown a video of the JFK assassination, from a completely different angle.

Comment: Re:How to read f*ucked up code (Score 1) 318

by Grishnakh (#49785737) Attached to: How Much C++ Should You Know For an Entry-Level C++ Job?

I'm looking, right now, at a mountain of code, some 20+ classes, many with file-scope instantiations, every single fucking object a Qt object. The original developer noticed that the code for Qt-derived classes won't compile without a copy constructor so he very cleverly made empty copy constructors for all the classes so that even a shallow copy won't be performed. As expected, he also stores instances in containers - which means every now and then the program would give incorrect results with seemingly no predictable occurrences. It doesn't crash, mind, just gives incorrect answers.

Qt is an excellent library. I'm using it now on a personal project, and a lot of embedded systems use it. It sounds like the code you're looking at was written by someone completely incompetent. Qt does not need a copy constructor to compile a Qt-derived class. However, when you're doing a Qt project, usually most of your objects will be Qt objects. That's the whole idea: Qt is basically an extension to the language, and it's easier when you jump in and do everything the Qt way, including using Qt's containers and other base classes.

Comment: Re:Answer (Score 2) 318

by Grishnakh (#49785587) Attached to: How Much C++ Should You Know For an Entry-Level C++ Job?

C++ is not C. C++ written like C tends to be crap code

You might want to avoid flying on commercial airliners then, because they have lots of avionics systems running C++ code exactly like that, with exceptions explicitly banned. Countless other embedded systems are the same way.

never, ever, worrying about cleaning up at the bottom of a function what you allocate at the top.

In these embedded systems, the "delete" keyword is also banned. You're never allowed to free memory once it's allocated.

Comment: Re:And I'm the feminist deity (Score 1) 434

I agree completely. Another useless bachelor's degree is Philosophy. It's a useless Master's degree too. I had a roommate in college who got a Master's in Philosophy. I'm not sure what he ended up doing, but I'm pretty sure it had to do with moving back home with his parents in their little town, and had nothing to do with philosophy.

As for a bit of socialization and practice and managing one's life, you can do all that at a local community for far less money than a 4-year university. The big thing you seem to get, socially, from a 4-year college is the whole dorm experience in your freshman and maybe sophomore years. I do think this is a good breaking-away-from-your-parents experience (it was for me), but does it need to cost that much money?

It does seem that our entire society needs a re-think on all this stuff.

Comment: Re:US rail system (Score 1) 288

by Grishnakh (#49784921) Attached to: Amtrak Installing Cameras To Watch Train Engineers

nyone who says that Americans can't get over their not being number one in passenger rail has never talked to an American about the topic.

I completely disagree. There's tons of jingoist retards out there who think America is #1 in everything. You're probably not going to find many on Slashdot, because people here tend to have a decent level of education, but go talk to drooling Fox News watchers who dropped out of high school and you'll find them. These people are completely clueless how things are in the rest of the world. And they make up a very large voting bloc, so you can't disregard them as irrelevant.

Comment: Re:And I'm the feminist deity (Score 1) 434

Is it valuable as a life-enriching experience? Sure. Is it worth $100k (or whatever) to do that? No, I don't really think so, especially when someone else is paying.

On top of that, it's not like she knew going into it that her college experience was going to be mostly useless for her future career, and that she was going to end up working in a hotel. She was one of tons of kids who go into that degree program thinking they're going to have a great career in movies or theater, and then don't, just like tons of kids spend all their energy in athletics and then end up with nothing because they didn't make the cut to go into pro sports and end up working at McDonald's.

As for advantages for a particular social environment, I dunno. Are you talking about politicians getting history degrees at Yale and getting where they are because of their social connections there? Maybe that makes some sense for those people who go to such schools, but this girl isn't a politician, she works a low-pay job at a hotel. The state U she went to obviously doesn't give you the social connections that being a member of Skull & Bones does.

If people want to do theater work for fun, there's lots of community theaters looking for volunteers, where you can do that stuff without spending $100k and dedicating 4 years full-time to it. I had a neighbor who did exactly this: she was an actor in her community theater, and her husband helped build sets. I don't think society really has an obligation to pay that kind of money so people can have an enriching life experience, when you can do similar stuff absolutely for free. It's like this for just about anything: there's all kinds of cheap hobbyist stuff out there and volunteer work as well. You don't need to spend $100k to learn things any more. Programs like that, to me, are for people who are so serious about it (and talented enough) they want to do it as a profession.

Comment: Re:F/OSS reality (Score 1) 164

by Grishnakh (#49779339) Attached to: Mandriva Goes Out of Business

(The driver support on Linux is a bit crappier though, since very few vendors spend time or money on linux drivers for their consumer-class stuff, especially l

The driver support is usually *better* on Linux because you aren't reliant on some stupid hardware vendor who doesn't feel like updating their driver for a new OS release. This happens on Windows all the time. Driver quality is usually better too; manufacturers are notorious for making shoddy and bloated driver packages with all kinds of extra crapware included.

The main problem where Linux drivers have problems is with video drivers, but most people seem to do just fine with Nvidia's proprietary drivers these days (no, they're not Free/open-source, but they do work and modern distros seem to manage them well enough by most accounts), and if your video needs aren't as high, Intel's drivers work great and are FOSS. A lot of people still seem to complain about AMD stuff though, so I'd avoid that.

Comment: Re:F/OSS reality (Score 4, Interesting) 164

by Grishnakh (#49779325) Attached to: Mandriva Goes Out of Business

Desktop pretends to be (or maybe they actually believe that's what they are creating) a product for end users but is a product for admins and developers who are familiar and comfortable with the UNIX-like environment to use on their personal computers.

This is total BS. Lots of people who aren't computer experts use Linux desktops every day. My wife is one of them. I never have to do anything much with that computer, besides regular backups of course. Back when she was running Windows, I had no end of problems with it. I'm sure plenty of people here can attest to similar stories, of switching their spouses or parents to Linux and no longer needing to spend any time being their unpaid tech support.

What desktop Linux is, is a very good product for people who don't need to run any Windows (or OSX) applications. For home users who just surf the web, use Facebook, and do basic PC tasks like some basic word processing or whatever, Linux works extremely well. For people who just *have* to run Photoshop or whatever, obviously that's a problem, but not everyone is like that.

The Linux desktop community is a mess of hundreds of different distributions, various different protocols for doing things (how many freaking sound subsystems do you need?! ALSA, PulseAudio, FFADO, Jack, OSS, etc...) and all kinds of different UI paradigms, frameworks and toolkits.

You're completely overblowing things. Most modern Linux distros have settled on ALSA and PulseAudio (ALSA is the kernel-level drivers; PulseAudio is a userspace layer on top of that) and it works fine. No one uses OSS on Linux any more, and Jack is only used by a small number of people doing high-performance audio stuff. Different UIs aren't a big problem; people get along just fine choosing a desktop environment like KDE or Cinnamon and sticking with that. Different toolkits don't matter if you aren't developing software; you can run software written in one just fine in a DE written in another.

The problem with that is that the vast majority of computer uses do not want to choose every different option for every different part of the operating system

And they don't need to. Just download a copy of Ubuntu or Mint and be done with it. That's what everyone else does. This choice is generally made by the person who's computer-savvy, and the user doesn't question it. My wife uses KDE because I chose that for her since I prefer it and it works similarly to Windows, and she's never had a problem with it. She doesn't know or ask about Unity, Gnome3, Cinnamon, MATE, Xcfe, etc. People have zillions of choices when they buy a car too, but regular, everyday people don't have a problem there. They pick something they like and stop worrying about it. It may be a car their friend had, or they may have just stopped at a dealership and checked out a few things based on a salesman's advice. No one checks out every single model of car before making a decision.

yes i know you set it up for your grandma and she likes it -- represents falls outside the vast majority).

No, actually it doesn't (BTW, your sentence doesn't parse here). Most home users don't do anything terribly complicated with their computers, and these days they really don't do anything besides use it for web-surfing. This is why tablets have become so popular: people are sick of Windows problems, and tablets work just fine for using Facebook. Linux works fine here too, and better than tablets (since you get a real monitor, a real keyboard, real storage space, etc.). For the things most home users do, Linux does them extremely well. It can even play a lot of games now too, though that still works better on Windows because many games still don't support Linux (including anything that isn't on Steam) of course. No, it doesn't do TurboTax, but who cares: everyone's moving to web-based stuff for that. No, it doesn't run Pro/E, but how many home users do that. I've never heard of someone's grandma running engineering software. No, it doesn't run [random Windows software], but neither does Mac OSX, but I never hear of anyone saying Macbooks aren't viable alternatives.

The trouble with doing something right the first time is that nobody appreciates how difficult it was.