Which programming language is the best to start learning/teaching about programming
-
As http://programmers.stackexchange.com/questions/8973/programming-language-you-wish-you-learned-first is closed, let me do an attempt that actually meets all 6 requirements. At our faculty, there's for the moment a big change in the classes "informatics". We used to teach Java, but this is going to be replaced with Matlab (and the class will be called "Scientific Computing"). Personally, I'm not in favor of that idea, because : Matlab is not freeware, hampering the possibilities for the students to get hands-on experience. They can on campus or via VPN, but not on their own computers. Matlab isn't even a real programming language, but a mathematical environment that excells in that but fails in anything else. Matlab isn't suited for general concepts of programming. edit: these last two points seemed a bit strongly formulated. Matlab has progressed quite a bit since I last encountered it. Now I also had a problem with Java, as that turned out to be a real pain in the proverbial behind for many students, mainly because of the verbosity. As it's for a general course in programming, I think these points are important : all basic concepts of programming rather easy syntax without too much verbosity the possibility to easily program both procedurally and object oriented a short feedback loop on your programming a proven usefulness in many applications, especially in the scientific world (bioPerl, bioConductor, bioPython, bioJava, ...) so they can be used for practical work during their studies. What's your idea about the best teaching language on a serious level (hence not the pseudo languages used in primary or secondary school, I'm talking bachelor level at university/college)? edited to keep the question more general. Originally I mentioned R, Python or Perl, and : R is maybe less of a good choice as that one is a vectorized language. This is far from general, so it might be too specific. edit: I consider it a blessing, but the argument here was that a vectorized language is not general enough for teaching purposes as people would get into trouble when moving to Perl and Python. I'm also not talking statistics education, we're talking students of level 1st bachelor. Any direction, any kind. I just added the personal experience.
-
Answer:
If you are going to teach them how to program regardless of what it will be used for, then start with a programming language that is easy to understand. Ruby or Python seem like the best option right now. They are simple in their syntax, very popular, and fairly new which guarantees they'll be available for quite some time. They can also use them for websites and webservices with frameworks. No one really uses Basic or QBasic anymore and C while being the best in my opinion to teach a deep understanding or programming (memory management, stack, pointers, objects with C++, structures, etc.), it's too complicated and also "verbose". I was taught OOP Pascal when I started and I wish they had started me with functional programming before telling me that everything needs to be an object. I didn't grasp the difference and the advantages and disadvantages until years later.
Joris Meys at Programmers Visit the source
Other answers
From the shortlist I vote Python. Interesting alternatives (that I have at least some familiarity with) include Object Pascal, Modula 2, Ada, C#, Scheme, Objective CAML, F# and Haskell. I disagree with duros - I use C++ every day and I used C for years, but I don't see C-family languages as a good first choice. That includes Java, C# and Python - when you learn about pointers, it helps to make the pointer operations as explicit as possible - not hidden in the form of Java-like implicit references. For pointer stuff, I suggest a Pascal-family language first. Verbosity will be at least on a level with Java, though, and the lack of garbage collection is significant (not necessarily a disadvantage, but significant either way). C and C++ I'd reject on weak typing issues - implicit casts, which aren't always a good thing for learning in particular. Also, there's oddities like int *x, y; (y is an int, not a pointer-to-int) which can confuse. The comma operator probably catches everyone when they write their first switch statement, not to mention forgetting break. And C++ is just a huge language, with nice features true, but also with some real nasties. The one thing that might make me rethink that - Visual C++ Express Edition is free (in the beer sense) and very good. So good that you might want to consider it for running-in-the-debugger-as-a-teaching-tool reasons. The same applies to Visual C# Express Edition, of course. Most alternatives have issues in terms of convenient libraries. Python, Perl, Java and .NET languages (C# and F#) are hard to beat for that. Ruby probably belongs in that list, but I'm not very familiar with it. You may be able to work around some library issues for other languages by providing a "distro" of ready-built libraries with some automatic configuration, but this may involve quite a bit of work. For example there are libraries for just about anything for C++, but it takes a bit of research to select libraries, make builds of them that can link together compatibly, tell your tools where to find each library and so on. You can solve that to some degree with a "use Linux" policy, but the range of languages that get serious library support in Linux repositories is limited. Haskell in particular requires a very different skillset to more conventional languages, so should probably be disqualified unless you're are looking to teach that particular skillset. Other functional languages I've mentioned may also be rejected for similar reasons, though Objective CAML and F# are very plausible exceptions, capable of doing everything that conventional imperative languages can do with not-that-different syntax, but adding a range of tricks from the functional toolkit. F# also has the benefit of access to the .NET libraries. Perl, I'd reject simply because I don't like the language - not entirely for subjective reasons, but I still wouldn't want to have to defend that position. So - Python probably still gets my vote, but a Pascal-family language is probably better for learning pointers (Free Pascal or GCC Ada) and Objective CAML is a very interesting alternative (as is the closely related F#).
Steve314
When teaching well educated adults programming as a cross-curricular thing, ie. science majors, maths majors, I find that it sinks in best if you approach it from a position they are comfortable with. Introducing programming via a language orientated to the sort of tasks they face like Mathematica, R, etc, with real world problems that they are aware of the methods to solve the issue and are aware of the need for a computerised solution. That way they tend to see the point of it, the transition is not overly confusing and they start to learn basic programming concepts via a form of osmosis. If they need to do something more complicated, then they can step up to something more traditionally broad in scope a lot easier than if they started there. Failing that, pick an easy to read, forgiving language with good feedback when you have made errors and easy debugging. Students get put off by a long road to results, instant/quick gratification is key to retaining enthusiasm.
Orbling
How is a vector-based language a bad thing?! Especially if you're teaching beginners, you should focus on getting things done rather than worry about loop indices. Plus, R already has math and statistics routines built-in, which is exactly what you want in a "Scientific Computing" course. If you have your heart set on Python, at least use the http://www.scipy.org/ libraries. These will give you math routines as well as present a vector programming interface.
chrisaycock
You're talking about a pretty specific environment, i.e. solving complex scientific or mathematical equations. I don't see where teaching the class using a general computing language (java, C#, etc) would be that beneficial, as they're not going to have the required syntax or library functions you're going to need. I don't see where teaching a particular language (or environment, like MathLab) is going to be a problem. Don't most IDEs or environments offer student pricing? Sorry, the question led me in the direction of that specific environment, if you're talking about a general computing environment, I'd go with teaching what is currently dominating the market to give them a feel for what is out there. I think thats currently either Java or .Net
BlackICE
As someone coding in Matlab on a daily basis as a researcher in biology, I do have to ask: What makes Matlab "not a real language" in your opinion? Its history of being good for numerical analysis? Because Matlab does fit all the requirements on your list, and the disadvantage #1 can be taken care of with a good set-up of the license server (I don't need VPN in order to use a license at home). Anyway, I guess that, in the end, the choice of programming language should really depend on the goals of the class. If what you want is give the students an idea of what they can do with programming, Matlab is great, because it's easy to write code, easy to debug, and the documentation is excellent. Python (with SciPy/NumPy/matplotlib) could be an alternative, but is a bit harder to get into than Matlab. If this is an introductory course for "general programming", after which they go on and learn a lot more programming, Matlab is not such a great choice, because students will not have learned to do declarations, they'll know nothing about pointers, and because they'll still start counting at 1.
Jonas
I vote for Ruby for five reasons: It's designed for programmer happiness. It has the rails framework for those that like web and ui stuff. It has good testing frameworks. It encourages more 'human' readable code than java/C. [covers head] It's a good implementation of MVC. Excert: [from Wikipedia - http://en.wikipedia.org/wiki/Ruby_(programming_language)] Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. It was also influenced by Eiffel and Lisp... supports multiple programming paradigms, including functional, object oriented, imperative and reflective. It also has a dynamic type system and automatic memory management...
Michael Durrant
Related Q & A:
- What are the common usage of python programming language?Best solution by quora.com
- What is a "modern" programming language?Best solution by Quora
- Which is the best programming language?Best solution by Yahoo! Answers
- Which language would be best to learn if I'm going into the Medical Field?Best solution by Yahoo! Answers
- Which is the best to start off as a fresher?Best solution by Quora
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.