Which programming language do you use?

My programming life started with BBC BASIC programming Commodore PETs and BBC Model B computers and visual basic when writing macros to make programs that run in EXCEL. I have used LOGO with students in school and more recently, Scratch. Python also seems to be in vogue at the minute. I have played with LiveCode to write Apps and looked at Flowstone.


I find that teachers are asking: “What programming language should I use in school?” and would like ideas for projects to use in the classroom. Can you help? Reply to this post and tell us what languages you use, and share an example of a task you set.


Comments

Sign in to post comments

Pete Dring

Good question. There's a lot of debate about which is best, but I don't think there's a single 'right' answer other than what meets the needs of the students.

Getting started:
Scratch
is a fun way to introduce coding with a friendly drag and drop interface. The new online version adds some really useful extra features and is worth a look if you've only used the downloaded version. We use it a lot with y7 and y8 students but I know it's increasingly popular in primary schools

Kodu is a free 3d game making piece of software which I've tried with a few classes at KS3. Students like the graphics and the fact that you can play your game on an Xbox when you've made it but it's a bit limited in terms of what it allows students to learn / do.

Playmycode.com is a free online game making website. Students can write their own code or edit existing games. It's a fun resource to use every now and then but students tend to get distracted by just playing the example games.

Small Basic is a free download that I've not used in my classes but have seen it used really effectively elsewhere. It's the most user-friendly text based programming environment that I've come across. Looks very promising for primary and KS3 but it doesn't let you do everything you need to in order to get full marks in a GCSE controlled assessment.

Lego Mindstorms is great fun to play around with but is expensive and so only works for small groups (or schools with very large budgets!). I had a small group of Y10 students with SEND who programmed a tank to navigate a maze and shoot a target which was a lot of fun, but I wouldn't try it with a normal size class.

More advanced:
Javascript: I started teaching y9 / y10 Computing classes how to write javascript code so that they could make web apps or games that worked on any device in a web browser. Students mostly enjoyed it but there's a lot of assumed knowledge that you have to get through first before you can use it for anything worthwhile (you have to give an introduction to HTML and CSS first). Javascript is deliberately limited to not allow any file input/output which quickly ruled it out for the KS4 controlled assessments. Error messages are hard to track down and the syntax with curly brackets all over the place were confusing to a lot of students.

Python: I'd heard lots of people raving about python but not used it much before September but reluctantly thought I'd give it a try. It's now the main language we use for KS4. I really like the way you can write your first program in just one line but as you learn more, you can write code that allows you to access all the marks for controlled assessments in terms of programming techniques with code that is less painful to comprehend than most other languages I've used. There's also a wealth of resources and tutorials out there aimed at beginners which is a real plus.

I'd be interested to hear what other people are using / considering using.

Olwen Morgan

Sorry to be overly blunt but teaching kids to program in Javascript (JS) is IMO tantamount to child abuse. I've been a software engineer for 44 years and have lost count of the number of languages I've programmed in. JS is the worst by a long way because it offers ways to do things that represent appalling programming practice.

Most of my work is in safety-critical systems. That means that when they go wrong they can kill people. Sometimes, e.g. with small medical devices, they kill people one at a time. On the other hand, in air traffic control, they can kill hundeds at a time. In these kinds of systems you use conventional imperative languges that have internationally standardised definitions and can be subsetted so that programs in them can be proved correct by automated theorem-proving tools. Currently all such languages that are widely used in systems engineering have strong data typing systems that can be checked at compile time. JS is not this kind of language.

JS is a tool to let you hack together web applications. It is not by any stretch of the imagination a language for sound software engineering. Teach kids how to program in JS and people like me then have to spend our professional lives stopping them from screwing up things that need to be secure, safe, reliable, and right first time.

So far from being a "more advanced" language, JS is a vessel of ordure that IMO has no place in any school computing curriculum. Python is far from perfect but it is infinitely preferable to JS.

Chris_C

I'd agree with Pete's comments - there are lots of suitable programing languages.  I started using Small Basic with KS3 this year but found that it doesn't have local variables and you can't pass parameters (without cheating) - I think that this may lead to students developing a poor programing style.

In KS4 and 5 I've been using Visual Basic - it's a powerful language that is fairly easy to learn, has a nice visual designer for interfaces and there are tons of online examples to help with solving problems.  VB seems to fit in very well with some of the OCR GCSE Controlled assessment materials and has worked well for A-level projects.

Other than Visual Studio are there any other suitable visual designers for students to use?  I keep meaning to try the python plugin for Visual Studio but haven't found time yet!

g7tnz

You may like to look at SharpDevelop. This is a free environment for the .NET languages. It is generally as good as Microsoft 's products unless you have very advanced needs. It will handle VB.NET

I prefer C# to VB.NET as I feel it at least fits the C program family making it a little easier to slide between C, C++ and C#. I also feel that VB.NET has got a little too ideosyncratic with its syntax so that the jump to learning other languages is greater. VB always has hidden much of what is going on from the user and that makes me a little uncomfortable. The NET framework is common to both VB.NET and c# so writing in one has a fairly easy learning curve to learn another as the bulk of such a program tends to be calls to the framework and not the keywords of the language itself. few languages have the richness of support libraries that exist in the .NET framework.

Another feature of Microsoft languages is that if you progress to 3D then you are steered towards Direct X. No problem with this in principle, but OpenGL is cross platform and probably (I admit to guessing here) still the majority use in commersial games production.

Java has the advantage of achieving being cross platform, where .NET programs failed in the attempt. (Anyone that tells you .NET is hasn't tried to convert a realistic commercial program to Linux and found that a few key methods have not been implemented, and there is no workaround.) It has rich support API and also has a range of IDE that are free. I prefer Netbeans over Eclipse, many would vote the reverse way. The downside is that handling the GUI has been inherited from Unix and although there is drag-and-drop design in the major IDEs now it is not quite as straightforward as with with Windows (and consequently Visual Studio).

Java also has jMonkeyEngine as a Games design IDE to steer those games enthusiasts towards (and my experience is that most eager programming students wish to pursue a glittering career of fame and fortune in games development).

And for those that wish to develop a game directly from Java I recommend the ThinMatrix series on You Tube:

'Beginners OpenGL 3D Game Tutorials'

https://www.youtube.com/playlist?list=PLRIWtICgwaX0u7Rf9zkZhLoLuZVfUksDP

[also look at his tutorials on sound and water.]

a student following this 'course' will end up with a reasonable game engine to which to add the game logic.

His devlogs are also useful to show keen students what development involves and so prepare them for the real world.

So in summary - look at Sharpdevelop as something students can use at home as well and if you want to move to another language consider Java.

{In case you are curious my favourite language is Forth, but I am not recommending it here.}

wylesk

MS Small Basic, VB.net, Scratch - possibly C# for A2 A Level also investigating Python via Visul Studio

Frank Callow

ever since the A Level specs updated several years ago I've been using python both for A level and more recently for GCSE. I used to use scratch with y8 students when they visited fir one off computing days but in the last two years used python there to to write a simple guess the number game and to make spiragraph type pictures using turtle. the nice thing is that students could easily see how the language worked and could creatively expand on what we were doing. they could also see the reasons for fiddly language issue like case sensitivity and indentation without having less obvious issues like semicolons at the end of every line to deal with.

Karin Nygårds

Hi, I teach 5th grade in Sweden. I've used Kodu a little bit, but find it confusing for the students and difficult to navigate in. Most of the time i Use Kojo, http://kogics.net/kojo a learning enviroment, using Scala. It's open source, free to download or use as a web version.

Like LOGO, it uses a turtle to visualize the movements. I like the way the students learn how to write code, using loops and functions. I'm not a programmer my self, but I know some Python and I see the resemblance between Kojo and Python and now when some of my more advanced have started to learn Python, it's easy for them to "switch language". 

Most schools in Sweden uses Scratch in the younger years, but since I don't really get it my self, I stick to Kojo. 

Shahneila Saeed

Hi, I teach Computing from Year 7 through to Year 13 (11 - 18 years old). Here's a brief breakdown of the environments that we use:

Year 7 - Introduction to programming using Logo and then Robomind, revisit programming concepts later in the year using Kodu

Year 8 - Using GameMaker to create their own games, with introduction to HTML web scripting

Year 9 - Advanced programming with Scratch, Greenfoot, HTML with CSS (& some JavaScript for the more able pupils). A short series of introductory lessons using Pascal. We are also currently experimenting with the use of Python.

Year 10 & Year 11 (GCSE Computing) - We use Pascal/Delphi to cover the course

Year 12 & Year 13 (A Level Computing) - We begin with Pascal & Delphi, then may move onto Visual Basic. We also use Greenfoot, and cover web scripting.

I hope that helps. We find that using a range of environments helps students revisit the same programming concepts in different ways and this is important in the younger years for students to consolidate their learning. From Year 10 upwards we have found that Pascal and Delphi are well structured as languages to teach the programming concepts. However, we are now looking into the possibility of Python and exploring this as a viable alternative in our school.

Olwen Morgan

All this, especially Pascal/Delphi, is excellent as a foundation for higher education in computing - apart from Javascript, which any competent computer scientist will tell you is a very sloppily designed language that spawns many of the security problems on the web.

teknoteacher

There's a similar question frequently asked - with no definitive answer, "What's the best programming language?"

It's as complicated a question as "Which meal should I cook?", "What career should I choose?" or "What's the best car?"

There are literally 1000s of programming languages to choose from and some suit particular applications better than others. For teaching, Scratch (a graphical programming language) & Python (a text-based programming language) are incredibly popular in school and there are others which come close. One advantage of these two is that there is an immense amount of resources designed for teachers and their students, many of them free.

I've shared some further thoughts on teaching programming languages on this blog here: http://teachcomputing.wordpress.com

10 Python Teaching Resources You Really Should Be Using:

https://teachcomputing.wordpress.com/2016/03/20/10-python-teaching-resources-you-really-should-be-using/

The best way to teach text-based programming?:

https://teachcomputing.wordpress.com/2016/02/28/the-best-way-to-teach-text-based-programming/

Olwen Morgan

It's pointless to ask what is the best programming language. Better to ask what kinds of language features are most suitable for the intended purpose. You probably wouldn't use a functional language to program a microcontroller, nor would an imperative language be the best in which to write a theorem-prover.

There is, however, a very sound rule of thumb: For an given purpose consider how many kinds of errors the design of a language permits to be reported by compile-time diagnostics or by a static checking tool. Then choose the one that maximises the early detection of errors.

Why? Because it tends to take two orders of magnitude more effort to find and fix an error by testing than by analysis of the source code. If you can get kids to think in this way about programming, you'll have done them an immense favour.

That's the main reason why Javascript is so bad. Any language with dynamic typing ipso facto makes it harder to detect errors at compile-time. 

I agree, though, about Python. It is widely used over a huge range of applications and there are lots of resources around for it on the net. It has its faults - all languages do - but it does permit relatively easy exploration of different styles of programming. I use Python with the free and cross-platform programmer's editor Geany, which I highly recommend.

One caveat with Python, however, is that IMO object-oriented programming should not be taught in it. Some industrial users report that bugs in OO software take around three times as much effort to fix as bugs in language without OO features. OO programming is generally deprecated for use in critical systems because of the ease with which you can introduce hard-to-detect bugs into code.

It's a minority view, I grant, but I think that OO programming should *not* be taught in schools at all. Or if you absolutely must, then use a language that is aptly designed for it such as Eiffel.

Olwen Morgan

Play the field with programming languages

One piece of advice for choosing programming languages is to try before you buy. Better still, try before you don't buy, i.e. use free software. It's not a bad idea to have, tucked away somewhere in your school, a computer that runs Linux instead of Windows. Linux is free, far better designed than Windows, and provides access to an enormous range of free software packages.

For example I am writing this on a system running the Lubuntu distribution of Linux. If I search for "Programming Language" in the tool that it has to find and install new software, it responds with a long list containing a selection of languages. You can then download a language package, plus the Geany editor, and you immediately have a lightweight IDE for programming in that language in which you can play around and see what you think of it.

And this costs you not a bean!

Swathes of the Indian software industry centred around Bangalore use Linux platforms in preference to Windows. There is a saying among some of their software engineers that MICROSOFT is an acronym for, "Most intelligent customers realise our software only fools teenagers."

Far be it from me to comment further.

g7tnz

Whilst I agree with all the comments above, I have found that the best programmers are those that started to learn using assembler. They have a better grasp of the machine and how compilers work and many other issues.

In teaching there are conflicting aims which cannot easily be resolved. We can either teach so that all students can learn to program or we can teach those that have particular ability with programming how to be good programmers.

The best I can suggest is that whatever language is used to start with, those students that appear to excel could be quickly switch to assembler on a microcontroller.

 

Olwen Morgan

Wow, that really is interesting. In the kind of work I do in embedded systems it's definitely the other way around. The programmers who have learned starting from assembler (who are usually electronics engineers) are often the most clueless about analysis of programs to ensure that they are correct.

I agree entirely that not everyone can program. In fact some very good mathematicians are terrible programmers. But there are better ways than using assembler for teaching those with aptitude to be good programmers. Using assembler makes them think in terms of the underlying machine. This is almost universally discouraged when training software engineers to write high-integrity code.

And why would you switch the promising ones onto *assembler* and microcontrollers when these days almost all microcontroller applications can be programmed entirely in C? If you use assembler you lose all the checking that can be done by a compiler and static analysis tools for a higher level language. Why throw that away?

I'm also having difficulty getting my head around the idea that schoolkids have a good grasp of compilers. It just so happens that I do C compiler validations for industrial clients. In my experience understanding of what a compiler does and how it is organised is pretty thin on the ground even among experienced software engineers.

I'll believe that a schoolkid has begun to understand a compiler when he/she can write a test program that determines whether the l-value or the r-value of an assignment statement is evaluated first.

Now deeply puzzled,

Olwen

linker3000

There's some good points raised here. My perspective as a 50 year old STEM Ambassador/electronics engineer now working as a systems engineer specialising in high performance storage hardware and object storage systems (hardware and software) is that the key is less about the language to start with and more about engagement and developing an algorithmic approach to programming, so that you can be flexible within sensible bounds about the language because you can take the view "I know what I want to achieve,  I know the overall ethos behind a range of languages, so how do I do what I want with language X'.

Sometimes you'll have the complete freedom to choose a language, sometimes the job or situation will dictate what tools are available.

Putting this into reality within the education sector from my engineering perspective; younger students will be engaged and encouraged by the ease of achieving something with a drag-and-drop framework, but it becomes too easy to code-up by following instructions or copying blocks from others without appreciating the algorithmic structure. Older students can make progress quickly and easily with the fundamentals of, say, Python and then evolve their skills with the more esoteric and complex Python constructs.

For hip-and-trendy IoT-oriented stuff, much embedded work starts off in C, with Assembler being used for very time-critical routines. The micro:bit ecosystem has stirred things up by having a MicroPython framework ported to it, but in reality the  interpreter is slow and the amount of working memory (flash and RAM) you're left with on the Micro:Bit restricts program complexity; having said that, MicroPython coding on the Micro:bit is good fun and gives quick wins.

So: engage the students, entice them in, give them some quick wins and encourage them to think algorithmically about what they are trying to do rather than make them experts on Web searches for code snippets.

Once the fundamentals are covered, expand the scope of complexity and start to explain they whys and werefores of other languages in certain contexts (PHP, Java, Javascript, perl etc.); then maybe if the students are heading towards exam and career choices which involve coding, they can begin to be shown and appreciate the place for functional languages (Haskell, Erlang, Clojure and the rest) within certain relevant disciplines.

g7tnz

I am completely in agreement. However, I am cautious about how difficult it is to break bad habits especially those learned when young.

A difficulty with enticement with quick wins (don't mistake me - I am all for them) is that there is a tendency for young students to expect things to remain easy and 'interesting'. The reality is that some things take a bit of hard work and effort to understand and take in. Learning to work through the hard bits without being bored is good preparation for employment. I don't think anything in my working life has been boring, but I am a little older than you, and we were schooled at a different time when we were trained to enjoy the challenge of those things that did not lead to a 'quick win'.

g7tnz

You raise a number of different issues:

1. Are electronic engineers ever taught to program? My experience is that during their training they have generally been pointed at a device to produce a result and given limited support as they make it up as they go along. Generally they seem to have a 'good enough' attitude rather than a desire for rigour. So I wouldn't use them as an example of 'the best programmers'. My contention is that in my experience the best programmers have started with assembler (or at least met it early on), not that people that start with assembler will all become good programmers.

2. I did not express myself clearly with the phrase 'how compilers work'. I had meant at the level of using the tool, not the ability to write a compiler. You say '..you lose all the checking that can be done by a compiler and static analysis tools for a higher level language. Why throw that away?'  It is exactly that aspect that I want my employees to understand and therefore suggest that a student gets to grips with it early on. The use of a tool blindly is dangerous. The programmer needs to understand the implications involved in what the tool is doing. I observe that there is a tendency when given tools that are powerful, to write code without thinking and let the tool sort things out. Using assembler (for even a brief time) helps train the learner to think more carefully about what they write as the errors have to be worked out and solved without much help from a tool.

 

Olwen Morgan

Now you've clarified what you meant, I see what you're driving at. Showing kids assembler and getting them to realise how hard it is to get it right is IMO a good thing as a prelude to using higher level languages. You're also right about blind use of tools.

Some years ago I was rolling out static checking tools for C and C++ for a major telecommunications company. Having installed a tool, I would follow up after a couple of weeks to see how the users were getting on with it.

One group coding in C++ said that the tool wasn't telling them much about what they were writing. It turned out that they were such disciplined coders that there was little the tool could point out to them.

Another group coding in C said that they had stopped using the tool because, in their words, it, "complained too much about what we write". This group subsequently had "a great weight of bricks dropped on them from a great height."

The sublime and the risible!

g7tnz

The answer to a teacher as to what programmer to teach is this:

You should teach the language that you know best. That is one that you can read and write fluently. You, the teacher, have to advise the students and point them in the right direction when they have problems. That often means looking over their shoulder and quickly spotting some problem in the code. To do this you need a good grasp of whatever language it is, not something you are reading up the night before the lesson.

It doesn't really matter which language they learn (taking into account my other comments), but it does matter how confident you are with facilitating their learning. 

I have been teaching programming to students in secondary schools over the course of 35 years, and the language of choice has been whichever has suited the task in hand that I have a best knowledge of at that precise moment out of the many I have used over the last 45 years.

Olwen Morgan

I agree - unless the language you know best is (spit) Javascript :-O

Olwen Morgan

Have we now established a site/group record for the number of postings on a topic?

JaneLisaWaite

How about crowd sourcing a list? Here is starter for 10. 

I only have block based and hybrids

https://docs.google.com/spreadsheets/d/1NwPmlLcD2TaSWztYIlL9tEl7G_TfEcUtZp2uCdCZRFE/edit#gid=0

Could we add to this something on progression? Maybe what topics/concepts are suited to each one? Also do we have design patterns for each? Are there common design patterns across  programming languages? And are there misconceptions that are more prevelant for some?

Are there different pedagogy for teaching each one?

E.g. Scratch to get going, processing for creativity and introduction to programming for pupils with an art background? AgentSheets, Greenfoot for gaming? Pencilcode and Stride for transition to text etc...

Are there some PL that lead to others? What about object first?

There was a survey that reported the top primary and secondary PL - but the report accepted it might be biased, as it was a CAS members survey.http://community.computingatschool.org.uk/files/6098/original.pdf