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?
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.
Since BASIC was introduced in 1964 and C was not released until 1972, it is highly doubtful that BASIC is in any way "based on C". BASIC is patterned after Fortran and to a lesser extent Algol. Those language also influenced C, though in different proportions (more Algol, less Fortran), but any claim of BASIC being C-based is quite laughable.
Support Right To Repair Legislation.
To understand why proprietary software in schools is a poor answer, please see this 15-minute TED talk.
VBScript != Visual Basic
it's kind of like Javascript vs Java
"...VB is MS only."
No it's not.
http://www.mono-project.com/do...
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
Yes, VBS is not VB. Nor is VB.Net VB. I'm guessing that VB.Net is what people are talking about here. A .Net language that runs JIT-compiled on top of a massive VM or "framework". VB (as VB6) by contrast produces compiled executables, can be used instead of C++ for most things and is strongly COM-adapted. VB6 is still one of the most widely supported tools for Windows. The EXEs run without extra support files needed on virtually all existing Windows PCs.
On the other hand, VB is no longer officially supported and .Net is heading for status as glorified script, insofar as Microsoft is trying to herd all Windows developers into the world of Metro trinket apps. There are much bigger problems than picking a language right now for anyone thinking about a future in Windows programming.
And why does no one ever mention the *context* when talking about the alleged best tools? What kinds of things are students going to write?
I'm continually surprised to see Slashdot regulars misunderstand the VBS/VB/VB.Net landscape as a result of accepting Microsoft's marketing misinformation.
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.