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?
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.
No, thanks.
Choosing a proprietary solution is not a good answer.
Uh, Linux geek since 1999.
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.
Infuriate left and right
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?
To understand why proprietary software in schools is a poor answer, please see this 15-minute TED talk.
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
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.
Program Intellivision!
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