JonB
Posts: 220
Joined: Tue Nov 29, 2011 9:26 pm

Re: Best first language choice

Wed Jan 11, 2012 7:59 pm

Oh yes, I am a dinosaur....

andyl
Posts: 265
Joined: Tue Jan 10, 2012 11:05 am

Re: Best first language choice

Wed Jan 11, 2012 8:33 pm

JonB said:


Hmm. Start with flowcharts and a small instruction set; a pseudo machine language like CESIL (Google it). Then after the basics of flow control are more or less mastered, switch to something more advanced, say BASIC. That"s how we did it in the "80s – why should it be any different now?


Except that it wasn't.  I've never used flowcharts.  Never used CESIL but those who were exposed to it universally hated it (a lot of them were using a real assembly level language and real machine).


Problem to my mind is that any machine with modern capabilities is going to come with distractions. Internet access. High resolution graphics. Hi def video & sound. Gazillions of libraries, IDEs, configuration of tool chains, the lot. By the time you have all that set up, you"'re getting bored, or lost.


Well a lot of that should be setup automatically (especially if done automatically).  The distro would have the most immediately useful libraries setup. Even if not it is very easy to install a python library on linux.

But people can get distracted by all that, and not know how to proceed, but that is why some of the learning we are talking about will be directed.  Those who are keen will leap forwards and start using the net libraries and graphics and windowing libraries.

Noah Caldwell
Posts: 7
Joined: Wed Jan 11, 2012 8:59 pm

Re: Best first language choice

Wed Jan 11, 2012 9:26 pm

I have been told by many professional programmers working in billion-lines-of-code projects:

Don"t start with C++. It is a flaming vorpal-powered chainsaw. Don"t.
No new programmers needs to be bombarded with object-oriented programming, painful memory management and pointers, binary data trees, and namespaces. Even the beginning program, Hello World, is misguided.

#include
using namespace std;

int main()
{
cout << "Hello World!";
return 0;
}

Student: Hey, what’s this ‘cout’ thing?”

Teacher: Oh, that’s an object. We’ll cover that later in the course.

Student: What about ‘using namespace std’? Is this related to sexually transmitted diseases?

Teacher: Hopefully not. I’ll cover namespaces after we do objects.

Student: Okay then. What about those two less-than signs?

Teacher: Er. Normally two less than signs is a bitwise shift, but in this special case it’s used to put items in a stream of the ‘cout’ object.

Student: So, in this entire example program we have something that’s too advanced to explain to me, a symbol that is a unique exception to a rule I don’t yet understand, and the words “Hello World”?

Teacher: Also, #include is usually a header file followed by a .h, but iostream is a special case.

Admittedly, I did, but that probably wasn"t very wise. Python, Basic, Ruby... Just about anything would be better than C++ unless the student (be it you or someone else) is already very mathematically inclined. I"d go with Python or another language designed for readability and simplicity, as Basic would be a poor choice for teaching design. Learn C++ at some point for sure; it is very sparing of your machine"s resources and is a very powerful language, along with teaching excellent coding practices once you blitz your way through a few projects, but a living hell to start out with.

FYI, the student-teacher conversation is shamelessly stolen from Shamus Young"s (not me) website TwentySided. Go check it out for cool code and gaming stuff.

thesynapseuk
Posts: 55
Joined: Thu Jul 28, 2011 11:21 am

Re: Best first language choice

Wed Jan 11, 2012 9:29 pm

JonB said:



I personally don'"t see much difference between RPi and A.N.Other modern computer (apart from price). People learning to program don'"t need these capabilities, they need a focussed environment that gives them the basics, just like we had in the 80"


The point is that the R-Pi is a SAFE environment for people to learn how to code, particularly children. In most houses you have a family laptop - which everyone has to use and it cannot under any circumstances be tampered with! Windows is of course pretty easily broken and difficult often to fix without losing something. Consoles are completely sealed boxes and not open to being played and hacked about with.

The R-Pi provides the middle ground. It's not super powerful, but it's enough to do some cool stuff with, and certainly enough to make games with - an important criteria. It's also a system that someone can mess around with and experiment with until the cows come home and it doesn't matter if it breaks - it's very cheap, easy to replace, and easy to reflash/keep a spare SD card handy for. The price really is key for the penetration and provision of this environment.

This safe environment is what you had in the 80s with your BBC Micro (but for significantly more money!), and that's what's been lost. If something went wrong with the BBC Micro you could always do the old shift-break to go back to the start up prompt.

User avatar
Chromatix
Posts: 430
Joined: Mon Jan 02, 2012 7:00 pm
Location: Helsinki

Re: Best first language choice

Wed Jan 11, 2012 10:10 pm

Ctrl-Break.  Shift-Break was for booting something else from the floppy drive.
The key to knowledge is not to rely on people to teach you it.

thesynapseuk
Posts: 55
Joined: Thu Jul 28, 2011 11:21 am

Re: Best first language choice

Wed Jan 11, 2012 10:16 pm

Chromatix said:


Ctrl-Break.  Shift-Break was for booting something else from the floppy drive.


Ah! Thank you! I only used them at school occasionally, and that was never for learning to program them. Too many games to play by the time I used them at school!

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Best first language choice

Wed Jan 11, 2012 10:19 pm

Tom Cole said:

In most houses you have a family laptop - which everyone has to use and it cannot under any circumstances be tampered with! Windows is of course pretty easily broken and difficult often to fix without losing something. 
In actual fact this is entirely incorrect. It is very difficult to break a PC by programming it. I have not managed it yet and I write thousands of lines of code, far more wide reaching and complex than a child will write. It is far easier to break it by visiting dodgy websites or by playing with Control Panel.

But the important thing is that the child's parents do not know that, and will not trust their bundle of joy not to damage the precious.

The selling point of the RPi is that it is a cheap and easily repaired computer.

The important and empowering point is that it is the child's own computer that they can make do cool stuffTM.

They could make the family laptop do the same, but then instead of saying "That's nice dear" their parents say "I hope you haven't broken anything." And then the parents visit a dodgy website, blame the child and don't let him program it again.


Well a lot of that should be setup automatically (especially if done automatically).  The distro would have the most immediately useful libraries setup. Even if not it is very easy to install a python library on linux.

But people can get distracted by all that, and not know how to proceed, but that is why some of the learning we are talking about will be directed.  Those who are keen will leap forwards and start using the net libraries and graphics and windowing libraries.


This is how I see a RPi working in education: On start-up it displays a menu for a few seconds before starting X and a very basic IDE. The IDE is the X shell -- if you close it it opens again. There is no task bar, nothing.  If on boot you select another choice, then you can have a more advanced IDE, a full X environment or a command line. Maybe even a VNC to the teacher's RPi. As a child progresses they or their teacher would set a different choice as the default. The RPi would come already loaded with the languages that the teacher wanted the child to use and maybe some class libraries to simplify some of the work.

To create that environment, the teacher downloads the basic SD image. That probably includes the menu and a few IDEs. They then use WinImage and a card reader on their laptop to program an SD for his/her own RPi. They then make the modifications they need and upload it to the hard-disk on the laptop. That image is then loaded onto each child's SD card from the teacher's laptop.

sonickev
Posts: 8
Joined: Wed Jan 11, 2012 3:00 pm
Contact: Website

Re: Best first language choice

Thu Jan 12, 2012 2:17 pm

rurwin said:


JohnoFon said:


rurwin said:


I would also characterise the arguments over OOP as being over and won. Maybe the fight now is between richly typed languages and older languages with framework-provided rich types.


Can you explain that, please?


Certainly.

I am maintaining that Object Oriented Programming is better than block-structured (procedural) programming. There are many advantages to OOP and, to my mind at least, BSP only has one: better documentation. OOP allows a programmer to write more powerful applications with less code.

Another thing that allows a programmer to do more with less, is a richer set of basic data types, such as lists, trees, stacks, queues, sets, dictionaries, smart Unicode strings and so forth. Languages such as Python support those out of the box. Languages such as C++ and Java support them by using add-on class libraries. It is not yet clear which approach is optimal. There will always need to be class libraries for some types, since nobody can foresee all needs when designing a language. But C++ and Java have had several different and incompatible class libraries over the years, requiring the programmers to unlearn their skills and learn new ones.


My apologies. I do not for a minute mean to say that Python is irrelevant in the wider world of I.T. I do however think that it is irrelevant as a learning language on the RPi...why on earth would you do that when you can just learn python on any one of the hundreds of redundant PCs that litter our schools.

Python is very relevant, but not here on this hardware and in this discussion thread IMO

sonickev
Posts: 8
Joined: Wed Jan 11, 2012 3:00 pm
Contact: Website

Re: Best first language choice

Thu Jan 12, 2012 2:34 pm

rurwin said:


I wont go over the ground covered by andyl, but this link to Python success stories might underline it. Python is not a toy language.

sonickev said:


My personal suggestion would be to restrict programming to those languages that are compiled rather than interpreted, but that is mainly because of my background and what I personally think needs to be understood by a computing student (processor, instruction set, registers, etc.)
K&R ANSI C with its long established book is an excellent language to learn with a very well known and well respected book that has taught many children and adults how to program for the first time. Once learned, the next step into Java, script, C#, visual C, etc. etc. is logical and easy.


I doubt we are going to agree, but I wholly disagree with your sentiments here. Just because a language is interpreted it does not mean that it is necessarily further from the hardware in a pedagogical sense. I learned the concept of assembler programming with a synthetic assembler language called MINI. Once I had the concepts straight I could go on to a real assembler or, in my case, real machine code on the SC/MP. I would judge that that is a far better approach than trying to mark the relationship between a specific high level language and the real assembler of a specific processor.

I feel strongly that we must make a student's first experience of programming as obvious, painless and joyful as possible. Most children will not be driven to learn; for them computing will be just another subject that is being thrust down their throat, and most of them will not make a career in IT. Understanding is far more important than a saleable skill-set. The teachers, parents and so forth who are coming here to learn are not about to make a career in IT either; they likely already have a career in some other field. They want to learn programming to help their children or as a hobby.

The children are five, ten or more years from the industry. The landscape will change in that time. Languages and paradigms will change, processors will come and go. It is useless for schools to teach the skills that are in demand now, because in the next decade an entirely new set of skills will be required. Schools need to teach a broad skill-set that can be applied to acquire new skills.


I'm not going to go into the details unless pushed, but having an interpreted language running on the RPi is missing the point in my opinion. This is not I.T., this is electronics.

Why go through the exercise of connecting and using this in an educational environment if the fundamental point of the project is missed?

Seriously, I do not understand why you would connect a PC that can already run Python to this so that you could download and run Python here?

The key skill that we are lacking in the electronics industry is an ageing population of people that know how to boot a processor. Teaching Python is fine, but I just don't understand the link between this piece of hardware and learning Python or Pascal or BASIC. It makes no sense to me.

andyl
Posts: 265
Joined: Tue Jan 10, 2012 11:05 am

Re: Best first language choice

Thu Jan 12, 2012 3:34 pm

sonickev said:

My apologies. I do not for a minute mean to say that Python is irrelevant in the wider world of I.T. I do however think that it is irrelevant as a learning language on the RPi...why on earth would you do that when you can just learn python on any one of the hundreds of redundant PCs that litter our schools.
Python is very relevant, but not here on this hardware and in this discussion thread IMO


OK but that wasn't what you said yesterday.  You were far more against Python saying that it had no relevance to the wider world of IT.

You previously stated that interpreted languages are not very good at using libraries.  That is not true either.  Modern interpreted languages (and some not so modern) makes it easy to create and use libraries and to interface with C/C++.  That is a solved problem (and wasn't really a problem to begin with apart from a few implementations of a few languages).

Are there 100s of redundant PCs in schools?  I don't think so.  I don't think my nephews have much access to spend time on them learning to program.  Even if they were, would the authorities let the little oiks loose on them or would they be hesitant in case they messed something up?  With the Pi it is cheap, the SD card can be easily re-imaged, it doesn't take a PC out of a different use.  My nephews can't also take the school's PCs home to continue programming in their bedrooms in the evenings and weekend.

From your later message it becomes clear that you are coming at it from a restricted POV when you start talking about "the electronics industry".  the Pi isn't a solution to help the electronics industry, or even the general programming industry (although I believe it will).  I think the foundation believes that teaching children more about how programs work, and how to program will benefit them generally, in problem solving, and as a secondary result help industry.

I also don't understand your point about "not understanding the link between this piece of hardware and learning Python or Pascal or BASIC".  Considering that nearly any language you care to mention has an implementation for a PC (either Windows or Linux), I'm not sure what language choice you would see as reasonable.

JonB
Posts: 220
Joined: Tue Nov 29, 2011 9:26 pm

Re: Best first language choice

Thu Jan 12, 2012 4:08 pm

To be fair to all these views, I still say start simple in order to learn the basics, then graduate to more advanced languages / approaches.

Yes, CESIL was a git, only having 14 instructions (and two of those were high level i/o commands), but it did teach you about how machine language works (and by extension, the CPU). However, i think this illustrates my point - that to "learn programming" you've got to do it in a staged way.

Maybe the answer to the OP's question is a set of languages, each one more progressively advanced thatn the other. For example: BASIC -> C -> Java.

The post about the C++ "Hello World" program is a case in point. The use of the << operator is confusing to the student, so how about this:

In BASIC:

10 PRINT "Hello World"

Then C:

#include <stdio.h>

int main(int argv, char** argc)

{

printf("Hello World!\n");

return 0;

}

Then to the C++ which I won't reproduce here. The point is, because the student masters the imperative "PRINT" statement in BASIC first, when confronted with the C version, (s)he will be less distracted by the printf() function call. As the other poster already said, hitting the poor chap with C++ straight away is going to make things harder, not easier.

Hmm, have I got argv and argc the wrong way round?

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Best first language choice

Thu Jan 12, 2012 4:39 pm

sonickev said:

The key skill that we are lacking in the electronics industry is an ageing population of people that know how to boot a processor.
This device is not a low level processor to that extent. For that you should be looking at the Arduino and similar. The RPi is every bit the same sort of device as a desktop PC. It boots the same software as desktop Linux and it is capable of running the same software as desktop Linux. Instead of a hard-disk it has an SD card and it is very cheap and uses a fraction of the power. Other than that it may as well be a desktop PC. It would not be at all easy to investigate the boot process on an RPi, because it does not seem to have a BIOS, it will only boot from the SD, the only drivers available are for Linux, and pulling Linux apart is probably beyond A level. Far better to find an old PC in a cupboard somewhere, put FreeDOS on a floppy disk and investigate that.

Teaching Python is fine, but I just don't understand the link between this piece of hardware and learning Python or Pascal or BASIC. It makes no sense to me.
To my mind the reasons for teaching any programming using the RPi are largely down to excitement and ownership on the part of the child, and to perceived safety on the part of the school and parents. The fact that this device can also talk to hardware quite cheaply (but still not for zero cost) is a bonus, but the same projects could be handled by a desktop PC with USB-attached I/O. And that PC or the RPi could be programmed in exactly the same languages, be it C or Python or assembler or any other you can devise. But given that Python produces more powerful code quicker and for less effort on the part of both teacher and pupil, for initial teaching of programming, Python would be my choice.

dbojan
Posts: 2
Joined: Thu Jan 12, 2012 6:00 pm
Contact: Website

Re: Best first language choice

Thu Jan 12, 2012 6:18 pm

Java as first language? No. Too much crud around.

http://www.htdp.org/ maybe?

or basic. or bash.

JonB
Posts: 220
Joined: Tue Nov 29, 2011 9:26 pm

Re: Best first language choice

Thu Jan 12, 2012 9:32 pm

Oooh bash, there's an idea. A bit too arcane mind, but interpreted and commercially relevant.

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Best first language choice

Thu Jan 12, 2012 10:07 pm

JonB said:


#include <stdio.h>
int main(int argv, char** argc)

{

printf("Hello World!\n");

return 0;

}



Hmm, have I got argv and argc the wrong way round?


Yes, you do have the names argv (argument variables) and argc (argument count) swapped, but since you're not using them in the body of main() it really doesn't matter.  You might as well do this:


#include <stdio.h>
int main(int bumf, char** bumph)

{

printf("Hello World!\n");

return 0;

}


Better yet, ignore the arguments and result entirely if you don't need them:


#include <stdio.h>
main()

{

printf("Hello World!\n");

}


JMO/YMMV

sonickev
Posts: 8
Joined: Wed Jan 11, 2012 3:00 pm
Contact: Website

Re: Best first language choice

Thu Jan 12, 2012 11:38 pm

rurwin said:


sonickev said:


The key skill that we are lacking in the electronics industry is an ageing population of people that know how to boot a processor.


This device is not a low level processor to that extent. For that you should be looking at the Arduino and similar. The RPi is every bit the same sort of device as a desktop PC. It boots the same software as desktop Linux and it is capable of running the same software as desktop Linux. Instead of a hard-disk it has an SD card and it is very cheap and uses a fraction of the power. Other than that it may as well be a desktop PC. It would not be at all easy to investigate the boot process on an RPi, because it does not seem to have a BIOS, it will only boot from the SD, the only drivers available are for Linux, and pulling Linux apart is probably beyond A level. Far better to find an old PC in a cupboard somewhere, put FreeDOS on a floppy disk and investigate that.


Teaching Python is fine, but I just don't understand the link between this piece of hardware and learning Python or Pascal or BASIC. It makes no sense to me.


To my mind the reasons for teaching any programming using the RPi are largely down to excitement and ownership on the part of the child, and to perceived safety on the part of the school and parents. The fact that this device can also talk to hardware quite cheaply (but still not for zero cost) is a bonus, but the same projects could be handled by a desktop PC with USB-attached I/O. And that PC or the RPi could be programmed in exactly the same languages, be it C or Python or assembler or any other you can devise. But given that Python produces more powerful code quicker and for less effort on the part of both teacher and pupil, for initial teaching of programming, Python would be my choice.


If the RPi doesn't have a BIOS, then how does it access the SD card to boot the board? Surely there needs to be something running with at least a clock to be able to read the SD card?

How does the RPi 'produce' 'more powerful' code 'quicker' and with 'less effort'?

Ownership of this device with no keyboard, no mouse/touchpad and no screen is unlikely to fire up the imagination of any kids that aren't excited about the electronics side of it IMO

Prometheus
Posts: 308
Joined: Tue Dec 13, 2011 11:09 pm

Re: Best first language choice

Thu Jan 12, 2012 11:44 pm

sonickev said:


If the RPi doesn"t have a BIOS, then how does it access the SD card to boot the board? Surely there needs to be something running with at least a clock to be able to read the SD card?


My understanding is that the GPU is what handles booting, apparently because the SoC used started life as a GPU and had the CPU added later, if I correctly understood something I read elsewhere on the forum recently. (If I have this wrong, please correct me.)


Ownership of this device with no keyboard, no mouse/touchpad and no screen is unlikely to fire up the imagination of any kids that aren"t excited about the electronics side of it IMO


I"m not so sure about that, myself… A mythical tiny-sized computer-of-your-very-own that can be bought with a few months" pocket-money definitely fired the imaginations of at least a couple of generations of kids (my own included, when I was one ), and the computers we were lucky enough to have access to didn"t have screens or mice, either. Didn't stop them from exciting us back then, and I'm pretty sure that the young'uns of today aren't so vastly different in that regard. 

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Best first language choice

Thu Jan 12, 2012 11:55 pm

sonickev said:

If the RPi doesn't have a BIOS, then how does it access the SD card to boot the board? Surely there needs to be something running with at least a clock to be able to read the SD card?
Here's my understanding: the SoC (System on Chip) has a ROM bootloader which upon reset reads a bootstrap image file from the SD card.  This is actually binary code for the GPU.  The GPU loads ARM bootstrap code into RAM and configures the ARM core.  Then the GPU starts up the ARM core, which then boots GNU/Linux or a different operating system in the usual way.

You can find out if I'm right about this and get more details using the search function.

sonickev
Posts: 8
Joined: Wed Jan 11, 2012 3:00 pm
Contact: Website

Re: Best first language choice

Thu Jan 12, 2012 11:59 pm

andyl said:


sonickev said:


My apologies. I do not for a minute mean to say that Python is irrelevant in the wider world of I.T. I do however think that it is irrelevant as a learning language on the RPi...why on earth would you do that when you can just learn python on any one of the hundreds of redundant PCs that litter our schools.
Python is very relevant, but not here on this hardware and in this discussion thread IMO


OK but that wasn't what you said yesterday.  You were far more against Python saying that it had no relevance to the wider world of IT.

You previously stated that interpreted languages are not very good at using libraries.  That is not true either.  Modern interpreted languages (and some not so modern) makes it easy to create and use libraries and to interface with C/C++.  That is a solved problem (and wasn't really a problem to begin with apart from a few implementations of a few languages).

Are there 100s of redundant PCs in schools?  I don't think so.  I don't think my nephews have much access to spend time on them learning to program.  Even if they were, would the authorities let the little oiks loose on them or would they be hesitant in case they messed something up?  With the Pi it is cheap, the SD card can be easily re-imaged, it doesn't take a PC out of a different use.  My nephews can't also take the school's PCs home to continue programming in their bedrooms in the evenings and weekend.

From your later message it becomes clear that you are coming at it from a restricted POV when you start talking about "the electronics industry".  the Pi isn't a solution to help the electronics industry, or even the general programming industry (although I believe it will).  I think the foundation believes that teaching children more about how programs work, and how to program will benefit them generally, in problem solving, and as a secondary result help industry.

I also don't understand your point about "not understanding the link between this piece of hardware and learning Python or Pascal or BASIC".  Considering that nearly any language you care to mention has an implementation for a PC (either Windows or Linux), I'm not sure what language choice you would see as reasonable.


I think what I previously said is on the previous page, so there isn't any need to add a different interpretation. What I have said about Python is in the context of this discussion and I have nothing against Python nor the many times I have seen it used effectively. It isn't a great first language on this project for educational purposes. I stand by that and I'm unlikely to elevate it even into the top 5.

My comments about interpreted languages and libraries are separate. Print in BASIC, running through an interpreter is, of course, a call into a library, just like printf, echo, cout, etc. complex functions, the details of which are hidden behind an API.

Yes there are hundreds of redundant PCs, too old and too slow to be of any use to the majority of ICT needs within a school. Put Linux on them for the purposes of programming and they are perfect (I am a governor of a secondary school, responsible for working with the ICT and Mathematics departments)

Picture the day your nephews take their RPi to school and want to program it. What keyboard would they use? What display would they plug in? Would they need a mouse?

I don't by any means have a restricted POV, I clearly have a broader POV than your own, which includes everything that you describe, plus what I describe. I want kids to learn programming, all of it, top to bottom...not just the small part that is already easily accessible to them. The RPi does not bring some new wonderful platform on which to learn Python

I don't claim for a single minute that the RPi saves the electronics industry, we are still talking education here aren't we? This isn't even about the UK or any particular industry, it is about providing a platform on which people can learn to program. This platform excites me because it gets closer to the hardware, not further away. It is raw.

The language choice that I would see as the most reasonable, or for that matter the most educational, would be a compiled language that produced code that ran on the processor, rather than an interpreted language that ran in a run-time machine that then ran on the processor. Interpreted code will just perpetuate the disjoint between processor and programming and that skill will be lost.

I have to add that when I say 'lost', I come back to being from the UK and the feeling that this skill will be lost to other countries and I would prefer that the UK remained one of the best in this type of programming rather than other countries gainign that skill and taking yet another industry away from us.

sonickev
Posts: 8
Joined: Wed Jan 11, 2012 3:00 pm
Contact: Website

Re: Best first language choice

Fri Jan 13, 2012 12:31 am

Prometheus said:


sonickev said:


If the RPi doesn"t have a BIOS, then how does it access the SD card to boot the board? Surely there needs to be something running with at least a clock to be able to read the SD card?


My understanding is that the GPU is what handles booting, apparently because the SoC used started life as a GPU and had the CPU added later, if I correctly understood something I read elsewhere on the forum recently. (If I have this wrong, please correct me.)


Ownership of this device with no keyboard, no mouse/touchpad and no screen is unlikely to fire up the imagination of any kids that aren"t excited about the electronics side of it IMO


I"m not so sure about that, myself… A mythical tiny-sized computer-of-your-very-own that can be bought with a few months" pocket-money definitely fired the imaginations of at least a couple of generations of kids (my own included, when I was one ), and the computers we were lucky enough to have access to didn"t have screens or mice, either. Didn"t stop them from exciting us back then, and I'm pretty sure that the young'uns of today aren't so vastly different in that regard. 


Agreed but this was in response to the use of an RPi to learn Python which could just as easily be learned on a PC. The point made was that there are no PCs available in schools on which to learn Python.

If there are no PCs, then there are no keyboards or displays either, unless they have been taken from the PCs that don't exist.

So how will the kids program this thing in the classroom if they don't have a PC in front of them (and an SD card slot/USB port)???

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Best first language choice

Fri Jan 13, 2012 1:19 am

sonickev said:


The language choice that I would see as the most reasonable, or for that matter the most educational, would be a compiled language that produced code that ran on the processor, rather than an interpreted language that ran in a run-time machine that then ran on the processor. Interpreted code will just perpetuate the disjoint between processor and programming and that skill will be lost.


I do not see this. Certainly Java, Basic and even Python can be compiled to native code. Pascal is usually compiled. There is nothing an interpreted language can do that a compiled language can not. For proof of that see Turing's paper on computable numbers. In fact even x86 machine code is interpreted by the processor, I believe two levels deep.

There is certainly no difficulty in producing a processor that natively executes Java or Python byte-code. In fact every computer language ever designed is interpreted, since that is how the concept of stored-program computers was invented. Turing again.

But these are issues that do not affect education below university level.

On a machine with only 8-bit integer add operations, C will still offer 16 or 32-bit integers and floating point. C will also offer local variables even on architectures that make it difficult to do. Does that make it inappropriate? Is Forth inappropriate because it never uses a CALL op-code to implement subroutines, even though it compiles many parts to native code? What about COBOL, FORTRAN and Algol, which can never implement an interrupt service routine?

Sure C is designed to be close to the machine. But it is the only compiled language that is, and sometimes its implementation is short of the mark. "x++" does not always get compiled into an INC op-code, even where it could be.

kardianos
Posts: 3
Joined: Tue Dec 13, 2011 10:31 pm

Re: Best first language choice

Fri Jan 13, 2012 2:21 am

rurwin said:


sonickev said:


The language choice that I would see as the most reasonable, or for that matter the most educational, would be a compiled language that produced code that ran on the processor, rather than an interpreted language that ran in a run-time machine that then ran on the processor. Interpreted code will just perpetuate the disjoint between processor and programming and that skill will be lost.


I do not see this. Certainly Java, Basic and even Python can be compiled to native code. Pascal is usually compiled. There is nothing an interpreted language can do that a compiled language can not. For proof of that see Turing"s paper on computable numbers. In fact even x86 machine code is interpreted by the processor, I believe two levels deep.


I would have to agree with sonickev here.  ruriwn, What you're saying is true,  but I think you might be missing a potential point.  I think a good example of a "disjoint between processor and programming" can be seen in Ruby and .NET WPF.  In both cases the designers have made language choices that do NOT take into account how a processor works, how big the cache line is, how many layers of indirection...   The biggest concern is that you can write a single line of code that can potentially write huge amounts of machine instructions in very high level languages.  To write optimized code, you are required to know the internals of the VM or interpreter.

This is not the case in a language like C or Go, where on a stack based physical machine, the resulting machine code will largely be some ratio of the written code.  This is an issue.  Many professional programmers today don't truly understand pointers or function pointers because they never had to deal with them directly, thus higher level constructs (say C# delegates) are very "magical".

Let me give a plug for Go, I think it's as easy to learn as python, easier then Java, but contains core concepts found in C.

-Daniel

andyl
Posts: 265
Joined: Tue Jan 10, 2012 11:05 am

Re: Best first language choice

Fri Jan 13, 2012 12:42 pm

kardianos said:


rurwin said:


sonickev said:


The language choice that I would see as the most reasonable, or for that matter the most educational, would be a compiled language that produced code that ran on the processor, rather than an interpreted language that ran in a run-time machine that then ran on the processor. Interpreted code will just perpetuate the disjoint between processor and programming and that skill will be lost.


I do not see this. Certainly Java, Basic and even Python can be compiled to native code. Pascal is usually compiled. There is nothing an interpreted language can do that a compiled language can not. For proof of that see Turing"s paper on computable numbers. In fact even x86 machine code is interpreted by the processor, I believe two levels deep.


I would have to agree with sonickev here.  ruriwn, What you're saying is true,  but I think you might be missing a potential point.  I think a good example of a "disjoint between processor and programming" can be seen in Ruby and .NET WPF.  In both cases the designers have made language choices that do NOT take into account how a processor works, how big the cache line is, how many layers of indirection...   The biggest concern is that you can write a single line of code that can potentially write huge amounts of machine instructions in very high level languages.  To write optimized code, you are required to know the internals of the VM or interpreter.


As Knuth said "Premature optimisation is the root of all evil". Low level languages encourage premature and inappropriate optimisation. These days very little needs to be that optimised unless you are working in a few specific areas. Many have said the same things both IRL and in books. Functionality is key. Write me something to fetch and parse an XML document from the web. In assembler or C that would be a massive task for a student. Using an appropriate language it would be a reasonable task. The one line that generates a huge amount of machine instructions is something that should be valued. I would expect a student to be able to write a program which works and is idiomatic and can be maintained easily (which means readable code). I would not expect students to be writing stuff that need to wring every last ounce of performance out of a system. That level of optimisation isn't something generally required on degree courses and most professional programmers are not working in fields where it is required or needed.

kardianos said:


Let me give a plug for Go, I think it's as easy to learn as python, easier then Java, but contains core concepts found in C.


The usual hello world for Go is below.

package main

import "fmt"

func main() {

    fmt.Println("Hello, World")

}

Looks quite a bit of faff to explain. I think that there are other problems with Go as a first language.  I think Go is an interesting language but as a first language it is a non-starter.

Pirx-Danford
Posts: 62
Joined: Thu Oct 06, 2011 2:05 pm

Re: Best first language choice

Fri Jan 13, 2012 2:43 pm

There really is no "best" language to start learning with.

If you have the comfort to learn in school,
then just use the language picked by the teacher.

If you are in the uncomfortable situation to have to learn from scratch all by your own, then I would recommend to find good reading materials. For me it was always great to have a specific project to attempt to get solved.

The basic concepts in any language are nearly the same, after one learned the basic concepts its really about the goals you want or have to reach.

Oh and I just found this site here: http://www.codecademy.com this is a pretty creative and hands on approach to learn coding. (Albeit I despise JavaScript)

JonB
Posts: 220
Joined: Tue Nov 29, 2011 9:26 pm

Re: Best first language choice

Fri Jan 13, 2012 4:04 pm

Pirx Danford said:


There really is no "best" language to start learning with.

If you have the comfort to learn in school,
then just use the language picked by the teacher.

If you are in the uncomfortable situation to have to learn from scratch all by your own, then I would recommend to find good reading materials. For me it was always great to have a specific project to attempt to get solved.

The basic concepts in any language are nearly the same, after one learned the basic concepts its really about the goals you want or have to reach.

Oh and I just found this site here: http://www.codecademy.com this is a pretty creative and hands on approach to learn coding. (Albeit I despise JavaScript)


Good advice. My point is to use a language that gets you up to pspeed quickly with these basic concepts. After that, the gamut of programming languages is your oyster, figuratively speaking.

Return to “General programming discussion”