3 ms·
I'm looking forward for the next part, as the last three myths are the ones I'm waiting for their answers, as they should be pretty interesting. C++ has come a
by Ragnarork 12y ago
I'm looking forward for the next part, as the last three myths are the ones I'm waiting for their answers, as they should be pretty interesting.
C++ has come a long way, and I really feel C++ 11 could very well replace Java as a learning language for computer science students (I don't think it'd be a good choice for an introduction to programming for non CS students), and I see many benefits in this, the biggests being IMHO C++ NOT being fully object-oriented, and the possibility to do either low- or high-level stuff, depending on what you're teaching.
- wmt 12y agoMy biggest issue with most garbage collection implementations is the lack of RAII. While I love the ease of reading and writing Python or Lua, I'd love to be able to create a local object, like an open file or a database connection, and have it destructed immediately on return.
- idbfs 12y agoI'm not sure about Lua, but for Python it sounds like you may be interested in the "with" statement.
- pjmlp 12y agoYou can do this in all modern GC languages. Either with a using/try with resources/with construct, or by using closures. // Pseudo language with FP capabilities let withFile filename action = let fd = open filename action fd close fd withFile "config.sys" (fun fd -> write (readlines fd)) Real production code would also take care about proper closing the file in case of errors.