Slashdot Mirror


Justified: Visual Basic Over Python For an Intro To Programming

theodp writes ICT/Computing teacher Ben Gristwood justifies his choice of Visual Basic as a programming language (as a gateway to other languages), sharing an email he sent to a parent who suggested VB was not as 'useful' as Python. "I understand the popularity at the moment of the Python," Gristwood wrote, "however this language is also based on the C language. When it comes to more complex constructs Python cannot do them and I would be forced to rely on C (which is incredibly complex for a junior developer) VB acts as the transition between the two and introduces the concepts without the difficult conventions required. 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." Since AP Computer Science debuted in 1984, it has transitioned from Pascal to C++ to Java. For the new AP Computer Science Principles course, which will debut in 2016, the College Board is leaving the choice of programming language(s) up to the teachers. So, if it was your call, what would be your choice for the Best Programming Language for High School?

21 of 648 comments (clear)

  1. instant disqualification by X0563511 · · Score: 4, Funny

    Visual Basic is not suitable for anything, except perhaps as a form of torture.

    --
    For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    1. Re:instant disqualification by Anonymous Coward · · Score: 4, Funny

      VB.NET isn't that bad. It's just C# for people with an irrational aversion to curly braces.

    2. Re:instant disqualification by Anonymous Coward · · Score: 4, Insightful

      Yes. And 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? He chains 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.

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

    3. Re:instant disqualification by morgauxo · · Score: 4, Informative

      VBScript != Visual Basic

      it's kind of like Javascript vs Java

    4. Re:instant disqualification by vux984 · · Score: 4, Insightful

      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.

      If that's your idea of code to be proud of, you are an idiot who shouldn't have any input in teaching kids to program.

      Yes. And the problem is that VB is MS only. It is a vendor lock in.

      The programming you'd pick up in a high school computer course is hardly language proficiency. There are no jobs for people with "high school computer science" on their resume. Its a very basic introduction to structure, program flow, conditionals, variable, type, parameters, fucntions.

      And its not going to make one iota of difference what language you learned those fundamentals on in high school when you get to university.

      I'm not a fan of VB myself either... but its perfectly suitable for the task its being used for here.

    5. Re:instant disqualification by Celarent+Darii · · Score: 5, Informative

      Actually that example is not even valid Python code, you'll get an 'n not defined'. Furthermore you need to indent it properly. You probably want something like this:

      def primes_upto(limit):
              is_prime = [False] * 2 + [True] * (limit - 1)
              for n in range(int(limit**0.5 + 1.5)):
                      if is_prime[n]:
                              for i in range(n*n, limit+1, n):
                                      is_prime[i] = False
              return [i for i, prime in enumerate(is_prime) if prime]

      And VB6 you can actually do this on one line :)

      Sub Eratost() : Dim sieve() As Boolean : Dim n As Integer, i As Integer, j As Integer: n = InputBox("limit:", n) : ReDim sieve(n) : For i = 1 To n : sieve(i) = True : Next i : For i = 2 To n : If sieve(i) Then : For j = i * 2 To n Step i : sieve(j) = False : Next j : End If : Next i : For i = 2 To n : If sieve(i) Then Debug.Print i : Next i : End Sub 'Eratost

      If you want one-liner programs, we should really force people to use perl which is famous for that. Python is not friendly to 'one-liner' types of programs because it forces indentation.

      But really, the parser is supposed to work with you, not against you, so why not write it on several lines to help readability? I fail to see how writing code on one line really proves its power.

      For bragging rights, you could go full-genius mode [instead of full-retard] with APL (change 100 to whatever you want the vector of primes to be) :

      (~vv.×v)/v1100

      EDIT: Damn it, you can't even put APL code in Slashdot. Here is a link to explain the code

  2. This guy hasn't done his research. by nneonneo · · Score: 5, Insightful

    I understand the popularity at the moment of the Python, however this language is also based on the C language. When it comes to more complex constructs Python cannot do them and I would be forced to rely on C.

    It's pretty obvious that this guy hasn't done his research. This is a very ignorant statement about both Python and C in general.

    I'd love to see *any* "complex construct" that C can do, that Python cannot do in a general computer science/algorithm sense.

    1. Re:This guy hasn't done his research. by PPH · · Score: 4, Insightful

      Exactly, what can C do that python can't?

      Handle blocks of code independant of formatting constraints like indenting.

      --
      Have gnu, will travel.
    2. Re:This guy hasn't done his research. by Darinbob · · Score: 4, Informative

      You can teach some useful data structures in Python. Hash tables, balanced trees, priority queues, and so on. Python actually implements a lot of its data structures in Python. Many high level languages do that, including Smalltalk which really had no higher level primitive construct than an array.

      I'm a big fan of low level languages and that's what I use every day. I also used to be a teaching assistant at a university. And doing some advanced tree handling in C would be cumbersome for students a lot of times not because of the concepts but the details that get in the way.

  3. Proprietary by mrflash818 · · Score: 5, Insightful

    No, thanks.

    Choosing a proprietary solution is not a good answer.

    --
    Uh, Linux geek since 1999.
  4. Teach them Java or C# by NotDrWho · · Score: 4, Insightful

    May as well teach them something powerful and useful from the beginning. If the test is based on Java, then why not start them on Java?

    --
    SJW's don't eliminate discrimination. They just expropriate it for themselves.
  5. Javascript by A+nonymous+Coward · · Score: 5, Insightful

    I tell friends to play with javascript.

    * Any web page has source code to learn from.

    * Small edits to said source pages show instantaneous results and are painless.

    * No need for a comand line, which scares some people.

    * The GUI changes, like changes ol to ul, or adding table cell padding, or changing styles, or easy and fun.

    * Adding loops and conditionals are not very complicated, since most web pages with javascript provide sme examples.

    Overall, for someone curious about programming, it's about the best self-taught intro I can think of. Anyone who wants to learn mroe can find out if the like the concept, the puzzles, and the headscratchers with just as much time and thought as they want.

  6. C# by RockClimbingFool · · Score: 4, Informative

    I don't really think you can beat C#. There is a freely available IDE. It creates applications for Windows (large install base). It is an object oriented language. The syntax is straightforward (you don't have to deal with complex point nomenclature, unless you want to for speed). Its a modern language that is as simple or complex as you want.

  7. Lower Level != "Complex" by svanheulen · · Score: 5, Insightful

    I never understood why people think that C, or even assembly, are "too complex" for beginers. Obviously they're complex if you're trying to do something complex like graphics but why would a beginner need to do stuff like that? They should be learning the fundementals, which are often obsucred by higher level languages. Wouldn't it make more sense to start lower (and simpler) and work your way up so that you have a solid understanding of what's happening behind the scenes in higher level languages?

  8. Wirthian syntax ... by gstoddart · · Score: 4, Insightful

    I don't really care what language, but I'm of the opinion you should be laying your groundwork with something with a Wirth-ian syntax.

    Why? Because it's the most accessible syntax for people, relies on less of the syntactic sugar of other languages, has very explicit start end end blocks, "reads" very much like English, and in some ways can be useful to describe how things work at the assembly level.

    Things in the scheme family have some things which may be far harder to grasp for a beginner since they're essentially mathematical in nature.

    And things like Python ... well, the whole whitespace being syntactically significant is quite possibly going to give you some bad habits.

    There's a reason why Pascal and Java made good teaching languages for so long. If you can "speak" one Wirth-ian language, you can pretty much read all of them.

    --
    Lost at C:>. Found at C.
  9. Can I Object to Both? by medv4380 · · Score: 4, Insightful

    VB has always been a horrible place to start. Any programming language that doesn't have a ridged syntax structure like C is a bad place to start. It teaches sloppy habits, and makes it so you have to get rid of those habits if you want to move up into a more ridged language. C is an excellent place to start. Python is ok as a language, but makes the same sin as VB by trying to make things more "human" readable thus I believe it would have a similar effect. However, since my experience with this is limited to when VB as the idiots intro to programming I've never seen what happens when someone learns Python first. Again, C is an excellent place to start.

  10. TED talk about proprietary SW in schools by tepples · · Score: 5, Informative

    To understand why proprietary software in schools is a poor answer, please see this 15-minute TED talk.

    1. Re:TED talk about proprietary SW in schools by Fwipp · · Score: 4, Insightful

      Off-topic, but does anyone else hate this trend in the last couple of years?

      Person A: *Makes a statement*
      Person B: "Why that tho?"
      Person A: "Please go watch this 10+ minute video, it explains everything."

      I dunno, maybe I wanted a short summary in your own words, and not to spend ten minutes of my time listening to something that may or may not address my question at all.

  11. Whatever the TEACHER understands best by petes_PoV · · Score: 5, Insightful

    If the teacher doesn't know Python, they will have a difficult time teaching it and the quality of the lessons will be poor.

    In practice, it probably doesn't matter what the language is. The key is that it will only be a student's first language - not the only one they will ever user. So it's far better to teach them well, in a language the teacher is competent in, rather than to have the teacher just a page or two ahead of the children in the class. Apart from anything else, that will give the kids a more positive impression of CS, rather than having a teacher who continually has to look stuff up or answer questions with "I don't know".

    It's also important for assessments that the teacher is experienced in the language that coursework is written in. Otherwise the marking will be hit and miss and the teacher won't be able to properly distinguish well written work from stuff that works by chance rather than by design.

    --
    politicians are like babies' nappies: they should both be changed regularly and for the same reasons
  12. Re:Javascript by A+nonymous+Coward · · Score: 4, Insightful

    That's probably true once they get past the initial hurdles. But for newbies who don't even understand the most basic concepts, trying to explain the difference between 123, 12.3, and "123", or why 12 / 5 is different from 12.0 / 5.0 is confusing.

    Javascriupt's primary benefit is letting the newbs discover for themselves whether they like programming. I used to tell people, way back in the day, to take any community college beginning programming course; if they couldn't wait to get to the class and stayed late at the lab using the class computers, they liked programming and would make excellent programmers. If they had to force themselves to keep going to class and ducked out of labs as soon as possible, they hated it and would make terrible programmers.

    Programming is like hot rodding up to the 1970s or so. You don't need a degree, you don't need classes, you can pick most of the basics up from books, friends, and experimentation. What counts is whether you like it.

  13. Who cares? by Mr+Z · · Score: 5, Insightful

    I learned programming in Microsoft BASIC, assembly language and a touch of Pascal, prior to reaching college. I don't use any of those languages now. (Ok, I still program in assembly language, but for different processors.)

    As long as it's actual programming, with variables, data structures, and code to manipulate those things, then great! I don't really care if it's VB, Python, TCL, Lua, Perl, C++14, Delphi, Haskell, LISP, Erlang...

    The real point is to open up the computer as a programmable device, and to get kids seeing the computer as something they can extend themselves with their own creativity. For that to happen, you want to choose a language that students can pick up quickly enough to see interesting results early on. You don't want their first meaningful program to come in the last weeks of a year-long class.