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?

25 of 648 comments (clear)

  1. 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 slashdice · · Score: 3, Insightful

      The VB compiler is written in VB. C compilers are written in C. Why isn't Python written in Python? But maybe you know more than the people who know it the best, the core developers!

      --
      Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
    2. 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. Proprietary by mrflash818 · · Score: 5, Insightful

    No, thanks.

    Choosing a proprietary solution is not a good answer.

    --
    Uh, Linux geek since 1999.
    1. Re:Proprietary by Jeremi · · Score: 3, Insightful

      You're going to need to give a much better reason than "proprietary" to discount the VB argument. There are lots of good ones, but this isn't one.

      Proprietary isn't just a matter of whether the language is well-supported or not, but where it is supported.

      For example, say you've spent several hundred hours of your life learning Visual Basic, and then several thousand more hours writing the Great American Program, in Visual Basic.

      Now your boss wants you to get your program running on a Mac. Or a Unix box. Or a Linux box. Or anywhere that isn't Windows.... and here's where you find out that it simply can't be done, because Microsoft doesn't support anything other than their own OS's.

      So, all of the time you spent learning and programming with Visual Basic gains you nothing at this point; now you have to go back to square one, learn a different (hopefully less proprietary) language, and rewrite your program from scratch in that language.

      That's the real problem with "proprietary". You're locked in to doing only whatever your single-source vendor wants to allow you to do.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
  3. 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.
    1. Re:Teach them Java or C# by Anonymous Coward · · Score: 2, 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?

      I think the entire attitude to go towards high level languages is the wrong approach.
      Introduction to programming is more about learning how a computer works and to demystify it.
      In that regard I think a complete beginner would have an easier time starting with assembly language.

      Yes, it will be harder to make a complex application, but from a learning standpoint it removes a lot of obscurity and pitfalls of high level languages.
      In assembly language every instruction does a very limited and often well defined thing. You get the small building blocks that you can create something larger from.
      The time to when it becomes apparent that you need good structure and commented code also appears a lot sooner.
      It also doesn't hide indirect access behind some pointer construct so students that start out with assembly won't have the problem understanding pointers and references that is common for those that started out with C.

      Prepare a framebuffer for them and have them draw unfilled and filled boxes in it or give them a putc function and make them write a primitive printf.
      Once they have done that they will not only appreciate high level languages but also avoid many of the problems that people who start out with high level languages have.

  4. If that's what you want by MikeRT · · Score: 3, Insightful

    Then switch from Java or Python to Groovy. It's got a REPL tool like Python and Ruby, compiles to Java bytecode with tight Java interop and usually looks more like Ruby or Python than most people's Java code. That and it's a substantially more marketable language than any dialect of BASIC.

  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. 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#)

  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. Stop it. There is nothing wrong with VB.NET. by PJ6 · · Score: 3, Insightful

    For all intents and purposes it is equivalent to C#, which is an excellent language.

    I might actually prefer VB to C# because it doesn't have all those damn curly braces and semicolons - VB is much faster to type and the automatic indentation is better. The only dealbreakers for me were the awkward anonymous method syntax and industry stigma.

    You want to talk about programmers being ruined, look at what the experienced do with Java.

  11. Re:Households without a PC by qpqp · · Score: 3, Insightful

    You can code on a smartphone. If you want to.
    In this regard C, PHP, Java and Python are much more accessible than VB, which you can maybe write on a smartphone, but not compile.

  12. 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
  13. 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.

  14. 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.

  15. 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.

  16. Re:instant disqualification by Sarten-X · · Score: 3, Insightful

    For quite some time, I've argued in favor of teaching a programming class with QBasic. No, not the early BASICs that required line numbers, but the later QBasic that shipped with certain versions of DOS and Windows.

    Later BASIC variants have one defining characteristic that makes them perfect for educational use: Zero overhead. For the simplest example programs, there is absolutely no boilerplate required to allocate memory, configure the process, or tell the compiler/interpreter how to work. An example that demonstrates three things has three lines.

    For the very first stages of programming education, that's all you need. It's enough to show that instructions are executed sequentially, that you have to be explicit, and to walk through the compile/execution process. It hits all of the major concepts, with no extra parts to confuse the new students. From my time teaching CS, those basic concepts comprise the bulk of the initial difficulties most struggling students face. Once they understand those building blocks fully, the students can begin learning algorithms, design patterns, and all those more substantial parts of a full CS education... and that work should be done in a language that can trace its heritage to C.

    --
    You do not have a moral or legal right to do absolutely anything you want.
  17. Re:my vote: by gweihir · · Score: 1, Insightful

    Java is about the worst starting language possible. All the students will see is the horrible syntactic clutter it comes with. It will them take months to start to be able to differentiate between code that actually does something and syntax that is just there to satisfy the autistic compiler.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  18. 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.

  19. Re:instant disqualification by vux984 · · Score: 1, Insightful

    The example was to show that python is very powerful.

    That's not powerful. That's... I don't know what that is... "density". But you can do shitty dense code in VisualBasic too. That's not "power".

    C is a powerful language.

    The 'power' of C is the ability to manage your own memory or not, read and write directly to IO ports, recast memory from one type to another in fascinating and unsafe ways. Declare an array of data, populate it, and then call it as a function and if you did it right get a return value back... other truly HORRIBLE things.

    That is hard to properly demonstrate in many other languages.

    Does this stuff belong in a high school course?

    Yes; in precisely the same way some sort of explosives demonstration is appropriate in chemistry... not to teach students how to program at that level but to demonstrate it, to give them the understanding of what this sort of stuff is as part of an overview of computer science. To make it concrete how code, and data and numbers and text, and everything are all truly interchangable, and how you can treat one as the other and back again. To give them an idea how exploits and viruses work. That's a valuable epiphany for computing students.

    But for an intro to acutally programming? No. Stay away from C; a simpler safer less powerful language is desirable.

    And while I agree that the first language does not matter in theory, it matters in practice. Students will be more motivated if they can use what they learn.

    However, I do agree with you the the x-platform of python is desirable. (although .net languages are x-plat even if the library support off windows is limited). It will work more enough for a high school course if they are writing console programs.

    But I admit I personally don't like python. I don't like semantic whitespace. I don't think that is a particularly easy concept for some students to even grasp; and its a characteristic that phython shares with no other language except brainfuck. (Hardly the best company to be in.) I also think it makes editing, maintenance, and refactoring more difficult.

    I'd pick VisualBasic over Python as a beginners language.

    Plus VisualStudio is really good; its a good IDE, good debugger; its stable, its free; its widely used in the 'real world'; and you can focus 100% on "learning to program" without getting bogged down in configuring your environment or managing your toolchain or phyhon package management, library versions (python 2 vs 3), etc, etc, etc.

    Everything you'd ever need to get going is included with VisualStudio. The Python Standard library set is much more limited; and when you step outside of it there's a lot more complexity -- libraries are maintained by different people, conventions aren't as strictly adhered to, package names are cryptic or clever nonsense... django, cherrypy, twisted, etc. Documention is frequently behind or missing.

    Its just a lot more to wrap your head around.

    MSDN documentation and naming conventions maybe boring and dry, but the documentation is complete, up to date, and with examples for virtually everything, and the conventions are adhered to. Things are named predictably, etc.

    With Python they can do that much better, because it is still alive and well.

    I learned to program in BASIC first (TRS-80), then gwBasic (80286) then (Turbo) Pascal, then (Borland) C++, then Modula-2 (on Unix in 1st year university)... then countless more. But of my first 4, only ONE of those has ever any real world application.

    Besides, VB.NET is basically C# with training wheels; so you switch BEGIN and END for curly braces, realize procedures are just functions that return "nothing", and a little bit of other syntax and you are up and running in something that is pretty relevant.

    And its ok for languages to be a teaching language. I know I certainly don't "wish" high school had been in something more "relevant". If anything, being taught in a language you'll never use again helps you learn to separate "the language" from "programming". That's a good thing.

  20. Re:instant disqualification by UnknownSoldier · · Score: 1, Insightful

    > I've never understood the hate for VB.

    Because shit designed languages, like PHP, Basic, and Javascript teach and encourage all sorts of bad, sloppy, programming habits, and inhibit the programming from using _good_ design / architecture. i.e. Visual Basic didn't get inheritance _until_ VB.NET long after everyone suffered with VB6.

    For professionals we want compile-time type checking to catch stupid mistakes of

    - mis-spelt variables
    - using a variable with a mis-matched type.

    Sure, for one-off's and throw away code VB6 was fine, but when you change the case of a variable, and the IDE changes ALL copies of it, or worse, lets you use a variable without declaring it earlier, you are shooting yourself in the foot with dumb mistakes that will waste your time tracking down subtle bugs.

    > The verbose syntax of VB makes it easier for a broader range of abilities to be introduced to programming without all the symbology of C like languages getting in the way.

    Nothing says a noob language like verbosity.

    Why?

    Verbosity is "noise" cluttering up the "signal" all in the name of a mythical "readability." Consider the enum in VB6:

    Public Enum Flavor
        flVanilla = 2
        flChocolate = 4
        flCoffee = 8
        flStrawberry = 16
    End Enum

    C's enum gets rid off all the crap we don't need:

    struct Flavor
    {
        FLAVOR_VANILLA = (1 << 1),
        FLAVOR_CHOCOLATE = (1 << 2),
        FLAVOR_COFFEE = (1 << 3),
        FLAVOR_STRAWBERRY = (1 << 4)
    };

    Note: The '=' equal sign is multi-column aligned, but /.'s formatting is retarded and strips contiguous whitespace.

    In Mathematics we don't go:

    result_integer = integer_2 integer_add integer_2

    We get rid of the superfluous crap and use symbols.

    result = 2 + 2;

    Verbosity is one of the reasons Pascal was a complete failure. It wasn't pragmatic and/or practical for SERIOUS coding.

  21. Re:instant disqualification by shutdown+-p+now · · Score: 3, Insightful

    It also randomly renames things that have well-established terms already. E.g. "abstract" methods - all languages that have them, have agreed on the meaning of it for the past 30 years or so. But VB calls them "MustOverride". And "abstract" on classes is "MustInherit". And those labels don't even make much sense, because, taken literally, they make claims that are plainly not true (you don't have to inherit from an abstract class - you just can't instantiate its instances; and even if you do inherit, you don't have to override any abstract methods - it's just that your class is also abstract if you don't).