Re:Google paper comparing performance of C++, Java, Scala, a...
by cageface on Friday June 03, 2011 @03:34AM
(#2615493)
It may just be because I've been writing a ton of C++ lately, but to me the C++ data declarations are the most readable of the bunch. The stuff with iterators is much uglier, of course, but so far I like the syntax of C++ a lot better than that of Go.
[ Parent
| on HN ]
Re:Google paper comparing performance of C++, Java, Scala, a...
by stephen_g on Friday June 03, 2011 @06:10AM
(#2615768)
Yep, iterators are one of the most annoying things in C++. That's why I love range for in C++0x - instead of writing this, for example:
for(std::vector<std::string>::iterator it = vec.begin(); it != vec.end(); it++)
you can just do:
for(std::string x : vec)
So awesome!
Re:Google paper comparing performance of C++, Java, Scala, a...
by dzorz on Friday June 03, 2011 @06:36AM
(#2615804)
Even better:
for (auto &x : vec) { }
Re:Google paper comparing performance of C++, Java, Scala, a...
by cageface on Friday June 03, 2011 @06:46AM
(#2615822)
I can't wait until I can start using this in XCode.
Re:Google paper comparing performance of C++, Java, Scala, a...
by dzorz on Friday June 03, 2011 @07:57AM
(#2615981)
If you compile recent clang, it supports range based for loops.
Using https://github.com/Rip-Rip/clang_complete you can use smart context-aware completion with vim/emacs.
For example if you had this code:
vector<string> vec; for (auto &x : vec) { x
and then if you typed period (.), it would show members from std::string. I'd say it works better than Intellisense (it's very precise and you use the same parser for code completion and final compilation).