HN user

nemetroid

3,891 karma

Currently employed by a mid-size company.

Posts0
Comments1,134
View on HN
No posts found.
PL/0 5 months ago

Using '=' for both assignment and comparison is awkward when parsing incomplete code. Consider e.g.:

  j = 5;
The user starts writing (<|> is the cursor position):
  i = <|>
  j = 5;
This is a valid expression (i is a boolean). But the user probably intends to finish writing something like:
  i = 0;
  j = 5;
So in the intermediate state we would like to emit a single warning about an incomplete statement. But since it is valid as written, we instead end up warning about e.g. j being unbound.

I read it and thought it contained several good ideas, but was excessively wordy and would have benefited from being half as long.

Yes, many or even most domains where C++ sees a large market share are domains with no other serious alternative. But this is an indictment of C++ and not praise. What it tells us is that when there are other viable options, C++ is rarely chosen.

The number of such domains has gone down over time, and will probably continue to do so.

The new profiling.sampling module looks very neat, but I don't see any way to enable/disable the profiler from code. This greatly limits the usefulness, as I am often in control of the code itself but not how it is launched.

Each entry in the map will be copied. In C++, const T& is allowed to bind to a temporary object (whose lifetime will be extended). So a new pair is implicitly constructed, and the reference binds to this object.

Both Microsoft and Google seem to do it just fine

Microsoft sends me DMARC reports saying "yes, everything was accepted 100%, all good". The delivery logs on our end look good as well. However, they silently drop a large portion of messages with a Hotmail destination.

A nice way to fix bugs is to make the buggy state impossible to represent. In cases where a bug was caused by some fundamental flaw in the original design, a redesign might be the only way to feel reasonably confident about the fix.

The effect of referring to a copy of the object when locking, unlocking, or destroying it is undefined.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/V...

I.e., if I pthread_mutex_init(&some_addr, ...), I cannot then copy the bits from some_addr to some_other_addr and then pthread_mutex_lock(&some_other_addr). Hence not movable.

Moving a mutex is otherwise non-sensical once the mutex is visible

What does "visible" mean here? In Rust, in any circumstance where a move is possible, there are no other references to that object, hence it is safe to move.

Same in Gothenburg. There's a single underground station, with the platform in the middle, so the trams need to cross over. Another underground station is planned, but it will have the tracks in the middle instead.