I manage a 500,000 line C++ program which does a lot of memory management. There's exactly nineteen "delete" statements in all that code and the last one was added about 10 years ago. The person who adds number 20 has to invite everybody out for dinner.
Nobody in the last ten years has done any manual memory management in this program or had a leak or a dangling pointer. It also closes all files promptly, etc. (try getting a garbage collector to do that!)
Whatever else Rust may do, C++ memory management isn't one of the problems it solves.
Right, but it's shitty for the programmer to manage it manually, isn't it?
Not as shitty as having to guess when Java will close the file you just wrote (eg. so you can copy it to a USB stick).
Resource management is much more than RAM, it's files, network connections, etc. Garbage collectors handle RAM OK but they're really really crap for everything else. In reality languages like Java need just as much manual resource management as C.
The only language which really doesn't need manual work is C++. C++ has stack unwinding. C++ frees resources immediately when objects go out of scope, not when some garbage collector decides to wake up (which might be "never" - your file might _never_ close unless you quit the program).
Here is a good reason not to learn C: shitty memory management.
Yep, and that's where C++ came in.
NOBODY should be writing real code using malloc/free. Use std::string and std::vector instead. You can use them perfectly well in "C" code so there's no excuse.
C++ powers the entire Arduino ecosystem. Chips with 32kb flash and 2K RAM are happily running C++ all over the world as we speak. Most of those programs will run on chips a quarter of the size (the Arduino IDE prints out how much flash/RAM your program uses on every upload to the chip so you can see it).
I use C++ on a day to day basis on Atmel chips. I've written ray tracers in C++ on chips with 4K Flash and 128 bytes of RAM using ordinary "float" data types.
The entire "Arduino" ecosystem runs on C++, driving 3D printers, robots, etc. on tiny microcontrollers. How do you explain that Pesky Fact?
Java, Python and VB.net don't have a snowball's chance in hell of running on one of those chips.
(Most likely you've never even used C++, you're just repeating crap you once read on the Internet)
Diffie-hellman key exchange appended to the first few emails you send each other. After that full encryption and an easy way for users to compare their private keys with each other if they really want to.
Most of them won't ever check them and that's perfectly OK. One in ten thousand people checking their keys is enough to spot a mass man-in-the-middle attack by the NSA (and I'm sure there's plenty of security researchers who'll sit all day long testing the system).
eg. Whatsapp does it by showing your key and a QR code of it on screen. People can validate the key by pointing their camera at your phone. That's easy enough for anybody to do.
There's absolutely no reason for every last email user to be in a ring of trust. We only need a small percentage of people to actually verify their credentials and it's enough to spot of the NSA is playing games with the system.
Not even the most non-techie user would turn down "encryption" if it was offered.
The real problem is the stupid email software writers who insist on using "certificates", rings of trust, etc. I'm looking at you, PGP.
Secure mass communications doesn't need all that, all they need is a way to exchange keys automatically and a way for people to compare key fingerprints if they suspect a man-in-the-middle. Whatsapp have managed it perfectly.
It only takes a small percentage of the population comparing fingerprints to find out of the NSA is engaged in mass e-mail manipulation. Anybody worried about privacy can simply do the fingerprint check. No certificate authorities to pay, no rings of trust needed.
If I was a conspiracy theorist I might _also_ suspect that the real reason it hasn't been implemented by major players (eg. Microsoft) is because the US government doesn't want them to.
Everybody knew both where I worked and we all moved the 68000 with no problems. All it takes it 10 minutes looking at clock cycles in the back of the manual.
For signed numbers, >> 2 and / 4 are not the same operation, so the compiler cannot do it for you.
Of course it can.
Compilers aren't AI, they can do any 'trick' the compiler writer knows, eg. using a shift instruction that preserves the sign bit. You need to disassemble some compiler output sometime and see the impressive amount of tricks they know. It's almost as if the compiler writers take pride in their work.
Nuclear is 500% more expensive to decommission than was projected. And after that there are millions in costs to protect the decaying nuclear waste lest it be taken by terrorists.
If only there were some new types of reactors designed after 1950....
If you cant sort out a buffer overflow then dont call yourself a programmer.
If you can't see that std::string is a better choice then don't call yourself a programmer.
I manage a 500,000 line C++ program which does a lot of memory management. There's exactly nineteen "delete" statements in all that code and the last one was added about 10 years ago. The person who adds number 20 has to invite everybody out for dinner.
Nobody in the last ten years has done any manual memory management in this program or had a leak or a dangling pointer. It also closes all files promptly, etc. (try getting a garbage collector to do that!)
Whatever else Rust may do, C++ memory management isn't one of the problems it solves.
Right, but it's shitty for the programmer to manage it manually, isn't it?
Not as shitty as having to guess when Java will close the file you just wrote (eg. so you can copy it to a USB stick).
Resource management is much more than RAM, it's files, network connections, etc. Garbage collectors handle RAM OK but they're really really crap for everything else. In reality languages like Java need just as much manual resource management as C.
The only language which really doesn't need manual work is C++. C++ has stack unwinding. C++ frees resources immediately when objects go out of scope, not when some garbage collector decides to wake up (which might be "never" - your file might _never_ close unless you quit the program).
What can you do in C about memory management?
Simple: Use C++ memory management instead. Your existing "C" compiler can probably do it if you let it.
When you're there you might find you enjoy some of the other features too.
Here is a good reason not to learn C: shitty memory management.
Yep, and that's where C++ came in.
NOBODY should be writing real code using malloc/free. Use std::string and std::vector instead. You can use them perfectly well in "C" code so there's no excuse.
C++ powers the entire Arduino ecosystem. Chips with 32kb flash and 2K RAM are happily running C++ all over the world as we speak. Most of those programs will run on chips a quarter of the size (the Arduino IDE prints out how much flash/RAM your program uses on every upload to the chip so you can see it).
C++ has no overhead compared to C unless you choose it. The most repeated phrase in C++ design was/is "you don't pay for what you don't use".
eg. If you choose to use virtual functions in classes then there's some overhead. If you don't, there isn't. Your choice.
Complete bollocks.
I use C++ on a day to day basis on Atmel chips. I've written ray tracers in C++ on chips with 4K Flash and 128 bytes of RAM using ordinary "float" data types.
The entire "Arduino" ecosystem runs on C++, driving 3D printers, robots, etc. on tiny microcontrollers. How do you explain that Pesky Fact?
Java, Python and VB.net don't have a snowball's chance in hell of running on one of those chips.
(Most likely you've never even used C++, you're just repeating crap you once read on the Internet)
C is at the very minimum a way to make things portable. C++ is not.
This isn't 1992.
Do you know any platforms where there's a C compiler but not a C++ compiler?
Donald Trump will soon put a stop to this.
96 American satellites had to be launched by a third world country? That doesn't make America look great.
Diffie-hellman key exchange appended to the first few emails you send each other. After that full encryption and an easy way for users to compare their private keys with each other if they really want to.
Most of them won't ever check them and that's perfectly OK. One in ten thousand people checking their keys is enough to spot a mass man-in-the-middle attack by the NSA (and I'm sure there's plenty of security researchers who'll sit all day long testing the system).
eg. Whatsapp does it by showing your key and a QR code of it on screen. People can validate the key by pointing their camera at your phone. That's easy enough for anybody to do.
PS: Hats off to Whatsapp for doing this.
Me? I've visited two other countries so far this year (and it's only February).
From my house I can drive to three different countries in half a day without even seeing a checkpoints.
(unless it's an old abandoned one)
No, he wants to scrap it. Completely.
He wants to scrap what he doesn't understand.
Nope, I want to scrap it, completely.
There's absolutely no reason for every last email user to be in a ring of trust. We only need a small percentage of people to actually verify their credentials and it's enough to spot of the NSA is playing games with the system.
And... don't you have to select a special "ludicrous" mode to get the car to accelerate that fast?
This guy is just after money. I hope the judge throws him out and makes him pay for wasted time.
Why isn't it automated? What's the reason?
Rubbish.
Not even the most non-techie user would turn down "encryption" if it was offered.
The real problem is the stupid email software writers who insist on using "certificates", rings of trust, etc. I'm looking at you, PGP.
Secure mass communications doesn't need all that, all they need is a way to exchange keys automatically and a way for people to compare key fingerprints if they suspect a man-in-the-middle. Whatsapp have managed it perfectly.
It only takes a small percentage of the population comparing fingerprints to find out of the NSA is engaged in mass e-mail manipulation. Anybody worried about privacy can simply do the fingerprint check. No certificate authorities to pay, no rings of trust needed.
If I was a conspiracy theorist I might _also_ suspect that the real reason it hasn't been implemented by major players (eg. Microsoft) is because the US government doesn't want them to.
Papieren, bitte!
That's not how border security works. They don't need a warrant. The courts have decided this.
There was nothing illegal that happened here.
Even if you're a returning US citizen?
This word "freedom". I don't think you (or most of the USA) knows what it means even though you spend your entire lives repeating it.
I used to know a good part of the dos/pc memory map, and before that certain 8-bit micros.
Yes, you youngsters had it easy...
Hexadecimal: what it is, why it is and how & why it evolved from octal.
This word 'evolved'. I don't think it means what you think it means.
Multiples of 4 bits (ie. hexadecimal) is more natural in a binary world.
Multiples of 3 is stupid, it was only ever going to be temporary.
and those who used one didn't use the other.
Everybody knew both where I worked and we all moved the 68000 with no problems. All it takes it 10 minutes looking at clock cycles in the back of the manual.
For signed numbers, >> 2 and / 4 are not the same operation, so the compiler cannot do it for you.
Of course it can.
Compilers aren't AI, they can do any 'trick' the compiler writer knows, eg. using a shift instruction that preserves the sign bit. You need to disassemble some compiler output sometime and see the impressive amount of tricks they know. It's almost as if the compiler writers take pride in their work.
After the disaster. Japanese seniors volunteered to do cleanup work as they thought they were near the end of their lives anyway.
As opposed to Chernobyl, where many not-so-senior people went in to try and stop the leak?
https://encrypted.google.com/s...
When the coffee machine runs out :D
There's no 'metric' that can't be gamed. If I was being paid to drink coffee I'd be emptying it into secret buckets.
Nuclear is 500% more expensive to decommission than was projected. And after that there are millions in costs to protect the decaying nuclear waste lest it be taken by terrorists.
If only there were some new types of reactors designed after 1950....