Lucretia
Posts: 43
Joined: Sun Aug 28, 2011 10:49 pm
Contact: Website

Re: Best first language

Tue Sep 04, 2012 11:19 am

jackokring wrote: I suppose you'd replace () with something else for maths expressions? :D
No, that would be stupid.

Luke.

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

Re: Best first language

Tue Sep 04, 2012 4:47 pm

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;
Simple and obvious.

Luke.
To be fair, it's just as easy to mistake where you begin and end using the words begin and end as it is with brackets if you're not careful, or if there is a lot of code between the start and the end. But there's no arguing one's preference ;-)
Dear forum: Play nice ;-)

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

Re: Best first language

Tue Sep 04, 2012 4:52 pm

I had misgivings about Python to start with, but it grows on you.

It's also impossible to have the indentation not match the meaning of the code.

Unlike C...

Code: Select all

for (i = 0; i < 10; i++)
    printf("Debug: %d", i);
    x = x + i;

if (x > 2)
    if (y > 4)
        printf ("hello");
else
    printf ("goodbye");
... or just about any other language, including Java and Pascal.

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

Re: Best first language

Tue Sep 04, 2012 7:27 pm

I like braces. I think they're an elegant notation, and allow me to put a lot on a single line. I like Pascal as a teaching language, but all the begins and ends get tiresome. The Occam/Python method of using indentation to express block structure is attractive, but I need a way to do block structuring on a single line. If you have to put statements on separate lines to keep the compiler happy, you might as well be programming in Fortran IV.

JMO/YMMV

User avatar
jackokring
Posts: 815
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
Contact: ICQ

Re: Best first language

Tue Sep 04, 2012 8:39 pm

rurwin wrote:I had misgivings about Python to start with, but it grows on you.

It's also impossible to have the indentation not match the meaning of the code.

Unlike C... <snip> ... or just about any other language, including Java and Pascal.
I think in the post modern world this is just an editor problem, as loading and saving could do a simple text based substitution of indents to { and }, so allowing C to be python-esque, or vice versa. Long live regex...
Pi[NFA]=B256R0USB CL4SD8GB Raspbian Stock.
Pi[Work]=A+256 CL4SD8GB Raspbian Stock.
My favourite constant 1.65056745028

psutton
Posts: 156
Joined: Thu Jan 12, 2012 10:45 pm
Location: Devon
Contact: Website

Re: Best first language

Tue Sep 11, 2012 10:41 am

If you want basic for the PI then its worth checking out return to basic written by gordon henderson

https://projects.drogon.net/return-to-basic/

I have written a draft guide on how to get it working on the PI on my website

http://drupal.zleap.net/node/30

This probably needs some work, but its a start.

Hope it helps

Hucky
Posts: 12
Joined: Sat Aug 11, 2012 5:28 pm

Re: Best first language

Sat Sep 15, 2012 11:20 am

A number of people suggest assembler as first language.
Although I have written an intro to ARM assembler for ages 11 thru 80 ("Fun with assembler" , http://www.vanhaarlem.eu/assembler) I would recommend a short course in a higher language first, like Python.
Assembler is then very useful to teach the inner workings of a computer (and it is a lot of fun).

psutton
Posts: 156
Joined: Thu Jan 12, 2012 10:45 pm
Location: Devon
Contact: Website

Re: Best first language

Fri Sep 28, 2012 11:43 am

johnbeetem wrote:Quote from jamesh on November 17, 2011, 14:39
I think that might put off more people than it attracts! Modern ARM assembler is pretty complicated.

Yes, ARM assembly language gets more complicated each version. And the machine language is quite messy: the instructions for each new version are squeezed into the gaps left over from the previous version. They've done a clever job of evolving the instruction set, but it's a far cry from the regularity of PowerPC, for example.

There's also the problem that you have to register to get the documentation. I didn't have any problem, but I don't know what's going to happen when 10,000 eleven-year-olds try to register and electronically sign the use agreement.


Off at a tangent a little, but if you want to learn asembler you can try ardino or I think PIC chips not quite arm on PI but I am sure, I am sure however there are simulators for ardino available and you could compile on the Pi.

My first assembly language was the 12-bit PDP-8, which is marvelously simple: 6 memory reference instructions and one micro-coded ALU instruction. Then came MIX, Don Knuth's simulated machine for teaching assembly language. Then the PDP-11, which was an absolute joy. Very easy to hand assemble and disassemble. Then many tears when cheap memory made the PDP-11 obsolete.

Although I've never worked with it personally, today I'd look into the Texas Instrument MSP430 for learning assembly language. It's a 16-bit computer clearly influenced by the PDP-11. According to TI's website you can get a development board for US$4.30. No, you can't run GNU/Linux on it and you need to run the tools on another computer -- perhaps RasPi some day?

ljr1981
Posts: 2
Joined: Sun Jul 12, 2015 12:30 am

Re: Best first language

Sun Jul 12, 2015 1:03 am

abishur wrote:
Lucretia wrote: Which is easier to read?
...
To be fair, it's just as easy to mistake where you begin and end using the words begin and end as it is with brackets if you're not careful, or if there is a lot of code between the start and the end. But there's no arguing one's preference ;-)
Even with a "modern" editor, the curly braces are difficult to manage. Difficulty leads to bugs. Bugs are not good. Ask any user.

Therefore, if one's language method and notation of choice do not have curly braces, then we have one less source of difficulty leading to bugs. Less bugs means happier end users in every language.

So, I agree. The other syntactical-sugar is the foisted need for line-ending semicolons. Dispensing with both curly braces and semicolons declutters and tones down the noise in the notation and allows the reader to do what they are there to do—read and comprehend without unnecessary noise (aka curly braces and semicolons).

Cheers!

ljr1981
Posts: 2
Joined: Sun Jul 12, 2015 12:30 am

Re: Best first language

Sun Jul 12, 2015 1:34 am

Hucky wrote:A number of people suggest assembler as first language.
Although I have written an intro to ARM assembler for ages 11 thru 80 ("Fun with assembler" , http://www.vanhaarlem.eu/assembler) I would recommend a short course in a higher language first, like Python.
Assembler is then very useful to teach the inner workings of a computer (and it is a lot of fun).
I completely agree that breadth of knowledge is good, as is critical thinking—that is—being able to critique a language method and notation beyond the Tiobe Index. Assembler teaches a wealth of near-to-metal knowledge about the machine. In college, I took a class based on a book called: Chips-to-Systems. Excellent knowledge-base that has served me (and others) well over time. As a U.S. high school student in the late 70's, BASIC and FORTRAN, with a little IBM System-3 JCL tossed in were the languages of choice. We handled it quite successfully. Younger than high school, I have no educated or experience-based opinion, so I will stand clear of it.

Post-college and Army-days, I spent about 19 years plinking about in Visual FoxPro, VB.NET, and C#.NET (a little). Along the trail, I picked up Java, but never used it professionally—VFP kept me in meat-n-taters. Then about 5 years back, I got a shot at a new project and chose the Eiffel language as the base for it. The only regret I really have in the choice is the lack of rich GUI libraries. Otherwise, I have been thrilled to use this method and language on a day-to-day basis ever since.

So—Today, I am at Barnes and Noble looking through the magazine rack, while the wife shops-til-she-drops. I come upon the Raspberry Pi mag section, pick one up, and start reading. I am intrigued! I see Raspberry Pi is largely Linux! YAY! Eiffel is excellent on Linux. It also happens to be a "Trans-compiler"—meaning—it compiles Eiffel to C and then passes the generated C code to a C compiler to complete the job. It can also use existing C libraries, do in-line-C externals, or several other forms of interaction with C (DLLs and so on).

I hear the preponderance of folks holding up Python as a great place to start, with some Assembler, C, C++, and Java thrown in and agree. Have fun! For me—Eiffel is a multi-platform paradigm, so I get to (like Java and C) write portable code that lives nicely on Windows, Linux, and Max OS (can specifically use cocoa) at the same time. When I saw how Raspberry Pi is a Linux-distro-friendly machine as I vacuumed up the articles in the magazine, I was and am ready to order my first Pi machine, and start tinkering with it in Eiffel.

BTW—like Python, Java, C#, and other high-level languages, Eiffel has garbage-collection, memory management, and other nice things. What's really exciting to know is that when I compile, it goes to C (near-metal) and is really tight and really fast! So, unlike the anxieties I read about slowness and so on, I don't get that hassle. Also, because of how Eiffel is structured, the compiler is able to remove "dead code", so the end-of-the-line executables are quite small—a simple "Hello World" complete with memory manager and garbage collection is <1,600KB. With the Raspberry Pi having limited memory, I think the size of the executable is important, especially if I am going to create a Linux-based appliance using the Raspberry Pi.

Anyhow—I am looking forward to working with a new Raspberry Pi machine as soon as I can get one ordered.


Cheers!

User avatar
JSingleton
Posts: 18
Joined: Fri Jan 16, 2015 12:10 pm
Contact: Website

Re: Best first language

Tue Aug 25, 2015 3:14 pm

I recently came across a post on "Experiences using Go as a Teaching Language with Young Programmers". Not used Go myself but it looks interesting.

Python seems to be the most popular. I am just concerned that beginners will have trouble with the significant whitespace. It gets difficult if you mix tabs and spaces (or other non-printable characters).

Ruby and BASIC could be good options. C style languages might work but a code formatter (built into many IDEs) would be very helpful.
Computing4Kids.com
@shutdownscanner
unop.uk

Return to “The Staffroom”

Who is online

Users browsing this forum: No registered users and 3 guests