Better HN
topnewbestaskshowjobs
Log inSign up

calebtroyer

9 karma · joined Sep 16, 2017 (9y ago) · 3 submissions

Submissions

comment 8y ago · link · parent

It says why right in the compiler FAQ — "I thought it would be funny"

comment 8y ago · link · parent

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).

comment 9y ago · link · parent

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/