Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror

Comment Re:Do it yourself (Score 3, Interesting) 78

So don't use STL

Indeed, No True Scotsman would use STL with C++.

clang-tidy and Cppcheck and flaw finder and Sonarqube

The last job I had where I had to use C/C++, we automatically ran an expensive static analysis tool every time we checked in code. I'd estimate that it only found about half of the potential segfaults, and it made up for that by finding twice as many false positives.

Comment Re:Do it yourself (Score 3, Insightful) 78

The "rules" of mutable collections in STL state that collections may not be mutated while being iterated.

Nope. If I had used st::list instead of std::vector, it would have been perfectly fine and officially supported. (Assuming I changed "i+10" to "i+11" in order to make the algorithm actually terminate, although that change wouldn't affect the vector crash.).

The problem is that there are dozens of different rules you have to remember to apply to the different types of lists and iterators. And that's only talking about that one topic. There are hundreds of other rules covering a multitude of language aspects that you have to mentally apply against every single line of code you write, many of which can potentially cause memory corruption.

Comment Re:Do it yourself (Score 4, Interesting) 78

You don't need the language to enforce memory safety to program memory-safe. The most important thing is, for example, to never touch raw pointers. C++ makes it very easy to avoid this. Rust forces you to avoid it, but just because C++ gives you the loaded gun, it doesn't mean you have to use it. In particular not on your own foot.

That is a dangerous misconception. You don't need to use any pointers to get memory errors in C++:

#include <stdio.h>
#include <vector>
 
int main() {
    std::vector<int> v = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    for (auto i : v) {
        if (i % 2 == 0) {
            v.push_back(i + 10);
        }
        printf("%d\n", i);
    }
 
    return 0;
}
 
$ g++ -Wall -pedantic t.cpp
$ echo $?
0
$ ./a.out
 
1
2
-947527061
1600570778
5
6
7
8
9

Comment Re:There is already a safe subset of C++ (Score 4, Insightful) 78

languages like Rust exist to put ignorant programmers in straight jackets for their own good

Are you seriously trying to suggest that never allocating memory is not also a "straight jacket"?

You seem to be saying that a currently existing bowdlerized version C++ is safe for close-world problems. Possibly so, but that still leaves C++ unsuitable for open-world problems. That makes C++ only suitable for niche applications. Why learn it?

If you just use Rust or any other memory safe language, you won't have to worry about what kind of "world" you're writing for, or about choosing from a range of increasingly dangerous "profiles".

Comment Re:Going for gold (Score 1) 251

>They didn't say whose value it strengthened.

LG's, Westinghouse, GE, and so forth!

Actually, if they had the testicular fortitude, your Samsung would display an add reading, "if you had bought LG, you wouldn't be seeing this!" :)

hawk

Comment Re:Deserve what you get (Score 1) 251

>Has about the same importance as smart tech in a fridge for me.

I live in the desert, you insensitive clod! :_)

but seriously we doohave many days of 115-117F most summers. Self-replenishing ice is *important*.

it's not why we bought it, but our LG actually has two ice makers; one in the refrigerator door, which you can actually clean out, and another for larger square tubes in the upper freezer drawer (which we turn off for the cooler half of the year)

Comment Re:It was never a secret. (Score 1) 251

>A fridge will last for a decade or more,

you would *think* that, but my prior fridge was a Samsung.

The ice maker died of its own buildup just out of warranty, the drip tray for the water dispenser caused rust lines through the paint below it, and the whole thing failed at 4 or 5 years--we came out one morning and it was at 50.

Compare to the Samsung dryers whose stainless steel barrels tend to crack and go out of round, wanting a $400 replacement!

The refurbisher who came out with our temporary dryer told us that from his experience (primarily washers & dryers), Samsung had the highest failure rate, while the other Korean brand, lg,had the lowest, with everything else in between.

Comment Re:It was never a secret. (Score 1) 251

>Agree, and don't even allow my TStat's to connect to wifi.

Have you *read* the license on those?

I brought home a wifi thermostat, thinking it would be nice to be able to change it half an hour out when coming home, and then read the terms.

It was like a parody of the terms you find offered sarcastically around here.

Pretty much, "you agree that we can send armed goons into your house, torture your dog, rape your cat, and sell your children into slavery. We may do anything we want with your data, and even more so if someone is willing to pay us for it."

It went back.

Comment Re:An entity in the US of A won't entertain this.. (Score 4, Insightful) 39

It does not work that way. The "CTO" would be Generalmajor (Major General) Hermann Kaponig, as the commanding officer of the Cybertruppen (Cyber corps). But he has no right to purchase anything, because this would be the task of the Ministry of Defense. On the other hand, the Ministry of Defense would not buy any software the Direktion (directorate) 6 does not condone.

Comment Re: Keep it plugged in (Score 1) 173

If they want it preconditioned? Yes, welcome to 2025, they can install the app on their phone. Or they use the 'remote climate start' option on the keyfob. Or they shoot you a quick text asking you to hit the button in your app.

You keep trying to paint these advancements in convenience and comfort as terrible burdens, and it's weird.

Slashdot Top Deals

Luck, that's when preparation and opportunity meet. -- P.E. Trudeau

Working...