Best first language

Drop in for a chat and a cup of tea

158 posts   Page 6 of 7   1 ... 3, 4, 5, 6, 7
by MattCook » Sun Mar 04, 2012 5:17 pm
ta2025 said:


... the one overwhelming obstacle is that you will have to convince Johnny that writing his own "game" is better than waiting for EA or UbiSoft to come out with yet  another title that costs double the cost of a R-Pi...



It may or may not be relevant in this discussion, but if Johnny owns copies of the later Civ games, or the current huge hit Skyrim, he will be able to use Python to modify how the game works.  That should help with the 'Hey Wow, Cool' factor shouldn't it ?

I think that one of the big problems today that we didn't have back in the BASIC days of the early eighties is that there is too much choice.  We had a machine that ran one language, so we learnt it.  Then we found out about assembly code, and perhaps leaned that too.

Now though, we might start to learn Java, then decide that perhaps we should be learning Python first, or maybe we should do a 'proper' (i.e. horrible - YMMV) language like C++, or ...

As it is, even if we could all agree on, say, Python (it's in the name ...), then we will still all be at war about 2.x versus 3.x    Incidentally, to whoever it was that critiqued Python for it's use of indentation, I'm afraid, sir, I must challenge you to pistols at dawn  ;oP

Matt
Posts: 16
Joined: Tue Feb 21, 2012 1:46 pm
Location: S. Manchester
by rurwin » Sun Mar 04, 2012 5:42 pm
MattCook said:

I'm afraid, sir, I must challenge you to pistols at dawn  ;oP

Protocol sir, states that the party challenged has choice of weapons. (It wasn't me.)
User avatar
Forum Moderator
Forum Moderator
Posts: 2913
Joined: Mon Jan 09, 2012 3:16 pm
by mogui » Mon Mar 05, 2012 2:51 am
What is best . . . really?

Considering the notion of "best", whether it be the best design, or best language, or best anything, "best" usually translates to "mine".  Design approaches are arbitrary within the constraints of the goal, so your best language and my best language may not be the same.

In the context of getting engineering concepts into the heads of the young, we often lose the distinction between learning and education.  Education is what we get when we institutionalize learning.  We are all capable of learning to the extent we are able to freely exercise our curiosity, have access to resources, communicate with others of like interest, and loudly proclaim our results.  Sounds like the internet, doesn"t it?

Education lines the young ones up in seated rows, hands folded, ready to receive knowledge. Sometimes it works, but it often neglects the natural mechanisms of learning.  Please don"t flame!  I am only pointing out that which our culture has led us to expect from "schooling".  Often the fish don"t perceive the water.

The foundation is providing a great resource to the learning community.  We should remember that the Pi doesn"t have to be just one thing.  It can be the gateway for curious kids to come to an understanding of many things technological.  If I were to provide a Pi to a young learner, I would want to expose him to as many languages as possible and let him use and choose.

We don"t have to decide between python and lua.  We can have both.  We can also have Squeak and Haskell and whatever else may be deemed cool by the young learner.  We can also have a rich library of example programs and tutorials for the young learner to use as the springboard for his curiousity.

Courses can focus on universal concepts such as the architecture of microcomputers, I/O, looping and control, data types and more.  Classes can be oriented to supporting students" projects.  With code examples, tutorials, and the support of their peers, kids can go farther faster than if they are spoon-fed some adult''s notion of the "best" approach.

Each mind is unique and should be respected as such.  This is the path to the evolution of future technological wonders.

Posts: 14
Joined: Tue Jan 03, 2012 1:31 pm
by cattail » Mon Mar 05, 2012 7:21 am
I like  Lua first programming language,

Children use lua in love (love2d, a game engein ) , can easily find script make characters move different , and a lot of fun , It's learning curve is nice both at school and undergraduate level. There are already some very nice resources could get people up to speed . Use many libs one can use some line to add joystick support, so easy.

If someone write (design) a series lessons for  children study step by step ( easy master make simple game , not language ), and they can make they own games and have the power of learning.
Posts: 2
Joined: Mon Mar 05, 2012 2:18 am
by birger » Mon Mar 05, 2012 10:33 pm
As a long time computer geek fostered on BBC model B I am thinking that for children (starting at age 6 or so) scratch is a very nice environment. My 6 year old creates logo turtle like graphics using the graphical building blocks. The great thing is there is no need to understand english in order to write a program.

For real programming basic is too 80's. In the 90's python came along designed for learning. Today python is big and powerful enough for very serious programming, and it can still be used as a beginners language. That makes it ideal as far as I am concerned.

I have never looked at LUA. perhaps there is a spot for it before python, but I am not certain. Challenge the kids and I think they will live up to it. Python could follow them into 'production'.
Posts: 10
Joined: Tue Jan 17, 2012 12:45 pm
by SN » Mon Mar 05, 2012 11:03 pm
I challenge the statement 'basic is too 80s'

As someone who was there in the 80's as a teenager, has got his O Level in Computer Science and went on to work for that bastion of English Computing ICL and finished hardcore coding about 10 years ago in C# and VB.net via many years of C I think that the original Visual Basic (ver 1 to 6 not .Net) was absolutely fabulously easy to create in from simplistic stuff to the most amazing 3d games.

Now quite clearly the platform for this (fat binary code compiled onto even more bloated platform) is all wrong but if a Linux version that could drive web HTML GUI's existed then this would be what I'd be recommending, an extended BASIC which does OO and GUI's with ease.

I've been looking at python over the last week or so and I see a mish mash of a style which is overcomplicated by an apparent need to 'make it different from c or basic'

And don't get me started on this ridiculous 1960's concept of fixed indents for program structure - I thought this hideousness died with Cobol - you can see poor kids counting spaces on their fingers to get this right.
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?
User avatar
Posts: 1008
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
by Sergi 10 » Tue Mar 06, 2012 10:34 am

I think a good way to introduce children into the world of programming may be the MIT project SCRATCH:
http://scratch.mit.edu/
What better way to learn than jungando with pieces of code, is a great project.

http://www.lanzanos.com/proyectos/rpi-box/eng/
Posts: 12
Joined: Mon Feb 20, 2012 9:10 am
Location: spain
by st599 » Wed Mar 07, 2012 2:05 pm
What's wrong with OCCAM or ADA95?
Posts: 26
Joined: Mon Sep 05, 2011 1:29 pm
by shirro » Wed Mar 07, 2012 10:45 pm
I don't think anyone really knows what the best path is. Everything has happened faster than anyone can make sense of it.

Back in the 80s when compilers cost money and your computer booted into BASIC the typical path path for many was to learn BASIC from typing in code from magazines, modifying it and then writing your own to scratch an itch. Then as soon as you needed to push the machine you would pick up a book on assembly. This could be seen as a model for today. Start with a high level dynamic language and then go low and learn about the underlying machine.

We live in a different world. Compilers are free and plentiful. Lots of the underlying machine is off limits due to commercial IP and is too complicated anyway. A lot of the performance limits that pushed you out of BASIC and down to the hardware have gone.

Even so, I suspect the best path is still start high, and go low as soon as you hit limits. If you take this path you don't want to throw your high level language away but do what the real world does and just optimise the slow bits.

Lua and C are good for this. C is arguably as close to assembler as most people need to go these days and it is pretty easy to see the code it is producing or do inline asm. Lua has closures, tail call optimisations, first class everything practically and doesn't push any particular object model. The only problem is you really need an environment based on Lua than just plain Lua so you get some batteries included.

Python is another great dynamic high level language that you can pick up quickly and get stuff done in. I hesitate about Ruby because you tend to get caught up in the cleverness a bit as with Perl.

Javascript does some weird type conversion things and has some other craziness but is fundamentally another scheme-like language which implements much of what is good in Lua. And it is pervasive and fast these days. QT Creator and QML let you write an entire GUI in Javascript and enhance with c++ where required. And you can do server side and web as well all in the same language.

As much as Scratch or Logo are fun and can be used to teach computer science and maths in a classroom they fail the time proven test. They aren't languages that kids are going to play with at home and make that transition by extending them with another language and another set of concepts. They are more likely to just throw them away and start over. They are a bit artificial feeling because of this and I think it is obvious, at least to certain students.

I think there are more important things to learn than computers in preschool/JP. I path I am taking with my pre-schooler is to transition from his iPad where he is doing some good problem solving games, social games and some world construction to Scratch. He is only 4 so we do short Scratch sessions occasionally with him sitting beside me and making suggestions and me doing the implementation. It is a sort of lop-sided pair programming but he basically makes all the design choices about what the characters should do or what sounds they should make etc. I don't know how this will work out. It seems like a big leap for him to understand what is going on in Scratch.

I don't know what to do in the gap until he picks up more of a foundation in literacy and numeracy. He is quite capable of reasoning out and putting a complicated sequence of actions into effect to perform a task in a game - he just has no way of describing such things to a computer outside of a touch based game environment. As much as I hold a techies bias against visual languages (text rules) there is a gap for something touch and sensor enabled at this level. Which is probably a good thing because he spends too much time in front of a screen as it is.
Posts: 248
Joined: Tue Jan 24, 2012 4:54 am
by R37R0 » Wed Mar 07, 2012 11:17 pm
I'm a software engineer and have got to the point where I can pretty much pick up a new language fairly quickly...

I started at primary school with LOGO on the BBC (with the turtle, they were fun back in the day)

played with some BASIC in the following years on various home computers

during 'A' level computer science, they introduced us to pascal. I found this a great language as it enforced a structured approach to programming (begin...end etc.). We then moved onto C and assembler for more machine-level work

When I got to university, the first language that they taught everyone was C++. This provided a solid understanding of OO design and development. Also did a bit of MATLAB, miranda and some VDM at uni.

Since uni, I have picked up Java and C# fairly easily....

So my opinion is that it depends on who you are teaching programming to...

BASIC is good for the first 'wow a computer can do THAT'...for little kiddies

Pascal is good for providing a good foundation in a structured language

C for machine level work + all SW engineers should know C IMHO

C++ is essential as it will give a good knowledge of OO design and development

...however these language are probably not fashionable enough anymore....
Posts: 16
Joined: Sun Mar 04, 2012 8:14 pm
by mlepage » Sat Jun 30, 2012 10:54 pm
As a professional programmer who knows a lot of programming languages, I believe Lua (www.lua.org) would be an excellent language to start with. It's simple, small, modern, procedural, and close enough to JavaScript and ActionScript to be relevant. With LÖVE (www.love2d.org) newcomers can make interesting graphical programs right away. I intend to do some interesting things with Lua and Pi myself.
Posts: 9
Joined: Tue Jun 12, 2012 1:58 am
by el_toro » Sun Jul 01, 2012 4:32 pm
dyashkir wrote:I was considering this question for a while, what is the best first language to introduce to kids?


Well it comes with GNU/c and bash built in, and also has awk. awk is a powerful list processing language, although Larry Wall later wrote perl partly because he got fed up writing ksh scripts to give awk better file handling. I was learning FORTRAN at 14 and having a free c compiler would have been just mustard.

awk behaves very like a human looking through the file for "stuff" then doing something. It's also slightly different from the usual programming logic so encourages a different style of thinking. If you can find the little grey (out of print) book by A W and K it is an excellent tutorial.

The advantage of bash is that it's quick and doesn't need compiling. And now your kids can be unix admins on just about any type of unix (even Solaris10 has bash). It is like enough to ksh and sh to fairly quickly switch between, and if you get a good top-down style in anything it tends to stick.

Functions - yes
Logic blocks - yes (if and while)
Arithmetic - yes
File handling - yes
Powerful regular expression matching - yes
OO - no
Handy to know if you're trying to fix a broken pi - yes

Good examples (and some bad ones) are littered all over the pi.

The very idea that you can do stuff with the machine itself and you don't always need "a language" is also a bit of a revelation to a lot of computer science graduates that we employ.
User avatar
Posts: 12
Joined: Sat Jun 30, 2012 10:26 pm
by louisgeorge » Sat Jul 07, 2012 1:06 pm
rjw57 wrote:Quote from dyashkir on November 15, 2011, 20:48
I am partial to lua, small clean powerful. Python probably is good as well. What does everyone think?

Either is sensible. Learning both at the same time would be highly instructive. Noticing what they do the same and what they do differently is invaluable.



i agree with rjw ....
Posts: 6
Joined: Tue Jul 03, 2012 2:59 pm
by LuaPie » Sun Jul 15, 2012 3:28 pm
I would give another vote to Lua. You can make games really easily in Lua. The other advantage of Lua is that most games consoles have got a Lua Player for them, so you can type up the Lua game on a PC and then play it on your favourite games console.

Playing a game you wrote yourself on a games console rather than a PC is a whole new level of joy, because normally you expect that games console games are something that only professionals can write. Plus you can play it in the living room on a big TV rather than a small computer screen.

If you are talking about 1st programming language on Windows, then I would have to say Autoit, which is probably even easier then Lua. On of the main thrills of Autoit is the ability to make authentic looking Windows GUI programs really quickly and easily. I remember when I was at school and they made us program on the command line and I hated that, it was like been forced into the 1970's! I wanted to make a modern looking Windows GUI program, just like all the proggies I used on my own computer!
Posts: 11
Joined: Tue Jul 10, 2012 12:52 pm
by Lucretia » Mon Jul 16, 2012 4:01 am
ta2025 wrote:I ADA (Seriously, do you think any kid is going to last 10 minutes in an Ada class?  Or in a non-graphical environment for that matter?)  Probably not.


Why do people think Ada is an acronym and not a name? Hint, it's a name, it's named after a person, therefore the spelling is Ada, not ADA.

Also, I think that anyone who thinks that Pascal is a good beginner language should be able to see that Ada is also, it can start similarly to Pascal and then move past anything Pascal has to offer, mainly because standard Pascal is very basic, i.e. like BASIC it was designed as a teaching language and doesn't provide much more than the core language.

Luke.
Posts: 37
Joined: Sun Aug 28, 2011 10:49 pm
by johnbeetem » Mon Jul 16, 2012 7:04 pm
Lucretia wrote:Also, I think that anyone who thinks that Pascal is a good beginner language should be able to see that Ada is also, it can start similarly to Pascal and then move past anything Pascal has to offer, mainly because standard Pascal is very basic, i.e. like BASIC it was designed as a teaching language and doesn't provide much more than the core language.

While BASIC and Pascal were both created for teaching programming, they have very different philosophies according to my experience. When I programmed in BASIC, it was all about making it easy to write simple programs but large sophisticated programs quickly exposed limitations. They may have been addressed since I last did BASIC. OTOH, Pascal is about teaching good programming practices such as declaring all your variables, modularity, and structured control. Pascal is suitable for both simple and sophisticated programs.

I've studied Ada, and while it's an interesting language I wouldn't recommend it as a first programming language.
User avatar
Posts: 942
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Coast
by Lucretia » Mon Jul 16, 2012 11:05 pm
johnbeetem wrote:While BASIC and Pascal were both created for teaching programming, they have very different philosophies according to my experience. When I programmed in BASIC, it was all about making it easy to write simple programs but large sophisticated programs quickly exposed limitations. They may have been addressed since I last did BASIC. OTOH, Pascal is about teaching good programming practices such as declaring all your variables, modularity, and structured control. Pascal is suitable for both simple and sophisticated programs.

I've studied Ada, and while it's an interesting language I wouldn't recommend it as a first programming language.


Yes, BASIC has huge limitations, i.e. once you know what you are doing you can't really go any further with it and you have to find another language (unless you use something like Blitz or Max, etc.) and it's the same with standard Pascal, unless you go with Delphi or similar.

I actually disagree here, I think considering Ada looks similar to Pascal, up, it's more wordy and has more to it, I think if you start off small and introduce it a bit at a time, I think it can be a good starting language. Not only that, once you've grasped the basics of it, you can continue to use the more advanced features to larger and larger projects, e.g. operator overloading, OO, tasking, interfacing to other languages, interfacing directly to hardware, distributed systems annex, the real time annex, restricting the language for embedded applications, etc.

Obviously, some of these features are better off being introduced at a later age, but there's nothing stopping a 10 year old grasping the basics of the language.

Also, it's better than starting them on C and asking them to find out why some program wont compile because a closing brace is missing from somewhere and the indentation looks right. At least the Ada compiler tells you what is wrong and where straight off the bat, can't be beaten IMO.

Luke.
Posts: 37
Joined: Sun Aug 28, 2011 10:49 pm
by pbreneman » Tue Jul 17, 2012 12:20 pm
Hi Lucretia,

I'd like to learn more about Ada. Is there any way to create minimal packages that contain the minimal amount of files to compile a program? If so I might be interested in creating a duplicate of this page but using Ada rather than Free Pascal:
http://www.turbocontrol.com/helloworld.htm

Thanks,
Paul
Posts: 13
Joined: Thu Jun 07, 2012 12:31 pm
by Lucretia » Tue Jul 17, 2012 1:18 pm
pbreneman wrote:Hi Lucretia,

I'd like to learn more about Ada. Is there any way to create minimal packages that contain the minimal amount of files to compile a program? If so I might be interested in creating a duplicate of this page but using Ada rather than Free Pascal:
http://www.turbocontrol.com/helloworld.htm

Thanks,
Paul


If you can hold on a little while, I'm in the process of writing an article or 2 for MagPi that should cover enough of Ada to get started.

Luke.
Posts: 37
Joined: Sun Aug 28, 2011 10:49 pm
by kavin » Fri Aug 03, 2012 10:10 am
I think british english !
Posts: 1
Joined: Fri Aug 03, 2012 10:09 am
by brs » Mon Aug 27, 2012 8:47 pm
I would vote for Python. It's quite beginner friendly, introduces many important programming language concepts in a clean way and yet is not an irrelevant toy. It's one of the most popular programming languages according to http://www.langpop.com/, there is an active community, there are many tools and libraries available and some reasonably complex software systems are being built in Python. You can actually get a job as a Python programmer, which might be harder with Logo...
Posts: 70
Joined: Fri Aug 17, 2012 9:27 pm
Location: Zurich
by Lucretia » Tue Sep 04, 2012 12:50 am
pbreneman wrote:Hi Lucretia,

I'd like to learn more about Ada.

Thanks,
Paul


Hi, I'm not sure if my article will be published any time soon, you can grab it my site.

Luke.
Posts: 37
Joined: Sun Aug 28, 2011 10:49 pm
by jackokring » Tue Sep 04, 2012 3:22 am
Looking back, I learned various flavours of BASIC, and many other languages too. I noticed things like LOGO (or maybe Logo, we'd have to ask a grammar freak who needs us to speak proper like, but yeah, but no... but), which is a fine language, but it suffered from less code examples compared to BASIC, and I think this is why it was used less.

Any language which can do arithmetic and looping and symbolic abstraction is fine as a first language, but the 'need' for un-necessaries will make it harder to learn. A few examples follow.

Java: An immense amount of code is needed to display a window, considering the simplicity of the description. This is more of a fault with the standard libraries and not java.lang, even though it also should be made nicer and cleaner to code with (public main args[] for example, instead of extends Main). Especially with the default package modifier not having to be typed in. No Java programmer seems to have released an easy abstraction layer providing these package simplicities. Maybe ask Oracle for a nice javax.simplicity.

C: #include and friends and a not so simple debugging process. I hate C++ as it's a perverse idea to extend C that way. Use a function pointer or Java and gcj or a nicer object language. C also needs a lot of boilerplate code for anything interesting to be done in a GUI.

Pascal: Try Modula-2 or 3 instead. After all that's what Pascal's designer did.

There have been a few calls for Lua, and it's not bad, and is a very small system (lacks bloat which is a good thing). But the batteries included effect of a larger code base is perhaps more important when people are learning.

I have started on a language design myself, and it has no bloat, but it has no IO yet, and no code examples. Many languages never become anything more than research tools. It's most important feature so far is that all variables are active, and so function calls and data recall are the same process. This makes sense as an inversion of the "code as data" principal, to become "data is just literal code" . (should this dot not be inside the quotes, and correctly called a full stop)? :D Or thought of as "how can stopped progression ever be started if nothing is progressing to be able to reference and start the thing to be started?"

The language also has a postfix stack model, as well as a list model, and also a method of fetching the upcoming program parse stream, so as to allow definition of prefix and infix words defined by the user. The preference is for using postfix functions, with prefix parsing when un-evaluated things are needed.

There is no best. All trade-offs lead to a difference of understanding. A million minds of the same form are not as adaptive as a million minds free to form into many lingual groups.

p.s. the idea of swearing as a bad thing, is because control fascists can't stand criticism.
Pi=B256R0USB CL4SD8GB Raspbian Stock. https://sites.google.com/site/rubikcompression/strictly-long https://dl.dropboxusercontent.com/u/1615413/Own%20Work/Leptronics.pdf https://groups.google.com/forum/#!topic/comp.compression/t22ct_BKi9w
User avatar
Posts: 784
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
by Lucretia » Tue Sep 04, 2012 3:59 am
jackokring wrote:Java: An immense amount of code is needed to display a window, considering the simplicity of the description. This is more of a fault with the standard libraries and not java.lang, even though it also should be made nicer and cleaner to code with (public main args[] for example, instead of extends Main). Especially with the default package modifier not having to be typed in. No Java programmer seems to have released an easy abstraction layer providing these package simplicities. Maybe ask Oracle for a nice javax.simplicity.

C: #include and friends and a not so simple debugging process. I hate C++ as it's a perverse idea to extend C that way. Use a function pointer or Java and gcj or a nicer object language. C also needs a lot of boilerplate code for anything interesting to be done in a GUI.


Having had to develop in C and C++, I would avoid any language that uses braces to delineate block structure, mainly because it's hard to see and when deeply nested easy to mess up and have the wrong structure; anyone used VS6 which actually helped you cock up blocks and the spewed out pages of errors, none of which gave any indication as to where the problem was?

Which is easier to read?

Code: Select all
{
    {
        {
        }
     }
}


Code: Select all
begin
   begin
      begin
      end;
   end;
end;


Simple and obvious.

Luke.
Posts: 37
Joined: Sun Aug 28, 2011 10:49 pm
by jackokring » Tue Sep 04, 2012 4:17 am
Lucretia wrote:
Having had to develop in C and C++, I would avoid any language that uses braces to delineate block structure, mainly because it's hard to see and when deeply nested easy to mess up and have the wrong structure; anyone used VS6 which actually helped you cock up blocks and the spewed out pages of errors, none of which gave any indication as to where the problem was?

Which is easier to read?

Code: Select all
{
    {
        {
        }
     }
}


Code: Select all
begin
   begin
      begin
      end;
   end;
end;


I suppose you'd replace () with something else for maths expressions? :D
Pi=B256R0USB CL4SD8GB Raspbian Stock. https://sites.google.com/site/rubikcompression/strictly-long https://dl.dropboxusercontent.com/u/1615413/Own%20Work/Leptronics.pdf https://groups.google.com/forum/#!topic/comp.compression/t22ct_BKi9w
User avatar
Posts: 784
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK