So, since xorebxebx showed up and got around to promoting scala like it was the embodiment of christ in code form I've been looking into the language. I must say...It's actually uglier in syntax than java. I'm sure its great under it's skin, you know in compiler optimization and what not, but even so. It's by far the ugliest object oriented C rip off I've ever seen in my life. AND I for one would have to be shit faced drunk to be caught intimately coding with it. I just thought I'd share this with you all. It seems important.
Well, I guess we can safely say mine will be the last post on this thread.
It's by far the ugliest object oriented C rip off I've ever seen in my life.
Haven't you seen Objective-C? How can there be a language that uses + for something that has nothing to do with the + operator? It looks more like a diff file than code. Presumably, it was to make the language a strict superset of C, but the designer wasn't shy about adding keywords such as @interface or @end when he wanted, so what's the deal with the pluses?
@Seraphimsan: any arguments? Because what you are saying is a pile of unjustified FUD and personal opinion. Scala's syntax is simplier than Java's and C++'s. Just look at the grammar file.
C++ has the most ugly syntax, because it has **ambiguous** syntax:
AA BB(CC);
Is this a function declaration or a constructor call?
IDE designers curse C++ for this*. You obviously won't find an example of such syntax ambiguity in Java or Scala.
*) After almost 8 years after the last C++ standard was released, C++'s IDEs are still behind the Java, C#, F# and Scala IDEs in capabilities of refactoring, continuous bug checking or code completion. It is easy to do refactoring for languages with simple syntax. It is terrible to do correctly for languages with complex, ambiguous, redundant syntax.
It's by far the ugliest object oriented C rip off I've ever seen in my life.
Scala has nothing to do with C. Regarding abstraction mechanisms, Scala is far closer to LISP than C, C++ or ObjectiveC. And regarding its syntax, it is much closer to Python or Ruby.
Helios: Fortunately the terrible syntax doesn't stretch far, the only extension Objective-C really has to C is classes. You can still use pretty much all other C code as usual though, which makes it livable. In general I think it's somewhat easier to read Objective-C code than C or C++, mostly because members are to be strictly declared in a specific part of the class declaration, and methods are in a different part. For methods with multiple parameters, you generally have labels for each argument, for example:
[pObject Add: 5 To: 12];
Generally not a useful function right there, but you see my point. Writing a linked-list class using it wasn't all that difficult and only took about 500 LOC. My only gripe is that the Xcode debugger is almost entirely useless. -_-
xorebxebx: Hey, brainfuck is very easy to write a compiler for too, want to talk about the merits of using that language?
The definition of an ugly language is defined by most programmers as a language that's difficult to read and understand. C++, so long as the programmer isn't completely incompetent and can write its class and object names in a coherent fashion, is easily readable. There's no code that I've seen that wasn't easily understandable even with just a glance.
@Ngen: Oh, you are right. I've just skimmed through the C++0x feature list and now I understand. They have fixed C++'s syntax. I had outdated data. Now you can write:
std::map<int, vector<int>>
Look, ma! No space between the '>' and '>'!
I'm sorry for my previous posts. I consider C++ now a beautiful language!
Hey, brainfuck is very easy to write a compiler for too, want to talk about the merits of using that language?
Brainfuck is a lower level language than C++. So that doesn't count.
Scala is a higher level language than C++, yet it has simpler syntax.
The definition of an ugly language is defined by most programmers as a language that's difficult to read and understand.
C++ is perceived by many programmers as one of the most difficult to read and understand; maybe except pure assembly. At least by those programmers who ever happened to program higher level languages C#, Python, Ruby or Java.
There's no code that I've seen that wasn't easily understandable even with just a glance.
Readability and perceived simplicity are subjective terms. Anyway, have you looked into Boost's, STL or Linux kernel sources? :D
@Seraphimsan: ok, now more seriously, what don't you like in Scala's syntax?
Readability and perceived simplicity are subjective terms.
Good point. Then that whole argument is opinion, isn't it? I don't think it'll go anywhere, but I'll continue with it until someone says "screw it".
Boost and STL are easy to read given a section of code. If you asked me how a given container worked, however, I wouldn't be able to answer because I never bothered to go through the whole thing. The only intimidating thing is that there are a lot of classes, and that's just because of the way that the library was written. If you know the classes, then reading the whole source code is a cinch. But that's the way it is with every program regardless of the language, isn't it?
Honestly, Seraphimsan, I don't think that any of us can talk about the readability of Scala until we learn it. I remember saying it would be terrible programming in Objective-C, but now that I've learned it I've seen that it's hardly difficult to read and write in (again, aside from the poor debugger).
I've gotta' go get ready for work, don't expect me to reply to this for another 6-7 hours. I will respond to whatever messages are posted at some point, though.
Good point. Then that whole argument is opinion, isn't it?
Yes. But we can also discuss some other metrics like how easily understandable is the given language to the machine. Scala and Java win hands over many other languages. This **is** very important for the IDE support and for the quality of error messages you get from your compiler.
Another thing is how easily you can express various useful patterns in a language. Can you express them directly or do you have to write many lines of code? Or how many features / concepts are you required to learn to be profitable? Are the features of the language orthogonal? These are all objective measures.
@Kyon: NGen made assumption things are named appropriately. So you missed the point.
Furthermore, in general higher level languages have simpler syntax.
Not true. Generally there is no such relation. Some have, some have not.
LISP has extremely simple syntax while being probably the highest level language.
Assembly has also extremely simple syntax, while being very low-level.
C++ is middle-level and has a very complex syntax, especially the syntax of templates.