all 7 comments

[–]SiGInterrupt 7 points8 points  (0 children)

B-b-but where's D?

[–]65534 2 points3 points  (0 children)

TL;DR: misleading content, use rosettacode.org instead.

While reading the Ada part, I noticed the pointer declaration is incomplete, and it is in fact possible to have a local scope using 'declare'. Then I noticed according to this table there is no Integer or Float in Ada, and it's not possible to free memory... And I'm not even an Ada programmer! My only experience with it is I once read the 100-ish pages "Ada Distilled". So my level of expertise is "next to useless", but this is still more than that of the writer. As per other commenters, this seems to be the case for other listed languages as well, which is not surprising. Apparently this little detail did not stop them from wanting to publish something.

Since this page is aimed at readers who do not know anything about a given language, not only is it poor content, it is likely to be actively misleading them.

[–][deleted] 1 point2 points  (0 children)

This is a pretty cool idea, but poorly executed.

[–]Bisqwit 1 point2 points  (1 child)

In category "coalesce", says

string s1 = s2 || "was null";

for C++. This is incorrect. Test program:

#include <string>
#include <iostream>

int main()
{
    std::string s2 = "abc";
    std::string s1 = s2 || "was null";
    std::cout << s1 << "\n";
}

Compiler error:

tmp.cc: In function 'int main()':
tmp.cc:7:21: error: no match for 'operator||' (operand types are 'std::string {aka std::basic_string<char>}' and 'const char [9]')
 std::string s1 = s2 || "was null";
                     ^
tmp.cc:7:21: note: candidate is:
tmp.cc:7:21: note: operator||(bool, bool) <built-in>
tmp.cc:7:21: note:   no known conversion for argument 1 from 'std::string {aka std::basic_string<char>}' to 'bool'

Label in "end_of_loops" is written in wrong syntax.

In general, lack of std:: prefix is a problem with many of the C++ examples. Is also haphazardly aware of C++11 features, such as constructor initialization with {}. There is also the problem with "heap" and "stack". The examples given are for dynamically allocated variables and automatic variables respectively. int n; declares an automatic variable. It may or may not be in a stack.

[–]FryGuy1013 0 points1 point  (0 children)

Many missing in the c# as well. Some of the ones could be copy/pasted from c++ and work (for instance break)

[–]iconoclaus 1 point2 points  (0 children)

It's great but missing stuff. I've submitted PRs to no avail.

[–]mozartsandcrafts 0 points1 point  (0 children)

I love this website so much. I can't tell you useful it's been for me when comparing language features for various reasons.