Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror

Comment Re:"any day now" (Score 3, Insightful) 26

In astronomical terms that means it can happen 1 second from now, or 10 million years from now. Either way, it already happened

Since the system is around 10,000 light years from earth, while it has quite likely already happened, it is known that it had not yet happened 10,000 years ago.

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

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

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

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

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 Competition? (Score 1) 43

We have W+ and Prime and these are probably the main 2 sites I cross-shop these days. They don't overlap entirely; Amazon sells a lot more variety under its own return policies etc, while Walmart is better for things like motor oil that they have locally (if you wanted to go into a Superstore). But there's enough overlap that it's worth cross-shopping, for now.

Comment Re:A rare good move from Trump (Score 1) 229

Good or bad, it does not seem legal. H1B is controlled by congress and president is required to enforce the laws made by congress. Putting arbitrary 100k a year fee is not in the spirit of the law. Imagine if states like California put 100k fee on gun registration. They can't, because gun ownership is in constitution and states cannot put excessive burden. Same for H1B. It is in a law by congress and president cannot put excessive burden on companies in exercising what is in the law.

Comment Re:This should stop the abuse of H1-B (Score 0) 229

You got it totally wrong. This law is abuse of presidential powers. Congress makes H1B law, not president. President is supposed to enforce the law as per the intention of the congress. Imposing 100k per year, is far from any congressman could have envisioned.

This law will mostly be blocked by courts.

Comment Murdercars (Score 2) 26

Every time I see a story like this, I think about Daniel Suarez's book Daemon.

It isn't a great book - fairly disposable scifi that requires TV-style disbelief-suspension and eventually devolves into weird techno-utopianism. But has great bits of scene-setting mind candy that is frighteningly believable.

Like the fleets of robot cars used as weapons.

Comment Only half the problem (Score 5, Informative) 58

I realize that half is the focus of the article, but it misses a huge piece of the perniciousness.

They demand exclusivity with venues.

Which means you either hand over all your booking and ticket sales (for a fee, of course) to them, or not be able to book any Ticketmaster artists. If you haven't considered the question, you may not recognize that artist-choice and ticketing are two of the biggest levers a club owner has to manage their business. Most of the other costs of business are pretty inflexible - about your only other cost-control options are fucking over your workers and watering the beer.

This does a couple things - clubs become more like farmers - they get to soak up all the risk with none of the control. It also gives TM more control over artists - I've seen less info on how TM squeezes them, but don't think that isn't there. If an artist doesn't like their terms, they don't get to play their venues.

And of course they wet their beak at every single touch point along the way.

Comment Re:US $0.18 per kWh vs China $0.08 (Score 2) 60

DeepSeek has proven that it can use far less computing power

I've seen where they've asserted that, where has it been proven?

if DeepSeek' s claims are true,

Ah.

some AI queries may not require a data center at all

And here's how you falsify the claim. When can I expect to see that 200B param model on my phone?

Slashdot Top Deals

Remember to say hello to your bank teller.

Working...