←back to thread

327 points AareyBaba | 2 comments | | HN request time: 0s | source
Show context
mwkaufma ◴[] No.46183728[source]
TL;DR

- no exceptions

- no recursion

- no malloc()/free() in the inner-loop

replies(9): >>46183820 #>>46183900 #>>46184073 #>>46184113 #>>46184198 #>>46184398 #>>46184472 #>>46184588 #>>46185500 #
msla ◴[] No.46184472[source]
At that point, why not write in C? Do they think it's C/C++ and not understand the difference?

> no recursion

Does this actually mean no recursion or does it just mean to limit stack use? Because processing a tree, for example, is recursive even if you use an array, for example, instead of the stack to keep track of your progress. The real trick is limiting memory consumption, which requires limiting input size.

replies(4): >>46184605 #>>46184960 #>>46185419 #>>46187438 #
1. drnick1 ◴[] No.46185419[source]
You may still want to use classes (where they make sense), references (cleaner syntax than pointers), operator overloading, etc. For example, a linear algebra library is far nicer to write and use in C++.
replies(1): >>46186889 #
2. jesse__ ◴[] No.46186889[source]
Function overloading is nice, too