Author
Topic: What language is the best for a new programmer to start with? (Read 33445 times)

I have a friend who is wanting to start coding, the problem is what language. I am partial to VB and C++ as those are what I was brought up on, but I want to get some input from the coding community. Any thoughts on what would be a good place to start when going for Windows applications programming while allowing for cross platform compatibility using libraries like WxWidgets, etc.

Delphi makes it very easy to do GUI applications, and Object Pascal is a pretty fully-featured language (and doesn't lend as easily to bad code as BASIC), and it's a lot harder to shoot yourself in the foot than with C++. And while Borland's code generation isn't top notch and the VCL is bloated, the results are a lot better than you get with JAVA. It's also pretty easy to migrate from Object Pascal to C++, as the languages are similar (different syntax and C++ is more powerful, but they have a very similar common subset).

Cross platform isn't something you should try and learn as the first thing, imho, since it's quite a mouthful, and can be very discouraging.

C++ could be an okay learning language as well, but I haven't seen any decent material aimed at newcomers. And it _is_ easy to shoot yourself in the foot. One should never teach (non-plus) C as a first language, too many needless details, even more opportunities for foot-shooting, and horrid and unsafe string library functions, pointer hell, etc...

VB... dunno. It's very easy to click-and-play and sure you can do larger things in VB and sure you can enforce okay coding rules... but it's too easy to end up with horrid spaghetti code, and even with "option explicit" it sometimes feels a lot like you're dealing with a typeless language. But my VB experience has mostly been from Office programming where you're dealing with magnificent transmogryping COM objects with poor documentation, horrid lookup functions in the documentation, craptastic member/method names (using 's' to designate plural isn't a good idea in programing), etc.

I ditto what Veign said. The real meat an potatoes of the corporate job market will be solidly C# in the next two years. If you friend is dead set on crossplatform *and* this is their first language, I would strongly suggest Python. The point f0dder made about Delphi being an easy transition to C++ is doubly so because much of the Win32 api is wrapped by the VCL. So as you learn the VCL you will be learning C++ via proxy as you use the Win32 api reference docs which are in C++. You can also use C++ DLLs with Delphi.

If he wants to learn programming, I would start with Ruby coupled with an appropriate book like Learn to Program, Ruby by Example or Everyday scripting with Ruby, or with Python, both are easy, appropriate for beginners, and work with wxWidgets.

I'd leave C++, C# or Java for later, once he has grasped the basics. Starting with those also increases the chances of him to quit soon...Ruby and Python are more fun to code in, and good for creating solid programming habits too.

Clearly, choosing a language to learn how to program (I'm interested too...) depends on what you want to do. But if one wants to learn the "basic transferable-transversal principles", learn good habits and still be able to write some simple and fun programs, what's the "best" choice? Here's what's been mentioned here :

Hm, I think Ruby is still too young to promote this way. (And implementations are still semi-buggy and heavy).

Even Python is a relatively new-fangled language, but it has some years of baggage and has matured a lot. And it seems the standard libraries have also evolved a bit beyond very thin wrappers above the native API, which wasn't really all that portable.

In the past I've often turned to O'Reilly books for learning languages, but as I look over their C++ catalog it seems the only book they have for beginners is C++ The Core Language which was published in 1995. Would a book on computer languages still be useful after 13 years? There's also Practical C++ Programming published in 2002, but I can't really tell if that's a beginner book or just a "now that you know how to program C++, how about we show you how to do it properly" kind of book.

What's a good, up-to-date book on C++ for beginners?

And I'm also interested in hearing your opinions on O'Reilly books in general. The only reason I'm "loyal" to them is because my brother used them and recommended them to me back when I first started coding in 1998 or so.

A large part of a program is the UI and coding a UI in C++ MFC, etc is not easy at all. If you are interested in Windows programming, I'd recommend a .Net language (VB, C#) if you want to go the .Net route, or VB6 or Delphi for the COM route. For web dev. I'd go ASP.Net or VWG (http://www.visualwebgui.com)

Hmmm. That's close, I don't remember the exact dates. AFAIK the last real watershed in C++ was the STL. If the book discusses the STL (or the official inclusion of templates in the language, which I think pretty much coincides), then I think you'll be OK.

A large part of a program is the UI and coding a UI in C++ MFC, etc is not easy at all. If you are interested in Windows programming, I'd recommend a .Net language (VB, C#) if you want to go the .Net route, or VB6 or Delphi for the COM route. For web dev. I'd go ASP.Net or VWG (http://www.visualwebgui.com)

I agree completely. C++ is difficult because so much of the language is subtleties that are very much not apparent to newbies. And MFC is like root canal. I hated it back then, and today there are just so many superior alternatives that I would never consider doing such development.

A large part of a program is the UI and coding a UI in C++ MFC, etc is not easy at all. If you are interested in Windows programming, I'd recommend a .Net language (VB, C#) if you want to go the .Net route, or VB6 or Delphi for the COM route. For web dev. I'd go ASP.Net or VWG (http://www.visualwebgui.com)

Ah, thanks Pierre. So C# or Delphi are not a bad idea. Now... to find a 1 or 2 good books...

@Deozann : Regarding books on C++ :Learn to Program with C++ by John Smiley seems to get some good reviews too. Apparently, it's really made for the novice (like me). But maybe would it be to slow for you.

VB, C#, VB6, Delphi... All of these are strictly Windows, aren't they ? If one is thinking portability-compatibility (with Linux, for instance...), I guess one has to go more with... java, python or ruby ??

VB, C#, VB6, Delphi... All of these are strictly Windows, aren't they ? If one is thinking portability-compatibility (with Linux, for instance...), I guess one has to go more with... java, python or ruby ??

If one is thinking portability-compatibility (with Linux, for instance...), I guess one has to go more with... java, python or ruby ??

This is one of my pet peeves. Why would you think portability is important? There are vanishingly few pieces of software that can be good on all platforms even if your choice of language, libraries, programming, etc., are all perfect.

Users in 2008 deserve a level of usability that simply can't be achieved by a portable application. Windows, Mac, and the various Linux UIs all have different metaphors. Too, the types of people using all of these platforms differs significantly, with different goals, different skill levels, etc.

The fact that something can run on all these platforms does not mean that it will usable on all of them. You won't be able to optimize your UI toward the expectations of a given platform. And you won't be able to design your interactions in a way that works well for all user types.

Better to do it well on one platform. If you know what kind of software you're trying to build, then the rest should logically follow.

A full application might not be feasible to do portably, but portability is important when you're writing library routines. And even if you don't aim to make your SuperAppTM portable, it doesn't hurt keeping portability in mind, as it (imho) helps you think a bit more componental/modular, and leads to cleaner code.

As for O'Reilly, their books are a mixed bag. Some are pretty good though. My bookshelf has most titles by Addison-Wesley.

My idea of learning a portable language only comes from the fear of being strictly OS bound... I guess the idea is driven by the frustration with all these Windows applications that I'd like to use in Linux (but can't)... Instantly, without any further integrations, customization, etc.: Farr, SyncBackSE, abbyy fine reader or omnipage, X1 or Archivarius, etc.

Now, from what you say, I understand that portable applications usually can't achieve the level of usability that non portable ones have. Or can they? Is that because of the limits of the languages used ?

A full application might not be feasible to do portably, but portability is important when you're writing library routines. And even if you don't aim to make your SuperAppTM portable, it doesn't hurt keeping portability in mind, as it (imho) helps you think a bit more componental/modular, and leads to cleaner code.

Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!

I still stick with my first piece of advice, which is to try to find a book that motivates you. But perhaps the other thing to say is that maybe the important thing is not to choose the best language for you right away -- instead, it may be most important for you that you try a few languages.

Not only will this let you figure out which one suits you best, it will serve the very important purpose of helping you to see which concepts are common across languages, and which features are specific to different languages.