Favorite Programming Language?

Started by
135 comments, last by umbrae 16 years, 4 months ago
Quote:Original post by Ahnfelt
So is Basic's statement-continuation (_), but it's less verbose. As for ambiguity - for compilers it's just a matter of a well designed grammar. For us, line breaks are much more visible than a single character. On the 4 spaces / tab side, I wonder how much anger it would generate if the language only allowed one kind of indentation (for example, fixed four spaces).


And visibility should have little to do with the token structure. Even the One True Brace argument has been rendered moot by modern IDEs that will format the tokens to your own personal format.

Quote:
I agree, but the usual C implementation of curly braces and semicolons is lacking in that respect. Like the cliche
if(command == FIRE)    breakTruce();    fireMissiles();
One nice thing about if ... end is that there is only one reasonable code style. With curly braces there are dozens of opinions on how to style, which is just an unnecessary hassle when reading other people's code. Languages shouldn't give you freedom where choice is useless.


IMO the optional bracing is one of the failings of c/c++. Required Braces is better and (imo) more distinct from keywords/identifiers than 'end' style terminators. Which imo is beneficial.


Oh, and for the record I hate C++.
Advertisement
Quote:Original post by DevFred
Why didn't you do this:
interface ISceneObjectabstract class SceneObject : ISceneObjectclass Renderable : SceneObjectclass PhysicsObject : SceneObjectclass AudioEmitter : SceneObject

Am I missing something?


Oh no, suggesting that based on what I wrote is very reasonable. But suppose some of those are already derived from another class?

But regardless, you're right, and that's pretty much what I wound up doing. That was just one of those rare moments where I'd have been nice to be able to do it the other way :) . I hind-sight, I guess that was a pretty weak argument :)

Quote:Original post by Ahnfelt
Assuming we have explicit "virtual" and "override" for methods that can be / is being overridden or implemented, what if interfaces could define a body for methods declared "virtual"? (That is, methods that don't override other methods, but which can be overridden). That way you avoid the diamond problem, since you cannot override method bodies in sub-interfaces.
interface Vector2d {    virtual Float getMagnitude() {        return getX() + getY();    }    virtual Float getX();    virtual Float getY();}class Point implements Vector2d {    override Float getX() = x;    override Float getY() = y;    Float x;    Float y;}

It's still limited of course, since you can't override in interfaces - only in classes. This would be apparent if you tried to make a Vector3d interface inheriting from Vector2d, since it'd need another getMagnitude(). But would it cover your needs?


While you couldn't override the method in another interface, it still raises the question: suppose you derive a class from two unrelated interfaces, both of which just happen to have an implementation declared for a getMagnitude method? Which implementation does the class use?
Quote:Original post by DvDmanDT
LANGUAGE	LOVES	HATESLolcode:	1	2


Come on, nobody can serioulsy love lolcode!
Like (possibly in order)

Lua Ruby Lisp
C++
Java Prolog
C PHP

Dislike:

Basic dialects (old basic languages, I think VB has dropped some of the really irritating stuff, never used it though)

Interested in learning:

Python Haskell Erlang C#
Quote:Original post by gharen2
While you couldn't override the method in another interface, it still raises the question: suppose you derive a class from two unrelated interfaces, both of which just happen to have an implementation declared for a getMagnitude method? Which implementation does the class use?

Yeah, that's a bit of a downside. I guess in that case you could 1) get an error, 2) force the programmer to tell which one he means explicitly or 3) pick the first one in the order of interfaces in the "implements-clause". 1 & 2 makes it possible to break existing code by providing an implementation, while 3 leads to subtile errors. I guess it's not a good idea :D
Quote:Original post by DevFred
Quote:Original post by DvDmanDT
LANGUAGE	LOVES	HATESLolcode:	1	2


ORLY? NONE CAN SRSLY HAS LOVE 4 LOLCODEZ!!!11


Fixed [grin]
I can't really decide... I love C++ & boost, but now that MS has gone and turned C# into a really cool language, I love it too. Haskell with it's succinct pure functional love is up there too. Overall though, I suppose I'd have to say C++ for now, and by .Net 5.0 it will probably be C#.

There are lots of languages to hate, so I'll simply pick a minor annoyance: Python, and languages like it, which force me to repeat "self." constantly.
Quote:Original post by let_bound
Quote:Original post by Rayno
Quote:Original post by ToohrVyk
Objective Caml.


That makes two of us.


Make that 3, although I also like Haskell a lot.


I'll make that four, although I tend to favor F#.
Quote:
What is your favorite programming language? Choose one, and only one. Also, give a reason why you like it.

C++.

There are alot of reasons why I like it. I can probably say that one of the reasons is because it is the language that I first learned, and grew up with. Hence, I have the most experience in.
I'm very partial to FORTRAN.

It's not exactly a good language for programming games, but for scientific and engineering simulations, it's great. And relatively simple.

This topic is closed to new replies.

Advertisement