HN2new | past | comments | ask | show | jobs | submit | kluge's commentslogin

Betfair is the biggest one.


I don't understand the example. Why would it do that and not unlock after foo()?


The following code would do the right thing; see if you can spot the difference, and think about whether you would catch that in code review (g++/clang++/visualc++ won't warn about it).

  {
    mutex_guard guard(some_mutex);
    foo();
  }


Ah, now I see it and it makes sense.

The answer to the code review question is obvious. I didn't see the error even though I was told what happens.


I guess you meant std::lock_guard.

Anyway, the first example creates a temporary object which doesn't lock anything since it will be destroyed right away because it's an rvalue (not sure why would anyone do that for locking, unless not knowingly). The second example creates a proper guard which lives until the end of the scope.


Well, we are talking about Finland.

http://www.stat.fi/tup/suoluk/suoluk_asuminen_en.html

By the latest numbers there are 1 266 000 residential buildings in Finland, housing 1 581 000 saunas. But of course other buildings also have saunas, so in total there are more than 2 million saunas.

There are 5 451 270 people in Finland.

I'd say a lot of people have access to saunas.


I think it's just normal tokenizing. `..-` is a legal name for an operator. An error is given since no operator of that name is in scope.

The alternative of this getting parsed as a range operator and a negative number now and changing to an application of `..-` if that is ever defined or imported doesn't sound very good...


You might already be familiar with it, but this looks a lot like QML.


I wasn't actually - never used Qt (been stuck in win32 and Wx). Thanks for pointing it out :)


Maybe it is because you didn't show an example, but that doesn't seem like something caused by lazy evaluation. It is pretty easy to get into infinite loops due to logic errors in Project Euler type problems even when using imperative loops.


I think she was implying that college-dropouts that build software projects can afford to buy Teslas without understanding math.


Now that you point it out I can see how it could be interpreted that way. I had trouble recognizing that because I don't think being wealthy (owning a Tesla) is an indicator that one "built something substantial".


You read the comment backwards. It was saying exactly that nullability of the argument is something that can be guaranteed by a type system but you can't write a test that makes sure of it.


I think spam was exactly the problem.

It's a shame and seems to really hurt. There's a lot of outdated information in the wiki and I suspect the obstacle to making fixes is a big contributor.


On the US keyboard it probably is. On Finnish keyboard it's where < is on the US one, i.e. Shift-comma.


Yeah, I always felt a tiny bit sorry for non-US developers, especially using languages like Perl that use $ all over the place.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: