Tank was right... this did escalate quickly, but only after he said it escalated quickly.
I guess it's my turn to remind people that this is the "Feature requests" sub-forum. In past feature requests it was always Laurent who ended up asking the typical "How will this benefit SFML users in general?". As soon as I do it and in the process suggest what I think is a better alternative that everybody has access to and IMHO should learn to use, everybody labels me an elitist. Just to be clear, I have no hidden agenda, I just want the best for the library, and I thought it was a valid concern considering whether adding asserts would actually have any
real impact on the daily lives of SFML users. It was never my intention to point fingers at anyone in this thread. Playing devil's advocate can have such unpredictable results sometimes.
You can go on and on about how assertions are great when
you use them, but remember, it's not just about you. The people who have bothered posting in this thread are probably the ones who would benefit from them the least. I myself use assertions all over my code and find them great, and yet I would never consider adding them as part of the public API of any library I write. Now I ask again: Would assertions benefit those who don't bother posting on the forum when they don't have a problem with SFML? Since we can only estimate using previous experience, I would say no. You might have another opinion, but I think yours would be harder to prove than mine taking into consideration they are both based on estimates. If there is one thing that I have learnt browsing through the forum, it is that one must never underestimate the helplessness of some of its users. Now you might say: Well, those users are better off learning to avoid common mistakes and develop good habits in the first place. This kind of disproves your own point. If assertions aren't targeted at them, and more experienced users don't make the kind of mistakes that are caught by assertions that often, then who are they targeted at?
Now for my pragmatic side.
If we try to look for cases where people have sought help on the forum because of exactly this or similar "problems", then you won't find that many. Maybe because it is so trivial that even beginners are able to spot them without external help. If you are going to add assertions every time at least one person posts with a corresponding problem, then it is no different to adding a new feature every time someone needs it in their own project. If you look at assertions like genuine "feature requests" then the same conditions for their rejection would apply here. I am just trying to treat them the same.
Also, if we went ahead and added an assertion here, we would have to add them everywhere else as well to stay consistent. I'm just estimating at this point, but this is at least a few hundred lines of new code, maybe even up to or over 1000. This adds to the total maintenance cost of the library, considering that the assertions would have to be adjusted, possibly at multiple remote locations of the library any time we decide to change any pre-/post-conditions. Is this extra maintenance cost worth that little peace of mind that assertions might give us?
Like I said, there are tools ("good" debugging environments, clang with its various sanitizers, which would have already caught Nexus' example during static analysis) that are more effective at catching programmer errors than manually maintained asserts. We shouldn't have to re-invent the debugging wheel just because we find a specific concept awesome. Leave the developer aids/tools to the ones who know what and how to implement them for the end user. Having a tool that goes hand in hand with the toolchain you are using is much more powerful than anything a library writer could ever add to the library, that is of course if people use those tools in the first place.
Lastly, we mustn't forget that like everybody has already stated, assertions only have an effect in debug configurations. Think of the times when people have come to the forum for help with an obscure screenshot that proves they didn't bother building/running in debug. Also, think of the people who make use of the SFML packages on Linux systems, they won't benefit from the assertions at all since the packages rarely if ever come with a debugging configuration. Same story if people get SFML via NuGet. If we really expect people in these environments/situations to build the library themselves or download the official release archives
just to benefit from assertions, we already lost the battle.
All I am asking for at this point is tangible proof that the change we are going to make is actually going to be effective (and more effective than its alternatives) by benefiting more than 1% of the typical SFML user base. Everything posted up to now has failed to meet that requirement, talking around the actual point. Provide proof and I will happily concede.
TL;DR: Unintended self-fulfilling statement, concepts are awesome if they benefit you, concepts don't have to benefit others just because they benefit you, still no real proof this change is worth adding.