User avatar
crundy
Posts: 310
Joined: Fri Aug 12, 2011 7:47 am

Re: Weapon of choice?

Tue Oct 11, 2011 9:09 am

OK so back to thinking about the best way to use the R-Pi to teach kids programming, which language do you think would be best suited? We would want something that\'s:

1) Lightweight: Needs to run well on the device, which means java might be out
2) Free: Needs to have a free IDE and SDK, which means iOS dev is out (well, you wouldn\'t be able to anyway on linux)
3) Easy to learn: This is the tough one. Is C++ a bit \"deep end\" for people who have never coded before?
4) Relevant: Needs to be either something that kids can use in the real world (to make mobile apps or personal websites) or that will teach them programming skills that can be easily transferred to another language when they get the resources

So as far as I can make out the two \"best\" languages would be Python and PHP, which is a shame because Python is still a bit specialist, and PHP is a horrible language (IMHO).

Personally I think it would be best to start kids on an OO language that\'s easy to use (e.g. java or .NET, but the latter might be out due to platform) so they learn strict coding initially and don\'t pick up bad habits that languages like PHP allow (or even encourage).

It would be good to write a basic introduction document to the language of choice which could be printed out, stapled in the middle and folded into an A5 booklet for people to run through. I could try and write something if anyone has any good suggestions for the above.

kme
Posts: 448
Joined: Sun Sep 04, 2011 9:37 am

Re: Weapon of choice?

Tue Oct 11, 2011 9:31 am

I disagree on the OO language part - that\'s one abstraction layer too much for as beginners. To catch immediate interest logo is nice as kids see graphic output with very few lines of code and very advanced graphic patterns with just a dozen lines or a bit more. Logo fast becomes too limiting for real programming, but hopefully the kids caught interest in that coding stuff by then.

EDIT: And you can actually get a logo interpreter written i python. A nice link.

User avatar
crundy
Posts: 310
Joined: Fri Aug 12, 2011 7:47 am

Re: Weapon of choice?

Tue Oct 11, 2011 9:36 am

I suppose it depends on whether the best choice would be something easy or fun to catch their interest in coding with a view to moving onto something else later, or something with real-world applications so they can do things like publish their own website and feel like their newfound skills are useful in the long run.

HeadCase
Posts: 51
Joined: Sat Sep 03, 2011 8:11 am

Re: Weapon of choice?

Tue Oct 11, 2011 10:05 am

I think someone may have mentioned Lazarus in another thread. For those who may not be aware of it, Lazarus is the Delphi clone which is built on FPC (Free Pascal Compiler). Lazarus is a RAD (Rapid Application Development) IDE which makes it very easy to produce GUI/nonGUI applications.

The history of this is:- Borland Turbo Pascal (very widely used in the early PC days) begat Object Pascal which begat Delphi (possibly the first RAD) which begat FPC (an open source Pascal compiler) which begat Lazarus (Delphi clone) and is in the process of begating Objective Pascal for mobile platforms.

Lazarus is (imho) the easiest and most convenient way of producing a working app that runs in a windows environment. FPC is a good compiler with ARM support. The great thing about Lazarus is that it allows you to design a Form with buttons, paintboxes, wigets etc which will compile to a working program without writing a line of code. After that you create code assigned to events which will actually do interesting things.

Obvoiusly many people will have very strong views about teaching languages, but if the goal is to get a novice to produce a simple graphics program that actually does something, Lazarus must be a strong contender.

Archangel5089
Posts: 36
Joined: Mon Aug 15, 2011 8:37 am

Re: Weapon of choice?

Tue Oct 11, 2011 10:37 am

[quote]Quote from crundy on October 11, 2011, 10:09
So as far as I can make out the two \"best\" languages would be Python and PHP, which is a shame because Python is still a bit specialist, and PHP is a horrible language (IMHO).[/quote]

Most of my professional development work has been in PHP. While it is a very useful language to know I have to agree it would be an awful example of a first programming language. PHP will lend itself to making websites which might be a fun use for kids but as soon as you start doing that at beginner level all thought of OO stop and you start thinking in terms of the page structure and how to display things.

I come from a Java background and that helps me apply the concepts to PHP work but I don\'t think I would if I\'d in PHP.

User avatar
crundy
Posts: 310
Joined: Fri Aug 12, 2011 7:47 am

Re: Weapon of choice?

Tue Oct 11, 2011 10:57 am

[quote]Quote from Archangel5089 on October 11, 2011, 11:37
[quote]Quote from crundy on October 11, 2011, 10:09
So as far as I can make out the two \"best\" languages would be Python and PHP, which is a shame because Python is still a bit specialist, and PHP is a horrible language (IMHO).[/quote]

Most of my professional development work has been in PHP. While it is a very useful language to know I have to agree it would be an awful example of a first programming language. PHP will lend itself to making websites which might be a fun use for kids but as soon as you start doing that at beginner level all thought of OO stop and you start thinking in terms of the page structure and how to display things.

I come from a Java background and that helps me apply the concepts to PHP work but I don\'t think I would if I\'d in PHP.[/quote]

Agree completely. PHP is great for quickly getting pages up, but it\'s one of those languages that\'s pretty difficult to get any kind of workable standards against.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Weapon of choice?

Tue Oct 11, 2011 11:02 am

[quote]Quote from kme on October 11, 2011, 10:31
I disagree on the OO language part - that\'s one abstraction layer too much for as beginners. [/quote]

To be fair, you can use an Object Oriented language without going into to how that aspect of it works. You can write very simply and straight forwards programs (Hello World ;) ) without explaining the methods it\'s calling to output that line. Then once you get a handle on the language you can add on the OO part of it and they\'re already comfortable enough with the language to comfortably move forward.
Dear forum: Play nice ;-)

User avatar
crundy
Posts: 310
Joined: Fri Aug 12, 2011 7:47 am

Re: Weapon of choice?

Tue Oct 11, 2011 12:42 pm

[quote]Quote from abishur on October 11, 2011, 12:02
[quote]Quote from kme on October 11, 2011, 10:31
I disagree on the OO language part - that\'s one abstraction layer too much for as beginners. [/quote]

To be fair, you can use an Object Oriented language without going into to how that aspect of it works. You can write very simply and straight forwards programs (Hello World ;) ) without explaining the methods it\'s calling to output that line. Then once you get a handle on the language you can add on the OO part of it and they\'re already comfortable enough with the language to comfortably move forward.[/quote]

Actually that\'s true. When I first started using .NET I didn\'t understand OO at all until after I\'d written a few websites and applications with it, and even then it was after I went on a Java training course with my work.

Asmodeus
Posts: 29
Joined: Mon Aug 01, 2011 7:44 am

Re: Weapon of choice?

Tue Oct 11, 2011 12:44 pm

[quote]laby is a small program to learn how to program with ants and spider webs.[/quote]
http://www.pps.jussieu.fr/~gimenez/laby/

kme
Posts: 448
Joined: Sun Sep 04, 2011 9:37 am

Re: Weapon of choice?

Tue Oct 11, 2011 12:50 pm

Actually that\'s true. When I first started using .NET I didn\'t understand OO at all until after I\'d written a few websites and applications with it, and even then it was after I went on a Java training course with my work.

That pretty much underline my point. But I guess it all depends what we mean when saying \"kids\". I\'m talking ~10-12 year olds (that would be 3. to 5. graders around here), not high school.

willjcroz
Posts: 11
Joined: Thu Sep 01, 2011 1:26 pm

Re: Weapon of choice?

Tue Oct 11, 2011 3:46 pm

If one of the aims is to prepare the next generation for the challenges that will be faced in the software industry over the next decade or two, we need to recognise that many of the languages and paradigms in widespread use today are already falling short in many areas. Key to this is the idea that concurrency and parallelism are moving from being advanced, esoteric concepts to being things mainstream programmers have to consider more and more every year.

I\'m not saying that we should all be teaching kids Haskell out of the gate, but that we should listen to the leading voices in these areas that seem to be converging on the ideas that we need to be reducing mutable state and embracing functional programming concepts as a way to move forward in the software industry. These concepts are not new but somewhere along the line mainstream programming went down the imperative route and functional programming became a niche.

Many have put good arguments forward that teaching an imperative paradigm first, and leaving the \'hard\' functional programming until the students become more \'advanced\' is the wrong approach. Many have suggested that the reason \'imperative programmers\' find functional programming so hard is because they were not exposed to it early enough. There is quite a bit of evidence to suggest that children pick up functional programming just as easily as imperative if they are introduced at the same time. I know that I have found that learning functional programming involves a significant amount of effort \'unlearning\' much of what I previously considered to be gospel. It turns out that imperative programming is only one of multiple ways of looking at the world. I wish I was exposed to functional programming earlier, much earlier.

I think that OOP and imperative style is worth teaching but not to preclude the introduction of functional programming paradigms. Personally I am of the view that OOP is both powerful and useful where appropriate but all too often it is abused as if it were the solution to everything.

Python, Ruby or Scheme (esp. Racket) might be good candidates for teaching/learning some functional aspects of programming in a relatively easy going environment. There\'s also a promising project called Kojo (http://www.kogics.net/sf:kojo) developed and used by a teacher in an Indian orphanage for girls to teach programming and maths etc.

Some further reading for those interested:

\"The Free Lunch Is Over\" by Herb Sutter : http://www.gotw.ca/publications/concurrency-ddj.htm

Simon Peyton Jones\' talk from 2008: \"Taming Effects with Functional Programming\" : http://www.infoq.com/presentations/Tami ... yton-Jones

CMU switching to FP for freshmen : http://existentialtype.wordpress.com/20 ... -freshmen/

\"Where are the Software Engineers of Tomorrow?\" : http://www.crosstalkonline.org/storage/ ... -Dewar.pdf

barnaby
Posts: 76
Joined: Fri Sep 16, 2011 6:32 pm
Contact: Website

Re: Weapon of choice?

Tue Oct 11, 2011 4:02 pm

I would argue that oo programming could quite easily be easier to understand than procedural programming - not for text based apps, but for GUI apps. It becomes a lot easier when an interface is a collection of objects that have properties, and things you can tell them to do.

Cheers,
Barnaby

bnolsen
Posts: 76
Joined: Sat Aug 13, 2011 5:37 pm

Re: Weapon of choice?

Tue Oct 11, 2011 4:17 pm

How clean is lua? Is it possible to provide a already complete action RPG like simulation game engine with very separately defined lua modules. The assignments would be to rewrite each module in the game engine, say one a week or something like that.

Some rough examples of module types (Note I haven\'t written a game myself, just pulling out some rough ideas):

Monster AI, increasing in complexity (simple melee, magic user, special midlevel, boss).
Player AI, maybe for different classes (melee, magic, etc).
Pathing and collision behaviours.

I took an OS course which was based on similar principles. A VM based OS was provided. Each assignment was to replace a provided VM module with your own...memory allocation, resource locking, scheduling, virtual memory, etc.

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Weapon of choice?

Tue Oct 11, 2011 5:09 pm

[quote]Quote from barnaby on October 11, 2011, 17:02
I would argue that oo programming could quite easily be easier to understand than procedural programming - not for text based apps, but for GUI apps. It becomes a lot easier when an interface is a collection of objects that have properties, and things you can tell them to do.

Cheers,
Barnaby[/quote]

But not all applications are UI applications and more to the point you don\'t need OO to make it easier. We had UI stuff before that and it could be easy or hard to figure out depending on the notions the library developer had on things.

OO helps you scale that ease of development...once you grasp it and it can be taught well. The problem is that you can get carried away with OO and make a muddled up mess with the code just like ordinary procedural coding.

The reality is that not a single one \"paradigm\" or language is going to solve all problems- and people desperately need to lose their hammers here.

They may be able to be put to the task, but there\'s drawbacks to things. For example, if I\'m developing a massively distributed, fault tolerant system that must largely never go down for any reason, I would probably choose Erlang, out of box and just throw more blades, boxes, etc. at it to raise the performance of the overall system. Use Erlang or Haskell to design a FPS game? Not on a bet. The functional languages have performance penalties that get lost when you\'re talking about things that Haskell or Erlang would actually be GREAT at. C++ would maybe get there with higher performance, but I wouldn\'t want to maintain the mess there. Java? Heh...you might get faster than Erlang. You\'d probably not.

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Weapon of choice?

Tue Oct 11, 2011 5:13 pm

[quote]Quote from bnolsen on October 11, 2011, 17:17
How clean is lua? Is it possible to provide a already complete action RPG like simulation game engine with very separately defined lua modules. The assignments would be to rewrite each module in the game engine, say one a week or something like that.[/quote]

Pretty clean, really. Games are using it to drive their AI code, including one of the titles I\'ve ported to Linux for the Humble Indie Bundle. It forms the scripting engine for the installer I and others use on Linux and elsewhere, MojoSetup.

It could be used to teach basic computer science concepts well enough against a game engine.

Timo
Posts: 8
Joined: Sat Aug 27, 2011 9:04 am

Re: Weapon of choice?

Tue Oct 11, 2011 6:52 pm

I prefer C++, but also Python seems to be a good choice.

C++ fulfills \"lightweight\", \"free\" and \"relevant\" of the initial posts criteria. But for most people it fails the \"easy to learn\" criterion. But I think it can be clearly taught in the beginning (except the \"using namespace std;\", which seems like magic):

Code: Select all

#include <iostream>    //Make \"packages\" available
using namespace std;    //Must be done
int main () {      //Starting point
cout << \"Hello World!\" << endl;    //Output with new line at end
return 0;    //Telling all things clear
}
Given a few more commands (and ways to use them) (like cin) enables a couple of possibilities for experimenting. OO and much of the pointer stuff could be hold back for much later. There are many ways to make C++ code cryptic, but just don\'t tell them how in the first place.

Python lacks a bit of \"relevant\", but scores in the other criteria. The big standard library should nearly give anything someone needs.

At least these two languages should be given teaching material.

I personally dislike the idea of teaching a functional programming language as the first one, because of less support (I may be wrong here) and relevance.

DaveMoor
Posts: 2
Joined: Wed Oct 12, 2011 10:32 am

Re: Weapon of choice?

Wed Oct 12, 2011 11:51 am

I always find these discussions funny :) In my Computer Science degree the main language was Pascal. We also dipped our toes in C, C++, Cobol, Assembly and Fortran, maybe others as well.

Anyway a couple of years after graduating I went for a job interview, it was for a VB programmer (v5 was current at the time). The interviewer was n\'t really that keen because I only had a bit of VB v3 experience and he already had a junior programmer. I left the interview confused as to why he said that. You see my view on programming is all languages have loops, logical selections, most have functions/procedures and object orientation, it is just the syntax and presentation that changes. I also accept some things are easier to achieve in one language over another.

Based on this, so long as this is explained the language is irrelevant. From a learning point of view I would have said Pascal. But here is my suggestion of a top level course layout

1. Start with Python as it\'s nice and clean, easy to read due to the formatting requirements, and can be used to easily write simple procedural code without having to sniff a class object.
2. Then as the students progress objects can be introduced.
3. Finally for advanced object orientation/GUI applications Lazarus (as mentioned above) can be used.

By the end the you have experience of 2 languages, so hopefully you won\'t be afraid to try others.

kme
Posts: 448
Joined: Sun Sep 04, 2011 9:37 am

Re: Weapon of choice?

Wed Oct 12, 2011 12:37 pm

Well put DaveMoor. I couldn\'t agree more. Once you\'ve learned one language properly, its easy to switch. Only trouble is to learn the first one.
As a student I always joked that I spoke three languages well: Danish, English and Pascal :-)

kme
Posts: 448
Joined: Sun Sep 04, 2011 9:37 am

Re: Weapon of choice?

Wed Oct 12, 2011 12:44 pm

Code: Select all

#include <iostream>    //Make \"packages\" available
using namespace std;    //Must be done
int main () {      //Starting point
cout << \"Hello World!\" << endl;    //Output with new line at end
return 0;    //Telling all things clear
}
Yeah and in Python that would be:

Code: Select all

print \"Hello World!\"

mangobrain
Posts: 4
Joined: Wed Oct 12, 2011 7:47 am
Contact: Website

Re: Weapon of choice?

Wed Oct 12, 2011 1:40 pm

Regarding Lazarus: be very careful when suggesting the use of RAD tools for beginners; are you sure you know what you\'re letting yourself in for? Here\'s a snippet from something I posted on the CAS wiki:

As someone who already had some programming experience before starting my degree, I got the impression that going straight for the GUI - in this case, Delphi - was a double-edged sword: on the one hand, it got people\'s attention because it was so simple to create what felt like \"proper programs\" (\"proper programs\" obviously opening windows, having clickable buttons, etc.); on the other hand, because the environment put so much emphasis on GUI design, few people ever took their code much further than what the IDE would generate for them, and didn\'t really understand how to turn their pretty windows into functional applications. Graphical IDEs can be a thing of wonder, but please don\'t fall into the trap of thinking that rapid application development somehow equates to rapid uptake of knowledge. There\'s merit in understanding how to do things yourself before being given tools which automate the process.

ats
Posts: 6
Joined: Fri Aug 26, 2011 2:02 pm

Re: Weapon of choice?

Wed Oct 12, 2011 1:59 pm

I would argue for C. Although it\'s not necessarily the best language for writing applications in, I think it is good for teaching the basics of programming. It is a relatively small language without much syntactic sugar, it will run natively on Raspberry Pi with lots of tools available, and it exposes things like manual memory management, pointers and memory addressing, buffer overflows, etc. that would be useful to know about.

I don\'t think it is too important to compare lines of code between languages (with regards to learning how to program). The hardest part is getting the new programmer in front of an editor with a proper environment setup for running his/her programs and some good introductory tutorials or books. After that, typing in a few extra lines probably won\'t matter much if they are actually interested in learning.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Weapon of choice?

Wed Oct 12, 2011 2:51 pm

I always ask somebody who says that \'This language is the best\' : What language has it been written in? 95% of the time the answer is \"uhhh... uhghh... in-C\". At which point I can just stay silent....

Lakes
Posts: 267
Joined: Wed Aug 24, 2011 2:17 pm

Re: Weapon of choice?

Wed Oct 12, 2011 5:06 pm

Well, C would be like thrown in at the deep end to a beginner IMO

Start with something easier thats \"C\" like but without having to worry about all the pointer stuff to teach the basic concepts and to get the computer to draw something interesting to capture interest.

Learn to walk before running.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Weapon of choice?

Thu Oct 13, 2011 12:48 am

As I said previously, you don\'t have to start with pointers and OO programming just because you use a language that is capable of using them. Plus considering that the majority of modern programming is done with OO programming languages it makes a lot of sense to learn a language from the git go that\'s capable of such things as it will make the transition to OOP that much easier (and yeah I know C isn\'t an OOP, I just link OOP and advanced programming techniques such as pointers together) :P
Dear forum: Play nice ;-)

Return to “General discussion”