ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: Best Beginning programing lanquage?
I'd say Ruby is an ideal learning language. It's got a very clean design and is fully object oriented. It also has a fantastic 'manual' (the Pragmatic Programmers' "Pickaxe" book). It's functionally very nearly as capable as more 'mature' (read, "more popular") languages like Python. It also exposes programmers to a variety of techniques and tools started by other languages (for example, iterators from Smalltalk and lambda-expressions from Lisp).
The only downside I can think of is that the errors the compiler gives are usually not specifically enlightening; generally little more than a line number, at least from the compiler version I'm used to. But typically (because of the clean and obvious syntax) it just takes a few looks at that line to indicate what's wrong.
I think it's a great language; I'd strongly recommend at least trying it out.
I learned SuperLogo when I was 11 or 12 years old, which gave me a good insight to what programming is all about. After that (or actually, simultaneously) I thaught myself CBM Basic and CBM assembly, but I've never actually used one of them. After that, I tried to learn C++, which went quite well. The languages that followed were Visual Basic (for Applications) (very ugly language, I wouldn't recommend that to anyone!), JavaScript (ugly language, but it can be quite useful), PHP and Perl.
That's why I recommend everyone who's new to programming to try a very simple and very visual language first, something like SuperLogo, then a very low-level language, to know what your program will do in the end, and then a very common language; could be C, C++, Python, even Perl.
Right now I'm studying Objective CAML for class. It's really nice. I don't think that it is a bad starting point, but the thing to remember is that languages tend to be clasified as:
Object Oriented [existance of class/object]
Imperative [can assign data into variables]
Functional [functions are first-class objects]
The "pure" Object Oriented language would be Java. The "pure" Imperative language would be C. The "pure" Functional language would be LISP.
O'CAML is a Functional Extended language. It's also fast (what was it, 50% of native C?). So it's in the same vein as LISP, Scheme, and Haskell but it's Extended features give it OO and Imperative stuff.
You might find it interesting that JavaScript has Functional features (although I'm pretty sure JavaScript won't do currying).
There are too many things that are considered "best" in my opinion. Is the beginner wanting to learn gui design? kernel design? console programs? Are they just getting their feet wet with programming? Will they be studying programming techniques casually, or interested in learning the best and efficient ways of doing things?
Best beginning GUI programming language would be VB. Very easy to use. I almost feel like I'm cheating when I use it. This will introduce the beginner to GUI programming.
Best kernel/system programming language would probably be C or assembly. I'm not much of a systems programmer, so I really couldn't tell you. I do know that systems programming seemed harder for me to pick up, though. :P
Console programs would be PASCAL, old school BASIC, or even QBASIC. These languages don't have any pointer arithmetic to worry about, which can often boggle the mind of newbies.
If you are just getting your feet wet, then I'd pick the one that appeals to you most. Simple GUI design? Complete control of memory allocation? Object Orented? VB, C++, and Java would all work for these. Java has better portability, while C++ gives the programmer more control over memory management. VB makes GUI design easy.
If you plan on studying programming really well, then the absolute FIRST language you should look at is a combination of C++ and UML. I fully believe that if someone knows C++, it's much easier to learn another language, rather than if you learned BASIC and then tried to learn C++. Once you play around with pointers, and then head into something like Java, a lot of things just seem easier than if you just started with Java. This is my personal opinion. UML is not a programming language, but a modeling language. Learning UML will help you organize your thoughts as a programmer. Once you can model a program well, then translate the model into code, then the good programming techniques will be developed. Heck, you may even find a job out there with your knowledge of UML.
I voted for Pascal. My memories are old, but some time ago i saw the comparing of C and Pascal in a book.
If someone want to start with OOP, you can employ RUBY.
here in Hamburg, Germany, RUBY is popular in the lug's.
I think it is a toss up between Python and Ruby (which should be on the list) actually Ruby might be easier to learn. For web work I like Rails and Zope. Ruby on Rails and Zope/Python. With either one you'd have a good foundation for both system level scripting and web development.
Depends what you want to do with it. If you want to do in-house/hobby applications, then any language will do. Grab something easy, simple and fast especially if you are a lone-wolf programmer. Python is ideal for it and to teach you the concepts of OOP, which any moderm programming language uses (or should).
Now, if you are ever going to program out of you room (AKA "get a job"), then it's better to pick a widely spread, enterprise level used language such as C++, Java or C#. You won't go very far with Python (or even C) out there. They are either seen as a toy or too old/difficult to use. From my knowledge, the few companies which still use C a lot outside Unix-Universe are companies developing games to Gameboy Advance. Still, the few hacked/leaked source codes for GBA flying on the net seems to be extremely OOP driven.
That's just my opinion though. Use whatever you want and listen to however you wish to
Last edited by Mega Man X; 07-03-2007 at 05:30 AM.
My choice is "C" . For any begginer it is good to start programming in "C" rather than opting for any other oop language because that is very complex to learn.
I am still pretty much a beginner. I started with BASIC, I've done a bit of Pascal (in school) and object-oriented Pascal (Delphi). A wee bit of VB/VBA, some C for microcontrollers, and most recently Python.
I like Python for beginners because:
- it's a very clear language - it often reads like pseudocode
- interactive mode is great for trying things out / debugging
- can do procedural or object-oriented
- can do GUI programming with nearly VB-like ease with PythonCard
Pascal is a very good teaching language, but it's mostly JUST a teaching language. I'd rather learn a language that a lot of people actually use.
I agree that the OLD Basic's led to bad habits, due to the lack of features. But something like QBASIC or Visual Basic is fine. You CAN write well-structured programs (so-called "good code") in these languages.
I think that C or C++ is not a good language for beginners. You can write bad code in any language, but it is almost encouraged to write hard-to-read code in C/C++. (It's the only language where I've heard of an "Obfuscated... " contest.) The whole concept of pointers is best left until one has a grasp of basics like flow control, looping, variables and data structures, etc. I think a beginner language should hide this complexity. Let us learn how to use a list or hash/dictionary before learning about all the pointer stuff needed to make that work.
Python tries to make simple things simple and complex things possible. In my humble, newbie opinion, it succeeds pretty well.
I think that C or C++ is not a good language for beginners. You can write bad code in any language, but it is almost encouraged to write hard-to-read code in C/C++. (It's the only language where I've heard of an "Obfuscated... " contest.)
On the page for the "Obfuscated Ruby Contest", which you linked, it says:
Quote:
The IORCC takes after similar contests for other programming languages, such as the International Obfuscated C Code Contest and the Obfuscated Perl contest. The primary difference is that while many people have criticized Perl and C for being opaque and hard to read and for having confusing syntax, Ruby is generally respected for its simplicity and clarity. In addition to being ironic, this provides a counterargument to a fallacious claim made in support of many new programming languages, that those languages are superior because obfuscated code contests cannot be created for them.
(Note that I didn't include Perl as a good beginner language, either...)
I don't claim that you can't write obfuscated code in Python (or Ruby, or any other language). In fact, I said that you can write bad code in any language. I hadn't heard of any other "Obfuscated..." contests, but it doesn't surprise me that they exist. My definition of "bad" includes obfuscation. Even if the code works and is efficient, if a knowledgeable reader can't easily follow it, then it's bad.
My observation, as a relative beginner, is that Python code is generally more readable than C (or Perl). I can read a lot of Python code and understand what it is doing. The "understandability factor" is, on average, much higher for Python than for C. A big part of learning programming is learning by example, which means looking at code that someone else wrote (either as a teaching example or for some practical purpose) and understanding what it does. Then you incorporate that understanding into your own programs. If the understanding is not there, or is harder to come by, then learning is more difficult.
I'm far, far, far from an expert on this subject. (I'm so far from expert, I need the Hubble telescope to see expert from where I am...) This is just my observation as a beginner myself, trying to learn a new language.
I'd definately agree that Python is more readable, that's by design.
As for ease of learning, there's always Bash, my personal favorite. Granted it's a scripting language, but so are Python and Perl. I'm still working on learning Python, I get distracted playing with Bash
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.