For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more jason-johnson's commentsregister

This has generally been the case, but a system language like Rust has access to optimisations that C simply won't have due to the compiler having so much more information (e.g. being able to skip run time array size checks because the compiler was able to prove out of bounds access cannot occur).


How can it not? Experts in C taking longer to make a slower and less safe implementation than experts in Rust? It's not conclusive but it most certainly says something about the language.


> Experts in C taking longer to make a slower and less safe implementation than experts in Rust?

How do you know this exactly?


>”Game theory optimal" (as poker players like to call it) is not really the optimal strategy. It's the nash equilibrium strategy assuming the other players are also playing a nash equilibrium strategy. As soon as one player deviates from the nash equilibrium it's not optimal anymore :).

This is not really what most people mean when they say “optimal strategy”. It’s true that exploitative play will make more money if you know exactly what your opponent is doing and if they keep doing it despite it not working. Neither of these will generally hold in an actual game.

The reason it’s called “optimal strategy” is because it works no matter what your opponent is doing. It will not make as much as a strategy tailored perfectly to your opponent but it will never lose to anyone under any circumstances, assuming infinite games (assuming infinite games just so we can ignore variance). The worse case the strategy has is break even to anyone else using it.


You are assuming there are no collusions among players (agreements to play against another one). That perturbs the Nash optimality.


I'm kind of curious how accidental collusion could work out. Like imagine multiple players playing in such a way that they help each other - but purely out of ignorance on how best to play the game!


Isn't it pretty standard, and how professional poker players make money?

All of the good players identify the worst, riches player at the table, and they all take that players money.

Once they're out, you leave the table too


> Neither of these will generally hold in an actual game

These absolutely hold, 90% of casual poker players have the exact same strategy problems of not bluffing enough and calling too much.


It sounds like you are maybe describing a dominant strategy? Oh, wait, no, you are saying that if you play the Nash equilibrium, then no other strategy among opponents will do better against it than the Nash equilibrium would, and therefore (as the game is zero sum) the worst their choice of strategy can make you get on average, is breaking even?

Ok, now that I (I think) understand your comment: I don't think you have to know exactly what non-Nash strategy someone is playing in order to exploit it. I don't think trying to estimate how someone is likely deviating from the Nash equilibrium, in order to try to exploit it, is necessarily a mistake. I think it could be feasible for someone to get better returns on average by noticing off-Nash patterns of play in other players, than playing Nash regardless would? (Not that I could win this way. I couldn't.)


But isnt the definition of the nash equilibirum the strategy where no deviation from it is going to afford you a better outcome?


A Nash equilibrium is a pair of strategies (or, one strategy for each player) such that no player can get a better result on average from deviating from it.

If one player isn’t playing a strategy that is part of any Nash equilibrium, then the best response might also not be part of any Nash equilibrium.

If all other players are playing a strategy from a given Nash equilibrium, then you can’t do better (in expectation) than you would if you were to play the strategy for you in that Nash equilibrium.

(A game may have multiple Nash equilibria. Possibly one such equilibrium could be better for you (or for everyone) than another.)


Sure, but the issue is that SO was used largely for people working in companies with arcane rules. I can’t tell you how many times I’ve gotten one of these annoying “don’t do X, do Y” when I already know this. I have to do X for some reason, I don’t know how to do X because I do Y when given a choice and now no one will answer how to do X because someone killed interest in the question by apparently answering it. I use whatever points I get to downvote these answers.

The thing people don’t get is: when you answer on SO you’re not answering that poster. You’re answering anyone who will ever have this question. It’s quite arrogant to assume it will be an XY for every single person forever more.

The proper way to answer is to answer the question exactly as ask and then insert your “but you probably should be doing Y instead” at the end.


Disagree.

Doing things the right way is BETTER.

If you can't, you should add a bit to your question saying "I know the standard way is to do Y, not X, but because of reason Z I can't do it."


Again, you’re not answering the person who asked but every person who ever will. Some of them will be asking because the “right way” is not an option in their situation.


And those people can look for questions where the "right way" is justifiably unusable, or pose those questions themselves (and find out if they really have to avoid it.)

Because you're answering every person who ever will ask, a lot of the people who pass through your question & answer will be people who don't know the difference between the right way and the wrong way. If they want to know how to do something the wrong way, because they don't know what the right way is, an answer that simply tells them how is a bad resource.

It's not enough to tag caveats onto such dangerous answers, because people can't read. Instead, newbies should have to overcome a sufficient amount of opposition to filter out those who don't know why they're doing what they want to do, and the rest can make the little effort of being very explicit about why they want to do something the wrong way.


> And those people can look for questions where the "right way" is justifiably unusable, or pose those questions themselves

Can't be done, will be marked as duplicate.


Exactly. I've seen precisely this "documentation antipattern" occur many times. "How do I do X with Y"? "You probably want to do Z instead". Upvoted, question answered, all other related questions of "no, really I do want to do Y" get closed as duplicates.

Then Googling for doing X with Y gets you a bunch of closed questions and a labyrinth of links all leading to a question that was answered 10 years ago on a different software version where Z possibly was the right way to do it but now isn't.

And of course there's no way to reopen the question because it has been closed by a level 15 Magister Templi moderator and a lowly level 3 apprentice moderator like yourself needs to either answer 146 more questions or moderate 192 other questions to clear enough arbitrary hurdles to achieve holy question reopening powers.

And there's possibly an appeals process but that involves recruiting 13 moderators who you have to convince to give this question special treatment and declare that one of their number of sacred moderators made a mistake.


This is bad then. They are not duplicate questions.


Yes. StackOverflow mods frequently mark questions duplicate that are not. That is something that has been observed by many many people.

Some of it is that SO has gamified shitting on and suppressing the question/asker instead of gamified providing the answer, and built a culture of toxicity that tolerates the abuse of the tools in this fashion.

And when the CEO asked them to tone it down maybe 5 years ago they basically did a collective “am I so out of touch? no, it’s the askers who are wrong”. Extremely funny to read the meta responses to that at the time.

https://stackoverflow.blog/2018/04/26/stack-overflow-isnt-ve...

https://news.ycombinator.com/item?id=16934942

(admittedly "women and people who don't speak english well are particularly unlikely to adopt to the pedantic neckbeard culture we've built" is a spicy take for your average SO'er, or wikipedian, but it's also not actually a wrong one either. SO's culture problems probably do disproportionately chase away users with marginal engagement, nobody likes putting up with formalized neckbeard culture and those users have absolutely encountered it before and absolutely have an aversion/revulsion to entering yet another online neckbeard nest. I think this is a case of “he’s probably right but the medicine would have gone down better with the manchildren if he hadn’t mentioned women and minorities”, and he’s also right that those issues have continued to bury SO over the last 5 years.)


> Because you're answering every person who ever will ask, a lot of the people who pass through your question & answer will be people who don't know the difference between the right way and the wrong way.

Then you have to do two things in your answer:

1. Correctly answer the question as asked.

2. Add your opinion about the "right way" to do it.

If you only do #2, you are failing "every person who ever will ask."


Again, I don't think this enough - because it's a well-acknowledged fact that people can't read[0] (as I said in my comment.) How many newbies are going to see a working solution, try it out, and immediately skip all the extra text that they don't think they need?

[0]: https://www.joelonsoftware.com/2000/04/26/designing-for-peop...


> Again, I don't think this enough - because it's a well-acknowledged fact that people can't read[0] (as I said in my comment.) How many newbies are going to see a working solution, try it out, and immediately skip all the extra text that they don't think they need?

You know that's not your responsibility. If some newbie makes a mistake, that's their responsibility (and a learning experience for them).

And frankly, I think you greatly overestimate how valuable and essential your non-responsive "you're asking the wrong question" answer is.

> https://www.joelonsoftware.com/2000/04/26/designing-for-peop...

That link is about users. You're misapplying its lesson if you're using it to justify not answering a developer's development question.

Quit coming up with excuses for not answering the question.


>That link is about users. You're misapplying its lesson if you're using it to justify not answering a developer's development question.

Why do you think "users" is an inaccurate description of the role question askers have on a developer Q&A board?

Put another way - when was the last time you used a development tool, or a library, or some other resource, and sat down to read the full documentation of it? I would posit that that's very rare as an activity, even for developers who need to develop a deep understanding of what they're using.

It's much more common to learn by doing, and the limit of that learning is very often what the developer can't do. Answers which easily enable developers to do something are overwhelmingly likely to lead to developers doing that thing - much in the same way that a long page of library documentation which gives an example is likely to lead to developers repeating that example, even if at the end of the docs, there's a little caveat saying that you shouldn't follow the example for so-and-so reason.

>If some newbie makes a mistake, that's their responsibility (and a learning experience for them).

But is it a good experience? Sure, maybe they'll learn that they always have to read the whole answer before they use any part of it. But we sensibly have abandoned this no-guardrails approach to teaching in almost every arena where it's been used, because it's not really suited to the way people do things in real life - and in real life, people often end up affecting others with their mistakes.

Does junior developer who learns how to glue SQL strings together in their favourite programming language, and makes the "small mistake" of not learning anything about SQL injection in the process, benefit from the learning experience when they cause a data leak? Do their customers? Or should the learning resources they access maybe use the pedagogical tools available to make sure those kinds of mistakes are really hard to make, even if it occasionally inconveniences a seasoned pro?


> Why do you think "users" is an inaccurate description of the role question askers have on a developer Q&A board?

The are a lot of different kinds of "users," and I think the kind of thinking in that article is totally inappropriate when applied to developer Q&A board.

To be perfectly blunt: the result if what you're advocating is to condescendingly treat experienced people as newbies so dumb that their question should not be answered, because you think they're so dumb the real answer might distract them from the lecture you want to condescendingly give them.

People like that are super annoying and almost always unhelpful.

Every single fucking question I ask on SO has some lazy condescending dude chiming in to answer the easy question he thinks I should have asked, after he totally failed to understand the constraints that made my question hard. Of course, lazy condescending dude always thinks he knows better.


Yes but the right way should be the answer unless it is explicitly stated why they can't use this.

Most readers will be able to use the "right way".


No, the best thing is not assume you know better than anyone who will ever ask this. It’s good to mention what the right way is and why but your answer should always include the answer to the question exactly as asked at a minimum.


I agree but sometimes the answer exactly as asked leads to wrong things. So sometimes you don"t provide the answer to the exact question but include the reason why the exact question is not good. This gives the option for the questioner to comment why the exact answer is needed.

My experience with less experienced developers is that they ask the exact question as that is where they have stuck but they are ignorant of the better ways.

I do tend to answer differently depending on the questioners reputation. If they have a higher rep then I can assume they know what they are doing.


Actually the issue you're complaining about is not a Haskell problem, it's entirely a library problem. It so happens that the standard library has a really poorly defined numeric hierarchy at the moment. If you want to fix it right now, you can avoid importing the prelude and import a different numeric library which has more sensible definitions for everything.

The issue is that for most things you'd want (+) to be defined like: (+) :: a -> a -> a

But actually, to be more flexible it could be defined as: (+) :: a -> b -> a

So then all the normal stuff would supported, as now, but you could also support things like:

    instance BetterNum DateTime where
      (+) :: DateTime -> Duration -> DateTime
And so on.


Depending on how it’s being counted, I have a regex engine in around 30 lines [1] (the parser is longer). It handles branching, grouping, etc. and it’s run time is proportional to the length of the string being searched (I.e. no infinite loops on certain patterns, etc.).

[1] https://github.com/jason-johnson/frobo/blob/master/src/Text/...

The “match” function. And yes, this is ugly and needs to be cleaned up.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search:

HN For You