Ask HN: Help me convince a teacher we should learn Python (vs VB.net)
For a high school class.
He's a great teacher (from what I hear, and my conversations with him), though the current plan is to use VB.net, while me and a few others would much prefer Python. Key requirements/comparison points for him are that it should be easy to learn (17 year olds new to programming), and for me, I'd like to learn it as with LPTHW we can go along ahead of the class.
79 comments
[ 1108 ms ] story [ 1392 ms ] thread2. I respect Dijkstra, but I think he was wrong on this
I mean, has anyone actually studied the academic outcomes of programmers who started on BASIC or VB, versus those who started on other languages? Has anyone determined if programmers who start out in VB make more errors than programmers who started out in say, assembler, or C, or Python, to any statistically significant degree?
There may be a point in the underlying sentiment, but the thing as a whole just rings false in the post-microcomputer age. The big difference might be that the people Dijkstra was thinking of probably had had BASIC taught to them as university students, instead of tinkering with the BASIC repl of the 8-bit microcomputer they got their hands on as 9-year olds.
This year I've got node.js, rails 3, html 5, mongo db down pat, all in my own time. Its a fair bet that 90% of HN readers have done the same amount and way more.
Languages and frameworks are not important. Communication, problem solving and productivity skills are important.
Plus, learning more stuff = more fun.
Don't forget - the high school education system is set up so you learn what you have to in order to tick a box and pass your exams, the fact that something might be relevant/useful to your career is an accident.
From that perspective, the teacher probably just wants to teach lowest-common denominator easy programming to tick the box.
I agree with Ryanto - if you want to learn Python (or any other language) it's better to do it in your own time.
http://news.ycombinator.com/item?id=1885006
:)
However, I think it would be more beneficial if you guys were to learn (sorry) Java and OO knowledge so that you could take the AP test and perhaps save time and money if you decide to move on to college.
Either way, VB.NET would be at the bottom of my list. C# would be great, but the professor might find the C-style coding too overwhelming for the students. And F#, being functional, is probably out of the question for a number of reasons.
Don't underestimate VB.Net. It has a terrible history but most of that ended with VB6. Another bonus is that once you know VB.Net the jump to C# is trivial and now you know 2 in demand languages. You can also compile the same code into a program along side F#, IronRuby and yes, IronPython.
You aren't there to learn syntax, you are there to learn to program. You should absolutely learn Python on your own as well, knowing one will make the other much easier to pick up anyway. Once you've done that go and learn Scheme, or Ruby, or Scala, ir preferably all of the above.
At my high school we were taught to use Word and Excel because those were considered essential skills. We could have learnt Open Office or something else but really, how often are we going to encounter that in the real world? In terms of practical use, .Net is not a bad choice.
Personally I would like to see Python for getting started and practical use and maybe Scheme for going deeper.
I'd say let's take practical-business-relevance out of it (even though I'd argue the relevance of Java, Python, and Ruby to be plenty comparable to .NET).
We're talking about high school students, not trade-school students. I think the curriculum ought to be about opening their eyes to this really incredible world of solving problems with computers and logic. I also think a bit part of the key to that is to make sure we don't saddle them with skills that can't afford to develop. You know how bummed I was after taking AutoCad or using Photoshop in high school only to find out that I'd have to mow lawns until I was thirty to afford to use them at home? That's just stupid, and spirit-breaking for interested kids that don't have 800$ (or whatever) for Visual-Studio-Enterprise-Resume-Edition.
I think the best argument here is regard students running Macs at home which I have no reasonable counter to.
http://news.ycombinator.com/item?id=602307
and Norvig uses it...
http://www.norvig.com/python-lisp.html
I mean what more endorsement is needed? How about something really eloquent...
http://norvig.com/spell-correct.html
Here's a line-by-line translation of Norvig's code into VB.NET. Exactly the same number of lines, unless you count the block terminators like `End Function` and `End If`.
https://github.com/stevecooperorg/Norvig-Spelling-Corrector-...
The translation was fairly straightforward; I'm not a regular VB.NET programmer but I cut and paste Norvig's code into Visual Studio and did some pretty trivial rewrites -- 'def train(features)' -> 'Function train(features)' -- and that got me most of the way there.
I translated idiomatic python (list comprehensions) into idiomatic .net (linq expressions) but the translated code is almost identical in structure and number of code points.
You sound like you want to learn about programming. "Programming" is a different discipline than "programming in vb.net" or "programming in python" or "programming in lisp". Learning about programming is a multi-step process, in which you first learn to define a problem in a sensible way and create a set of instructions for solving it, then write it in a language a computer understands, and then learn how to figure out any one of a million other ways to write it for a computer to understand. The first and last steps are the most important and can take years, the middle one usually takes a semester or two at the most.
Let your teacher walk you and the rest of the class through the middle one with vb.net, then go home with your smarty-pants friends and start slogging away at the other two steps. Every time you get a programming assignment, do it in vb.net. Then do it in python. Then figure out what they have in common and where they are different. Explain it to your friends, and listen to their explanations. Then do it again in all the other languages you can find.
Python is a great language and it certainly is 'easy' in contrast to a bunch of other languages, BUT a high-school class is to learn to program in general, and Python doesn't strike me as a good language to learn to do so from scratch.
Ruby is a bit better, but I'd argue the same thing. VB.net really is a better suited language to learn to program, and although I don't really like it myself, I agree with everyone saying it's a great language to start with. You can always learn Python on your own time, and I'd even argue that with what you'll cover in a high-school class, it really doesn't even matter since you'll be ahead of the whole class (not the people, the curricula) in a month if you learn Python on your own.
While Python tends towards clarity and predictability, Ruby tends more toward conciseness and power. That means some things are not as straightforward to figure out.
I started with C when I was 12 years old, and I'm sure that has made me a much better programmer than I could have been had I started with something easier like Php. In that aspect I think VB.net (which is NOT the same as VB6) is a good language for high-school kids to start with and learn the ropes.
I'm also a bit confused about your statement about Ruby having a more forgiving syntax and taking that in a positive light. For an Intro to Programming course rigid syntax is ideal as it helps to avoid atrocities against whitespace and other crimes of legibility.
I said two things:
1) I think Python is not a good language for high school because of it's syntax which is not directly translatable to the bulk of other programming languages (and I say the same thing about Lisp now that I'm on it). At this point I made a comment that I would find Ruby a little tiny bit better (but not suitable either) because of it's forgiving syntax, not because of the flexibility aspect of it's syntax (as omitting parenthesis and comas would probably lead to confusion). Python is not forgiving in it's whitespace requirements, while Ruby can make use of blocks and curly brackets in a way that translates better to other programming languages.
2) That I learned C at an early age and it had a big impact in the way I developed as a programmer, to which you responded that you learned Java a year earlier than I did C without making a point out of it. What is this a competition now to see who learned to program earlier?
What language you learned on makes no difference 5 years later, but it does have a big impact on the first, maybe second year. As such, it should be a language where the knowledge and workflow is easily transfered to other languages. VB.net (which I actually dislike anyways) is a pretty straightforward language from which you can move to a plethora of other languages easily. Neither Ruby or Python are suitable for this.
1) Your teacher cannot learn a new language well enough to teach a bunch of high school students in time. Have some consideration for him.
2) Your goal when starting to learn programming is not to learn the syntax of any one language, it's to learn to solve problems using programming. - Learn about P-code ( or psuedo code ) - Learn about Simple Data Structures. - Learn about conditional( if-then-else ) constructs - Learn about iterative( for-while ) constructs, - Learn how to declare variables and initialize them; - Learn how to edit-debug-run code - Learn how to version-control code (any file in general) - Learn how to write functions/methods/sub-routines. - Learn how to comment your code for future debugging
These are fundamentally the same in almost all modern programming languages. The syntax changes from one to another is mostly cosmetic. The key is good coding and problem solving habits and attitudes.
3) It's easy to spend time on the internet and be anamored about a particular language, particular OS, particular editor etc - but in the long run, they are commodities; there's no great big differences between them
4) If you really want to work in python, do so. Finish your problems in VB.NET and re-write it in python. Just don't impose your preferences on your teacher and entire class. It would detract from the goal of the class.
On top of that, VB.NET makes it almost trivial to transition to C#, which is a hugely important language right now.
VB.NET can also give you a hint of mix-ins (through interfaces and extension methods) and functional programming. Not saying you'll get there in the class, but it's out there. The .NET platform gives you a taste of almost every programming paradigm out there. It's very versatile.
If you want to go through LPTHW, nothing is stopping you. In fact, you don't even have to wait for the class to begin. Just start.
The other thing people are forgetting is that starting with VB.Net gives a nice predictable IDE which any student can replicate at home with a simple installer. Anything like python comes with so many options and opinions that it can actually be a distraction from learning to program.
Windows is not as dominant as it once was.
What is much harder to learn, and is largely language independent is: 1) Problem solving - the ability to break problems down into simple task that then can be trivially solved. 2) Data structures - programs are unless unless they have data to work with. Knowing how to best represent it is vital, do you use an array, linked list, tree etc. 3) Algorithms - known ways of operating on data to produce some out come. Everything from using a loop to add numbers, to sorting lists, or adding a node to a red-black tree. 4) Design Patterns - know ways to structure code, in a tried and tested fashion. 5) Architecture and Interface design - how to structure your project as a whole (what goes where) and how to set how one portion interacts with all the others.
Along with many other things. Point being the first language you learn matters little, if you learn to program that cross any language barrier. I have not touched the first language I learned for almost a year, but have learned 2 others in that time.
Having said all that, I am most at home in Python because there I know many of the language specific features.
Hold on, newsisan, there are thousands of Python hackers here. Let's see if any cavalry ride to your rescue.
I'm not a Python guy so this will be weak, but I'll do my bit.
1. Community. Python is far more widespread in the web, open source, and scientific communities. It will be much easier to find interesting projects to play with and libraries to build on.
2. Simplicity. Contrary to what your teacher may have heard, Python is an excellent beginner language. VB.Net is actually way more complicated. It's Microsoft propaganda that positions VB.Net as the best language for beginners. (Edit: it seems nearly everyone here disagrees with this. Am I crazy? Let's hear from some Python people.)
3. Quality. Python is far more organized around clean programming constructs and practices than VB.Net, which is an arbitrary mess.
4. Openness. Python gives all the advantages of an open codebase and platform. I suppose I should list some, but I'm tired.
5. The REPL (http://en.wikipedia.org/wiki/Read-eval-print_loop) is hands-down the best technique for playing with programming concepts, trying out ideas and getting feedback, learning, and coming up with the building blocks for programs. Once you've gotten comfortable with the REPL you'll never want to live without it again. No one should learn programming without this invaluable resource, which Python has and VB.Net does not.
5. Cool. VB.Net is the ultimate in uncool. Python holds its own just fine. Frivolous? Yeah, but there are deep reasons for these things. Learn Python so the other programmers won't smell VB on you and peck you to death.
Good luck!
p.s. A simple additional principle you should know: never try to talk a programmer out of their favorite language. It can't be done. If your teacher is deeply attached to VB.Net, just go with what he wants and enjoy the positive aspects of the class (if he's a great teacher, that's the most important thing anyway and you're lucky to have him). If he doesn't care that much, though, maybe you can wear him down with your enthusiasm. :)
pp.s. Worst case scenario, write all the programs in Python and then rewrite them in VB.Net to hand in. You'll have more fun and learn more.
And thirdly, it just doesn't matter that much. You should be learning programming. Not <specific language> programming.
That is precisely why it matters so much. There's a general misconception that somehow, programming languages are fundamentally equal; that there's nothing specific a programming language brings to the table. I think that's false.
VB.NET is a relatively shitty language, and will make many essential programming concepts more opaque than something very clean and straightforward and transparent like Python. (Also, on a somewhat unrelated note: I'd say that on average, the VB.NET jobs are a lot less interesting than the Python ones.)
You can do closures in any language under the sun. They might not be called closures, and you might have to type more characters in some languages than others, but they're still closures.
My personal stance is that all languages are pretty much equal. The only real difference that matters is syntax and that's largely a matter of taste. Don't get me wrong, some languages are sane, some are insane, some are ugly, some are beautiful, but they all do the same thing - function as an intermediary language between us and a CPU.
There's so much snobbery around language choice, and so much fashion following which I think is a shame. Also identifying oneself as a "<language> programmer", rather than "a programmer" is sad.
Practically though, you get down to libraries, probability of creating bugs/typos, speed of runtime, 'community' etc if you care about those.
Where does a 17-year old go next with VB.net?
(not that I know of any open source projects in VB.net, but still)
I don't think that's the point nor is it what most people are doing. In an introduction to programming course, the language is a tool in which the concepts taught are illustrated. Letting the teacher use a tool that he is comfortable with will by far outweigh any advantages that using another language will bring.
Think about it this way: to learn how to drive Formula 1, does it matter if you learn how to drive a stick shift in a Ferrari or a Toyota Corolla? IMO no. (in this analogy it would be safer to learn in the Toyota, but I won't take it that far in the programming case...).
But Newsian's teacher -- they should teach what they know.
Having used both languages, I've not seem any serious language features that one has that the other doesn't. What is missing in VB.NET, or made very difficult, that Python makes easy? Or vice versa?
Python is used at many top colleges as the into course (Georgia Tech and MIT are ones I know off the top of my head) and additionally, Zed Shaw has written an excellent first text on the language downloadable for free (http://learnpythonthehardway.org/index)
Additionally: Nothing is stopping you from ALSO learning python at the same time.
Good luck! Just curious: do you guys have whiteboards or blackboards in class these days? Somehow teaching programming on a blackboard seems more appropriate & terminal-like to me.
Edit: To the person who disagrees with my advice, could you please let me know which part and why.
So in the end they caved, and I was in the first class that was taught the Java curriculum. The teachers had spend the larger part of their summer at Java courses and writing a syllabus. The result was a bunch of people who barely knew the language they were teaching, causing most of the time in class to be lost to mundane details like working with the JDK and API issues. (I remember asking how to execute an external program and nobody being able to tell me).
YMMV etc., but my advice: please let the teacher decide for himself what he feels most comfortable teaching and focus on programming fundamentals rather than complain about not being able to use a tool that is hip and cool in some circles. (read the 'the scene will kill you' article that was on here a few days ago, it holds for not only 'the startup scene' but also for pretty much all niche programming scenes, forum scenes like slashdot, reddit, HN; actually it holds for pretty much every scene in the world).