Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror

Comment Re:Do it yourself (Score 1) 30

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 2) 30

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) 30

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) 30

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 Ordered from Aliexpress, marked up for the US (Score 1) 39

Pretty much everything not big-name-brand that's on Walmart or Amazon is marked up 25% or more from the Aliexpress price for exactly the same product. If you're willing to wait for it to come from China, you can get the same crap for less. I've just placed an order for an item that's $200 on Amazon and was $150. I expect it to take maybe an extra week.

Comment Re:Where is the like button? (Score 1) 39

Calc will generate pivot tables, but not with a live WYSIWYG interface where you can tweak it as you go. It creates a new tab in your sheet after you fill in a dialog which is static, so if you want a current one or want it to be slightly different, you have to create it all over again.

I hear that these days it handles very large files OK, so IMO this is the last major feature needed before it can really be taken seriously as an Excel replacement.

Comment Re:Wrong Model (Score 1) 112

Large houses in hot climates don't have enough roof space to accommodate the number of panels you would need to displace grid power.

Simply putting panels between the sun and the house substantially reduces the need for cooling, even if you didn't connect them to anything, because the back of the panel is white and the other side is dark.

Comment Re: Going for gold (Score 1) 241

I only had so many choices as I wanted to buy something from costco so that I could easily return it if it failed. It was LG, Samsung, or Sony. The reviews all said that the LG was good except for the interface, and the other options were bad including the interface.

Comment Re:bullshit dude (Score 1) 38

the point is that legacy filesystems (e.g. Minix) and operating systems are facing doom because of the Y2038 problem

Oh no! This is of no concern to anyone but hobbyists today.

You could invent some ad-hoc replacement filesystem but then it won't be compatible with Linux.

Unless you added support for it to Linux.

There are still people out there hacking on 2BSD. I am sure they are aware that NetBSD is available as an upgrade path.

Again, hobbies don't matter.

Comment Re: Going for gold (Score 1) 241

I even have it set to never sleep for efficiency and it still occasionally tells me to wait while it gets its shit together before I'm allowed to change inputs.

All you need is to change channels and inputs

In fact, that is what I was talking about. You may read the quoted section at your leisure.

I had one a few years ago (returned due to developing a fault with the screen after a couple of years) that was inexpensive and didn't think the lag was bad.

This one is only a bit over a year old, so it's newer than the one you were using. The entire line has been panned universally in reviews for its laggy interface.

Slashdot Top Deals

"Religion is something left over from the infancy of our intelligence, it will fade away as we adopt reason and science as our guidelines." -- Bertrand Russell

Working...