April 09, 2024

Another Linux lie: we have portable C++

Another Linux lie: we have portable C++

Truth is, you don't.

The one-size-fits-all answer to all questions in C++ world is not 42 but 'you do not need it'. The know-it-all types at C++ whatever committee and around it bestow their divine wisdom on anyone who tries to do something. That wisdom is 'do as I say or'.

Enter std::chrono namespace and its steady_clock type that is only suitable for accurate measurement of short time intervals. It is a thing of its own, incompatible with just about anything.

You are not supposed to convert it to any meaningful, reasonable time units "because you do not need to". When you get strange results from your code and want to ensure that it is doing what you want, you will not be able to output any time_points that your code populates along the way. There is no conversion from steady clock time points to any other data types that can be output to console. End of the story. Dead end. You are either allowed to take accurate measurements or you are allowed to output them, never both.

Enter std::thread. There is no way in hell to obtain the current thread's native handle. These fucking idiots do not give a fuck that we have to interact with OS-specific calls. They do not give a damn that we may have to manipulate threads in OS-specific way. They are all portability, and fuck all.

I am beginning to hate std namespace with passion. I wish their authors slow and painful death because they go out of their way to achieve extreme sophistication and in the process make things so unfathomably complex that they throw baby out with water.

Posted by: LinuxLies at 05:55 PM | No Comments | Add Comment
Post contains 290 words, total size 2 kb.




What colour is a green orange?




15kb generated in CPU 0.0079, elapsed 0.0441 seconds.
35 queries taking 0.0395 seconds, 127 records returned.
Powered by Minx 1.1.6c-pink.