There has been quite a bit of talk lately about what should be the first language a new programmer should learn. With the new AP Computer Science Principles course starting next year, I find myself thinking about this in my spare time. I wanted to share my thoughts, and get yours in the comments below.
My Computer Science Journy
Before we get started with each thought process, I want you to know my background. I started programming my senior year of high school because I wanted to replace a text-based game that closed up. So, I started trying to learn Perl, and found that to difficult at the time and instead started with PHP and MySQL. Well, to think of it, next month with be 12 years since I wrote my first Hello World program.
The following year, I went to college and my first formal programming course was in C, followed by the next semester of Java. I have picked up other languages here and there.
Most of my hobby projects have been in Java, but I can say I can successfully teach any of these languages.
Java First – Four Years With The Same Language
This is currently where our program is now. We teach four years of Java programming which includes the current AP Computer Science A course which has to be taught in Java. Here is what I think the benefits of this approach are:
The huge one is that long term, students can go into more advanced topics sooner. Once we nail out the fundamentals in the first year, the second year we can go into advanced data structures, big-O notation and other second and third year collegiate stuff. We do not have the option to change the language to anything else past the first course.
In addition, every competitions are in Java. This would allow a first year student to compete without learning two languages together.
I feel that Java is not the easiest language for students to pick up right away. Just to make a Hello World program, you have multiple keywords the students are not ready to understand the meaning behind. This can make it very overwhelming.
If we are gearing this course towards students that are not going to be computer science majors, Java may turn them off of programming.
This year, I am doing an experiment where I am teaching them with Applets instead of using the Main method text based console applications. I am finding this is keeping my new students engaged longer. It has only been a few months, but I am hoping they are building a stronger foundation than in the past.
Python First – Java Second Approach
I have a friend that teaches at the university level that does a Python then C approach. This is where I am going to get most of my information. I would start students out with the basic console based programs and build them up to using PyGame during the first year.
The following year, they would learn Java and object oriented programming.
I think that out of all the languages Python is the easiest to approach as new programmer. No worrying about data types, did I forget a curly brace or semicolon, and it build fantastic formatting skills.
The downside would be that we would have to start over with a new language the second year and we would have to start over again. I think this is my huge road block on this. I pride myself on if students stay with me for two plus years, they will know almost every data structure they will see in a year and half at the college level. Making their college experience easier. However, I am not sure if I can continue to do that with them.
I love the resources out there for Python. Code Academy is the big one.
I am a little hesitant on listing this one. Web developers will jump on this and say it is a great choice. The web developer in me, says this is a good choice. However, this Java programmer in me tells me not to do it.
You get all of the additional things listed in Python (no strongly-typed variables, pickup and go syntax). However, is is closer to Java in terms of the syntax. You also have a great list of additional resources such as Khan Academy. I could add game development into the course with Unity.
There is a lot more tools available to learn programming here.
In addition, take what I said about starting over when starting with Python here as well.
So tell me what you think. Did I miss something? What would you do if you were me? Let me know in the comments.