Language comparisons

Started by
8 comments, last by JimPrice 19 years, 4 months ago
Disclaimer - I am definately not trying to start a flame war with this topic, although I realise that it may be seen as flamebait. If it is seen as such, I have no problems with it being deleted immediately. Second disclaimer - I have googled and forum searched, but haven't found this exact topic discussed. With that out of the way... I'm just back from the library, picking up some light reading for the christmas period - Learning Python, and Visual Basic.NET Unleashed. Yup - I've decided to broaden my programming horizons. On these forums, I often see questions like 'Which language is better', and the response is often along the lines of 'Whichever is most suitable for the job'. This is a sentiment I thoroughly agree with; in my previous life, I often ran 3 or 4 mathematical programming languages at once (for those interested - SAS, Splus/R, NONMEM, Nonlin), because they all have their strengths and weaknesses at different things. Now, however, I'm learning more about general programming. I'm interested in learning what type of situations you would choose a certain language for? So - what situations would you recommend {C / C++ / C# / Java / Python / VB / whatever} as the most appropriate tool for the job. I am not just interested in game programming by itself, although it's obviously of interest; just any language that you feel has a definite niche, and what that niche is. Even if it's just - well, everyone uses C++ in the game industry! As a corollary - is there convergence in programming languages? As there commonly seems to be 'A isn't as fast / easy to program / powerful / sexy as B', and developers obviously address these issues, does this mean that language convergence is an inevitable endpoint? Or is my knowledge of the breadth of programming still too limited to really see why this won't happen. Or should I just go back into my hole and use the search engine to find out each a vs b topic? So - to conclude : I'm not interested in which language is the best. I'm interested in the types of job that would naturally suggest the usage of a certain language. References, comments, abuse - all welcomed. Thanks, Jim.
Advertisement
Er... just from my personal knowledge C++ is good for time critical things but if you want to make a utility or something that uses windows C# or VB is definately the way to go. So yes, in short C# and VB definately have their niche in the Win32 arena.
Quote:Original post by JimPrice
Now, however, I'm learning more about general programming. I'm interested in learning what type of situations you would choose a certain language for? So - what situations would you recommend {C / C++ / C# / Java / Python / VB / whatever} as the most appropriate tool for the job. I am not just interested in game programming by itself, although it's obviously of interest; just any language that you feel has a definite niche, and what that niche is. Even if it's just - well, everyone uses C++ in the game industry!


Ok here is my output.

C - Don't bother to learn - anything you can do in C you can do better in C++, including shooting yourself in the foot. [wink].
C++ - Definitly used a lot of because of its raw power. If you are going to make non-internet games for the computer, this is the route to take.
C# - Havent used it but I heard it beats out MFC
Java - Has all your internet developing needs.
VB - www.vbsucks.com [wink] It is slowly being out-sourced by C#
Python - never had anything to do with it

Mostly if you have a non-game project, you will eaither use MFC,VB or C#. Java can be decompiled quite easily I believe if it is not compiled as an .exe, so it is not that useful for sensitive material. I think C# is becoming the new way of doing Win32 developing, but that is a big *I think*.
If you are going to make Half-Life 3, you undoubtly will use C++. No arguments there, C++ is the best there is when it comes to having to do a lot with one language.

I hope this helps a little. Kind of thrown together, but you should get the idea.

- Drew
Quote:Original post by JimPrice
Now, however, I'm learning more about general programming. I'm interested in learning what type of situations you would choose a certain language for?
There's a lot of overlap between them, and the progression toward managed, just-in-time compiled intermediate languages (MSIL/.NET, Java bytecode/JIT) is further blurring the lines. Personally, I always recommend starting with the language with greatest expressivity, barring other considerations (such as client mandates, etc), and spot-optimizing with more deterministic or performant languages as necessary. For me, I start with Python and then optimize with C/C++. I use C# for .NET programming, but once IronPython hits 1.0 I'll have a nearly all-Python workflow.

Why? I find Python to be like "executable pseudocode," and it lends itself to writing "throwaway code" for exploring ideas. Once the implementation is functional, I can then optimize the Python or rewrite specific routines in C/C++ for extra performance (after using Psyco). Note that there's no need to optimize in C/C++ for .NET, as it all compiles to MSIL and is JITted, anyway.

Clearly, there's a large amount of personal bias. It makes no sense to determine that a language that you don't know is best for the job! Similarly, it doesn't make sense to determine that a language with a relatively high learning curve in which you are less than perfectly proficient is best.

Quote:As a corollary - is there convergence in programming languages?
All programming languages are moving toward a "friendlier LISP." That said, some people are wondering at what point we'll move away from text-based programming.
Language differences are disappearing quickly. At my day job I write in C# mostly and really enjoy it. C# is a beautiful language for doing application development. For big personal projects I wrap Win32 with C++; I like interacting with the API directly (rather than through wrappers). When it comes to throwaway code or text processing, Perl fits the job nicely.

Decide what you like about languages and go from there. I tend towards languages that are:

1. expressive, in the sense that I can have some flexibility beyond typical method calls when trying to convey abstractions to the reader (this rules out Java)

2. widely used - I am a bit of a fanatic when it comes to proper tool support. You will have a hard time prying the MSVC debugger out of my hands; but my steps towards TDD are somewhat alleviating this. One day I'll just go the vim route and never look back. Not today, mind you.

3. imperative - alternate programming paradigms are neat. I'm a bit lost as to how one would structure a larger program in, say, a functional language.

4. compile-time error checking - I prefer working under a system in which as many errors as possible are caught at compile time.
And, the above would be me. Oops.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
There are also other considerations besides technical ones. For instance, what resources are available? If I have a project with no budget for a new IDE or to re-train devs, it'll be written in whatever language I have tools and devs available for (ugh, BAD BAD grammar!!)

Other things that get considered are:
1) will the code need to interface/ be re-used with an existing product? Then it'll (probably) get written in whatever works easiest with that product.
2) Are there a bunch of devs who are really keen to try out a new technology, and can con management into thinking it's the best solution? Don't laugh, I'v seen this happen so many times. (what, you want a simple command line calculator? Well, I'd recommend implementing a .NET web service using XML, SOAP and the baddest-ass ORACLE/insert-choice-of-DB-here backend. why? you mean apart from "it'll look really good on my resume"? uhh, scalability?)
3) the opposite to 2. Whatever the project manager (usually a former coder) wants. You'd be amazed how many projects technologies are determined by the prejudices of pm's. (so let me get this straight, you want us to write an entire financial trading system from the ground up. And you want it in C, with no middleware, developed using version 0.0003 of whatever crap-ass compiler you used 20 years ago? Uhh, why? ahhh "'cos it was good enough for you"... fair enough, you're the boss)

Ok those are obviously extreme examples, and good companies will avoid them, but in business (including game development) the best technological solution is not always the primary concern (unless you're an ex-microsoft employee with $40 million of your own cahs and can afford 6 years to make your game [smile])
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
Quote:Original post by Oluseyi

Why? I find Python to be like "executable pseudocode," and it lends itself to writing "throwaway code" for exploring ideas. Once the implementation is functional, I can then optimize the Python or rewrite specific routines in C/C++ for extra performance (after using Psyco). Note that there's no need to optimize in C/C++ for .NET, as it all compiles to MSIL and is JITted, anyway.


By reminding me of Psyco, you have saved my life. Thank you, sir.

I will explain myself should my experiment succeed tomorrow. Inshallah.
What Oluseyi and antareus said.

Read up on Language Oriented Programming

Just wanted to say thanks for the replies, exactly the sort of stuff I was looking for. Plenty of food for thought.

Rating++ all round. WooHoo [smile]
Jim.

This topic is closed to new replies.

Advertisement