And if your company won't let you upgrade compilers, then it certainly won't let you switch languages altogether.
115 karma · joined June 19, 2013
And if your company won't let you upgrade compilers, then it certainly won't let you switch languages altogether.
It's just annoying when people will do anything to get on the "faster than C++" wagon.
Uh, what. Can you clarify?
In addition to, as the author encourages, being "weary of the 'by obscurity'" argument (as I'm sure we all already are), I would also advocate being wary of it :)
What I mean to say is that Wikipedia's system is one that does not/will not give article editors credit for original content; it treats them as just collectors and explainers of original content. When the explainers start writing stuff that has no source, they then disappear and leave Wikipedia holding the content which is now unverifiable. And that's just not how Jimmy wanted it to work I guess.
When I look at it that way, the policy doesn't seem that ridiculous. It may be inconvenient, but that's like saying a stack data structure is inconvenient because you can't remove things from the bottom. It's just the way it is; it has advantages and disadvantages.
Glad you read the article though, now you're not going to fall for this flaw in the future.
Not only that, but if it were the actual file on your local drive and not a link, there wouldn't be an option to "make this file available offline". There were cues which the author missed, but they were obviously not prominent enough which is a (the) design flaw.
Let this be a lesson that you should have multiple backups for anything important. I personally have 2 online backup systems and 3 local ones, the worth of which practice I learned the hard way like this author.
Also think twice before you empty the trash - you're manually making these files unrecoverable from the internet, and if your machine went up in smoke after you hit the button, you'd be screwed. That alone warrants serious consideration.
Plus, he could have reduced lines even further to get down to about 6, like
vector<string> data;
string line;
for (ifstream ifile(argv[1]); getline(ifile, line);)
data.push_back(line);
sort(begin(data), end(data));
copy(begin(data), end(data), ostream_iterator<string>(ofstream(argv[2]), "\n"));
And his `return 0` was superfluous so I removed it.Unfortunately we work with iterator pairs in C++; if we had ranges like D does, we could turn those last two into
copy(sort(data), ...)
but alas we cannot. int[][int] whatever;
? Because I think we should be getting an array out whenever we do whatever[1]
and not just an int.1. You picked probably the most verbose way to do it.
2. It's not valid C++ because you're assigning a pointer to a value.
3. Idiomatic C++ doesn't use `new` explicitly anyway
4. The `d = {}` of Python is not really equivalent.
My feeling is that python gains brevity in exchange for putting a heavier mental load on the programmer, which is manageable for small programs but becomes unwieldy for larger ones.
Wow. So much insidiousness packed into six little words.
They conveniently forget to mention by whom it should be known.
I don't know, I am similarly annoyed by mathematicians because they usually use single letters for variables. It's a little more excusable for them because math functions are usually very short and have few variables, but still I'd rather use words. But I digress.
But... why?
Also, what did you not like about the Lua object model?
cout << is_unsigned<string::size_type>::value;
and check it ourselves.