News for hackers. Stuff that matters.

calebtroyer

Re:Branchless Doom on Tuesday January 23, 2018 @11:35PM (#16220340)
It says why right in the compiler FAQ — "I thought it would be funny"
Re:Building a Website with C++ on Saturday January 20, 2018 @12:17PM (#16194156)
Why do people think the C++ of today is the same as the C++ of 1998? Today we have concepts such as RAII to clean up our objects when they go out of scope. We have references which are essentially safe pointers to an extent (see dangling references). References have always existed, but people insist on using raw pointers still. Finally, for those use cases where heap allocated memory is absolutely necessary, we have smart pointers which clean up the memory they own when the smart pointer object goes out of scope (an application of RAII). Other unsafe practices carried over from C such as void * type erasure are being replaced with type-safe objects (see std::any for C++17, boost::any for pre-C++17).
Re:Ask HN: What coding challenge sites should I try next? on Friday December 01, 2017 @03:32PM (#15827122)
Realistically, the best way to learn a language is to make a small project that does something useful. But if you're still wanting to do challenges rather than a project, you're just in time to participate in Advent of Code 2017 [0]. The only 'gamified' part is the leaderboard which is based on how long it takes you to generate a correct answer since the challenge became available. Another challenge that, while not generally suited for a PHP programmer but still possible, is the Synacor Challenge [1] , which involves creating a virtual machine and running a provided binary in that virtual machine to find codes to submit.

[0] https://adventofcode.com/ [1] https://challenge.synacor.com/