Choice of Programming Language – Justifying my Choice.

For a blog that normally only gets 25 views on a good month the 2000+ in the last day has been phenomenal! I’m having to suspend comments because I have a job to do. apologies, I will try and rephrase my personal preference to not using python at a later date. I understand I have things to learn(As expressed in the comments), but Python is not my preference in using a language as you have objections to my choices. Please try to appreciate this is opinion. I understand I need to research more into python and this MAY change my mind, but from what I have seen I am not a fan of programming the language, this does not make me a bad person or a bad teacher, just someone who has a difference stance from you. 

I get asked this all the time, especially with the rise in popularity of Python as a programming language. I have a number of reasons for my choice. Recently I was asked this by a parent who suggested that it was not as “Useful” as python. I think this is a good forum to share my reply.

There are a number of reasons why I have chosen Visual Basic as a programming language for GCSE and A-level and I hope the following justifies my choice. Visual Basic is used as an introduction to programming and is frequently used as a teaching language in a number of schools and universities across the country. I understand the popularity at the moment of the Python, however this language is also based on the C language. Students in Python are not required to do things such as declare variables, which is something that is required for GCSE and A-Level exams. The VB Language itself allows for the concepts to be laid out in a more verbose language in order for students to develop into other languages such as C++ and C# at A-level which is my ultimate goal (when students have an understanding of programming, then they can move on to more complicated languages).  It acts as a perfect transition language between the simpler syntax of  python and the more complex C++,C# and Java. It is true that Microsoft stopped programming in Visual Basic in 2005, however they did not stop programming in derivatives of this language and developing the software to program in visual basic, meaning as a foundation language it is perfect for introducing complex programming constructs. The Microsoft App store also actively encourages students to work in the VB.NET environment and it allows students to produce their own apps in this language, so the language is not dead, simply not as mainstream.  If Sam were looking to take his skills further I actively encourage students to look into app development for the windows store as it has no yearly fee for students unlike some of the other stores and charges students a lesser fee for uploading and promoting their apps, there are also loads of videos on dreamspark.com for students to learn from.  If Sam is also keen on programming he can also look at Young Rewired State which is a week’s programming in the summer holidays that allows him to develop his skills further (again, I will actively promote this in class and on the school twitter feed when it becomes available) As mentioned, my ultimate goal for the A-Level course is to introduce a more complex language such as C, C++ or C# as with the introduction of the computing curriculum lower down the school (and at other schools in the area) more students will be approaching the college with a greater understanding of coding and want to take that knowledge further. At A-level I also teach HTML, PHP, Java (Greenfoot) as well as other languages which is not required by the current A-level specification in order to give students a flavour of what other languages entail and provide them with a solid foundation for entering a career in programming. I also have a number of friends who work within the IT sector as software developers and am currently looking at the end of year 12 with providing students who are interested with work experience in those industries so they can take their skills further. Sorry for the length of this email, I hope it answers your questions.  If you have any queries, please do not hesitate to contact me.

Addendum: I am perturbed by anyone who chooses to slate my abilities as a teacher due to my choice of language, I want to teach students to be good programmers with strong transferable skills and this seems to be proven in their future career choices/options/abilities. If you are a teacher making this comment you are slating a colleague who, like you is trying his best for his students. As I’ve read some of the comments, yes I could of expanded on my feelings for why Python lacks Complex constructs. I am Aware of how Python is a very popular and powerful language and what it can do. I have met students who are studying Python at A-Level and they are not taught the basics of programming, Python (IMHO) allows you to dive in quickly however can teach you some really bad techniques from the start, but again this can be down to the teacher(not knocking into any teachers here). This is MY humble opinion and this was a letter to a PARENT. I was not trying to diminish anyone who programs in Python, I am not going to write in a letter to a parent a full essay-style justification(unless I had 4 more hours in my day!). As with any language there are strengths and weaknesses to all of them and there will be always people who agree with both sides, I was simply quantifying a question I am asked regularly. I have approved all comments so people can see the conversation, however I stand by my choice and although (as stated) I will look into C++ and C# for older students that I teach.

Advertisements

29 comments

  1. gflint

    I think any language will work if it is taught correctly. Too many times programming teaches want to make kids experts in the language used. At this age kids need to be taught how to lean the language, not be an expert in the language

  2. mike

    The problem is that VB is MS only. It is a vendor lock in. What about stuents that have a Mac or Linux at home? You chain them to MS.

    Also python being less complex/powerful than VB? That depends a lot. Python is easier to use (that also why you say you use VB and not C++), but much more powerfull. Here Sieve of Eratosthenes on 1 line:
    print sorted(set(range(2,n+1)).difference(set((p * f) for p in range(2,int(n**0.5) + 2) for f in range(2,(n/p)+1))))

    Now do this in VB.

    Also you have been slashdotted… Have fun.

    PS: I really hope you did not get any kind of bonus from MS for this. (I know some profs that implemented some .NET stuff for much to much money to afterwards tech C#)

    • mike

      Clarification: (I know some profs that implemented some .NET stuff FOR MS for much too much money to afterwards tech C#):

      They created .NET compilers for languages nobody uses for MS in Redmond on their sabbatical for 6 figures of dollars. E.g. ever used or heard of Oberon.NET??? Yes I mean you mister Gutknecht, could name others. QED

      You can remove the name if you don’t like it being that concrete.

  3. Cellar

    To me this reads like a painfully ignorant reply that disqualifies you as a teacher. However, in the interest of learning how you came to say these things, please explain your reasoning. You might start with some examples that you’d like to teach yet cannot using python, when and why you’d switch to C, and how VB is much better at those examples. Surely, as a teacher, you can give us straight-forward and insightful examples.

    • mrgict

      Disqualifies me as a teacher! please amend. just because my viewpoint is not the same as yours does not make it worse. This is a letter to a parent, not a full comparative document.

  4. Leo Goodstadt

    You are of course free to use whatever programming language you want in your teaching. Most of the imperative programming languages are much of a muchness so to some extent it doesn’t matter so much. (Trying teaching Lisp or Haskell instead…)

    However, you intrigue me what you say “When it comes to more complex constructs Python cannot do them and I would be forced to rely on C”. This seems bizarre on numerous levels. C is a much older, primitive and low level language. Its great virtue nowadays is that it is so close to the metal that it is (a) useful as a modern assembler, (b) gives a greater appreciation for the actual computations that the source code expresses.

    However, Python is a strong-typed extensible (user defined classes) garbage-collected object-orientated language with co-routines, functions / strings / vectors / hash tables as first class citizens. It is difficult to think of anything feature that is more complex in C (as in more powerful rather than a “what a pain” bit-twiddling roll-your-own string function, dangling pointer way).

    As a c++ programmer, one give-away is the unembarrassed envy from members of the c++ standards committee about many Python features, and how proudly we boast of simplified syntax in c++ 11 that are almost Pythonesque (e.g. range-based for loops).

    Could you perhaps give a bit more justification for your assertion, rather than leaving us with the impression that the rest of your article is also nonsense?

    There are of course many excellent reasons for choose VB over Python, not the least being that you or your students find it more familiar or congenial…

  5. Justin

    I would leave a school that did this. Using Visual Basic or any lock-in language is just bad form. When a student owns a Mac or runs Linux how can you expect him to complete his homework, let alone explore outside of the the given assignments? An educator teaching an unsupported (its not actively being developed any longer), proprietary (only runs on Windows) language is doing no favors to their students. I would go as far as to say they are harming their students.

  6. Jean-Francois

    It saddens me every time someone says that C is complex. VB is not only a dead language, but also has an overly complex type system and syntax. It is not portable. It runs on complex library/OS dependent runtimes. From VB.NET and up you need to be aware of its JIT features and garbage collected memory management. etc.

    On top of that, Windows App store is moving away from VB.NET and even C#, and is pushing Javascript(heavily C based)/HTML5 for new development.

    • mrgict

      my students would find it more frustrating, difficult to use things like { } rather than just begin and end. as stated at higher levels (a-level) I am moving to a C derivative based approach. this is GCSE.

  7. Robert J. Hansen

    As a counterpoint: while a Ph.D. candidate at the University of Iowa’s Department of Computer Science, I was often tasked with teaching the undergraduate curricula. These were largely done in Java (save for one C# section), which is the language you say you’d like students to ultimately reach. I used Python and a whiteboard to sketch out algorithms (including complex data structures, like red-black and AVL trees) and algorithms (Dijkstra’s algorithm, depth-first versus breadth-first search, alpha-beta pruning, etc.) and explain their behavior and what things the students needed to look out for, and then cut them loose to implement these data structures and algorithms in Java and/or C#.

    This approach was quite successful. For that reason, I have to say I’m deeply skeptical of the claim that “[w]hen it comes to more complex constructs Python cannot do them.” Pretty much all that Python prohibits you is playing games with pointer arithmetic and its ilk, and even then it’s easy to simulate them with a dictionary that serves as a simulated heap.

    • mrgict

      Maybe my phrasing of complex structures is wrong and this is causing the contention in commenters. I think I mean to say that I prefer the more solid structure of VB,C,C#,C++,Java Languages as a foundation for programming. I am aware of the power of python, but I was trying to justify that at the moment it is a very “fashionable” language to program in and not without it’s misgivings.

  8. Josh

    I’m curious, can you provide an example of “more complex constructs” that Python can’t do but VB can?

  9. Jonathan

    Strongly agree. If it wasn’t for VB at the time I probably would never have become interested in programming. The syntax wording is better for beginning programmers, not case sensitive, and just tends to be fun to work with. It is a shame that basic has fallen out of favor today.

  10. 0stargazer

    I think that starting off with Visual Basic is a great idea. I was pretty much thrown into C# at university level and constantly feel that I lack a strong base in terms of coding.

  11. JP

    For me the author is misleading people.

    Could you show some ‘more complex constructs Python cannot do them’ ?

    Long time ago I spent some time programming in VisualBasic and IMO it teaches bad habits – it is the worst nightmare of programming for me.

    On the other hand Python teaches good habits: code should be readable, one should use language idioms etc. etc.

    I would advise kids to avoid VisualBasic class if they want to be a serious programmers.

    • mrgict

      Again, Language is a very argumentative subject. I’m using this to justify my personal choice. I think that Python can do some complex things, more when embedded in a C language. what I’m seeing/finding with some students I teach from other schools is basics like data types are never mentioned in Python to students due to it’s dynamic nature of programming. I agree with another poster, its about teaching the skills that allows you to transfer to other languages (hence I mention C derivatives at A-Level)

      • darkstarsword

        “more when embedded in a C language”
        I suspect you don’t actually have much experience with Python based on this and other statements you have made (and maybe that should have been your reason for not teaching it, as that *IS* a perfectly valid reason) – the only reason I would ever consider writing C code to work with a Python program is if I am doing heavy number crunching and need better performance, or need a performance critical multi-threaded program. In most cases my time is better spent optimising the algorithm or using built-in Python constructs to replace a loop that is wasting time in the interpreter. I can do a hell of a lot more in Python than I can do in C, and there is nothing I can do in C that I couldn’t do in Python (except perhaps write a boot loader, OS kernel or device driver – but I don’t think your students are quite at this level).

        Python is a strongly typed language, Visual Basic is weakly typed. Visual Basic encourages the use of variant data types, which do not exist in Python (variables can change data types if you assign something to them, but won’t e.g. implicitly cast from a string to an Integer as VB does). Types in Python can be used explicitly or implied on assignment based on the type of the item being assigned – to find the type of a variable in Python, use the type function, as in:
        >>> a = 8
        >>> print(type(a))

        >>> a = float(8)
        >>> print(type(a))

        Python also could be used to teach OO concepts such as inheritance (which is far better off taught in Python than left to when they progress to C++ – I’d rate Java somewhere in the middle), or even more advanced concepts such as Duck typing or functional programming (not in a pure functional sense like Haskell, but in many cases more useful as it can be combined with other programming techniques).

        “Students in Python are not required to do things such as declare variables, which is something that is required for GCSE and A-Level exams.”

        Python REQUIRES variables to be declared before use:
        >>> print(b)
        Traceback (most recent call last):
        File “”, line 1, in
        NameError: name ‘b’ is not defined

        I assume you are talking about declaring variables before they are assigned, which is perhaps valid (in practice this is a almost a non-issue), but Visual basic DOES NOT REQUIRE variables to be declared before assignment OR USE (yes, there is option explicit, but in my experience all the students forgot about it after the first lesson, unless someone points out that they forgot it).

        My school taught VB (Since I had previously learned Basic and Visual Basic in my own time I was allowed to learn C++ instead), and as the top of my class many of the students came to me for help. Back then I hadn’t learned all the best practices of the industry, but it was extremely apparent to me that many of the students were picking up really bad habits (like using variants *everywhere*, often without even realising that’s what they were doing, or heavily mixing model and view together by placing all their code in a single button’s click event). Most just didn’t have a good understanding of what they were doing at all, rather just trying random things similar to what the teacher had been showing until it did something, or asking me to help them.

        Then there’s the fact that you are encouraging vendor lock in with (a) a vendor specific language and (b) encouraging use of the Windows App Store (have people truly forgotten how software was distributed before the iPhone?). Normally I’d just say DFTT, but you are a teacher and should know better. At least your goal is to eventually transition to C/C++, which are vendor neutral (Although MSVC++ still fails to implement many C and C++ standards, making it difficult to write portable code), but the fact that that is your end goal tells me that these students must be pretty good and not the kinds of people you should be teaching bad habits in VB. On the other hand from your statements you clearly are lacking experience in Python, so I guess you might be able to do a better job teaching them VB than a language you yourself do not know.

      • mrgict

        I like some of this, I love the comment on bad habit. I teach students to code “correctly” and the language does not make much of a matter if the way that you are teaching them is correct. e.g. to modularize code and avoid coding “on ptress events” and as stated in the letter above, at a-level I graduate students to c/c++/c#.

        My experience of python is limited (and for alienating people who are experts in the language I appologise), but from seeing what some schools produce who are teaching python, it is just as easy to build bad habits and sloppy technique.

        My aim is to try and teach people to be “clean coders” ones who code and plan correctly rather than just bashing out code. Thank you for this response as I think you’ve thought about what I’ve written rather than seeing me as a “python basher”!

  12. dgrb

    One thing you fail to mention is that VB is PROPRIETARY, hence if a student wishes to work at home s/he must run Windows.

    BTW your allegation that there are things too complex to do in python seems to display a profound ignorance of that language.

    I speak as someone who taught introductory programming for 20+ years and who has written thousands of lines of python code, incuding two assemblers.

  13. David Aldridge

    Ex-Oracle programmer, now RoR developer, FORTRAN77 from university (engineering) days etc, with my oldest boy started GCSE Computer Science this year. They do Python.

    I really don’t care what language they do, because I don’t want him to be taught to write code. Any fool can take a solution and turn it into code. I want him to learn to think about a complex problem, decompose it into manageable chunks, and apply logic to solving it. If that logic is expressed in Python, Ruby, Java or ADA, I really don’t care.

    ADA would be cool, though.

  14. sfinnie

    I’m not going to question your choice of VB- save for noting, as others have, that you’re excluding anyone who wishes to use a mac or linux machine. In reality that’s probably only an issue for home use since all UK schools I know of use Windows.

    I also agree strongly with @David Aldridge that what really needs taught is how to think about, structure, and lay out problems. That’s the real transferable skill. The trouble is it’s abstract. One gets to good logical thinking through practice, abstracting from examples and gaining skill. I’m not sure it can be taught directly, it seems to me the result of practice and experience.

    So you need an introductory language – and I respect you for making and publicising your choice. It’s not one I would have made personally – but then it’s not me teaching the course.

    The only bit that troubles me (as with some others) is your description of python. Not because I want to villify you for your choice, but because I don’t really understand some of your comments. And that makes me wonder if perhaps there are some gaps in your understanding of the language. So these comments are intended to inform – apologies if I’m saying something you already know.

    1. Python is strongly and dynamically typed. These are not the same thing. It’s the dynamic typing aspect that means variables don’t have to be declared with explicit types. If the GCSE curriculum requires explicit typing then I find it somewhat surprising – the dynamic vs static typing debate rages on in the industry. If you’re not aware of the dynamic vs static & weak vs. strong typing dimensions, I’d suggest reading up on it. I’d imagine it would be useful to know, even if only for discussion with a subset of students.

    2. One wouldn’t ’embed’ Python in C, nor is Python ‘based on’ C. Python is a full, turing complete language. It so happens that the primary *implementation* is written in C, but there are others: Jython (Java), IronPython (.Net). There’s even a native python implementation (pypy). In practice, performance is pretty much the only reason one would turn to C when using Python. Python is a complete language with a very wide range of high quality libraries. So C isn’t required to make up for some functional deficiency in Python; it’s used to make performance-critical code run faster. I find it hard to believe that’s an issue in the curriculum.

    • mrgict

      agreed, and I have conceded that this is something I need to look into as a teacher. some of the comments are from other Python developers who I have had conversations with and understood what they said to be true and other things from what I see being taught in other secondary schools. I am not a python coder to the highest level and therefore would need to research this.

      I would stand by my ability to teach a student how to code and my course that I design also proves this through sections where I introduce students to other languages, PHP, JAVA, JavaScript in order for them to see the transference of their skills (which I also mention in the letter).

  15. Peter

    This is the most confused post I’ve seen in a long time. It shows an incredible lack of understanding of computer science. Python allows true references, lambda expressions, closures, co-routines, and full functional programming. It can express structured, functional, object-oriented, and other styles of code. VB struggles to support proper data structures. Python also acts as a gateway into many other fields of computers science, such as numerics, network protocols, dev-ops, and machine learning, both by libraries and by language constructs. These are virtually impossible in VB, both by how cumbersome they are to express, and by lack of libraries. The same is true for many of the “more complex” languages you list as well. C is now obsolete for virtually everything except low-level code like embedded systems, kernels, and drivers. C++ is dead for all but legacy code. C# is a surprisingly good language, and very similar to Python, but it’s not a very healthy language either — the single vendor/single platform lock-in is killing it. Java is still big, but on the beginning of a long decline.

    Your choice of programming language does not “slate [your] abilities as a teacher,” but your rationale for it does. There are far too many teachers too ignorant of the subject they are teaching to convey it well. You, sir, appear to be one of them. My advice would be to take the next few years to /really/ learn computer science. A good starting point would be Structure and Interpretation of Computer Programs. The introductory course in computer science at MIT, Berkeley, and most other first tier schools was based on this textbook for many years, and what it teaches forms the basis of most modern programming languages, including Python, C#, JavaScript, and increasingly, newer versions of Java (but not C, C++, or VB). There are on-line videos of the lectures, and the problem sets were available through XTutor. Work through this. But really do the work. From there, you can go many places. Haskell is not a bad one. RoR isn’t either.

    • mrgict

      I think here (and I have conceded in an update) it is my lack of understanding of detailed python and more what I have seen other people teaching in other schools.

      I teach my students to be clean coders, ones that code correctly with decent, modular commented code and feel at 14 (With no prior experience of programming) this is enough for them to understand. As stated in the letter I am introducing C derivatives at a-level as that will allow them to take experience of coding further.

      Please imagine, the languages we learn now are dead in 5-10 years. so we prepare the coders to plan, design and create in a clean way. learning syntax is arbitary

  16. Matt

    I suspect that the instructor is teaching computer science concepts and Visual Basic is merely the tool he’s using to show them. If so, Visual Basic’s suitability for professional programming, or lack thereof, is irrelevant to the purpose of his class.

  17. karth

    VB.NET is a great programming language (accompanied by IDE) for quickly building GUI apps. Though I now mostly program in Python, but these are for scripts. VB.NET also allows the developer to expand into phone (Win Phone) and web apps as well. It is a proprietary language. But that alone should not be considered as the key reason to use python. Corporations use many proprietary software and I earn my living writing code for proprietary software.