Teaching Programming Languages (including Ruby)

Hello,

This is a follow up from previous postings about teaching Ruby in the
class room.

I’ve now come full circle, and put together this website:
http://programming.dojo.net.nz/

This site is about programming languages in general, and is designed to
be a starting point for people interested in learning more about a given
programming language.

I’d be really grateful for people to look at the site and let me know
any feedback about the content and how it is presented.

In particular interest to this group is the Ruby page:
http://programming.dojo.net.nz/languages/ruby/index

Also, under the Resources section, there are a set of posters (including
one for Ruby). These posters are designed for class rooms where they
will stimulate interest in programming languages. The posters are likely
to have at least one more iteration, so any feedback on them would be
appreciated (including corrections or improvements).

http://programming.dojo.net.nz/resources/programming-language-posters

If anyone has any suggestions about particular resources or reading
material, please let me know. Keep in mind this is a site for absolute
beginners.

Thanks,

Kind regards,
Samuel

Awfully ambitious!

But what? No COBOL?

Does this mean you’ve given up on creating teaching materials for Ruby?
The referenced website is such a comprehensive undertaking that it must
interfere with steady progress on Ruby teaching, right?

j

James D. Maher
[email protected]

yeah the links given are good…
but i have opened one of the books on wikibooks and there was no option
to
download that book…
so if you can provide with some downloadable material then it will be
great…

Dear James,

Cobol could be considered, but my goal was mostly to try and get a
sample of existing and educationally relevant languages, rather than a
historically accurate resource.

One thing which you might be interested in is on the Resources page
there is a link to programming language history poster:
http://www.levenez.com/lang/

This is quite a good poster if you are interested in the historical
aspect of programming language evolution.

I have not given up on producing teaching materials for Ruby. This is
simply stepping back and looking at the bigger picture. However, the
goal for this site in the future will be the addition of tutorials
teaching Ruby. The original tutorial (in need of a bit of TLC) is still
under development:
http://programming.dojo.net.nz/study/learn-ruby

It still requires a lot more work.

Thanks for your feedback.

Kind regards,
Samuel

Dear Aamir,

Can you tell me exactly what link you looked at?

The Starting Points are mostly external links and not something I can
control unfortunately. I’ve tried to select ones that are generally good
for beginner to intermediate.

Thanks for your feedback.

Kind regards,
Samuel

Dear Aamir,

I see what you mean.

On the right hand side of that page is a link which says “Download as
PDF”

This might be what you are after?

Kind regards,
Samuel

I have looked at wikibooks link on PHP learning part…but i don’t fond a
book there just some information but no downloadable book

On Sun, May 2, 2010 at 6:56 PM, Samuel W. <

On 05/02/2010 02:28 PM, Samuel W. wrote:

This is a follow up from previous postings about teaching Ruby in the class room.

I’ve now come full circle, and put together this website:
http://programming.dojo.net.nz/

I don’t find your description of Java accurate. For one, it has a
slightly negative tendency (“This can make it difficult to write short
and concise Java programs.”). I’d rather stick with descriptions as
factual as possible. I would only put such a statement in a later
chapter but not directly on the introductory page.

Then, you could argue that Ruby is even more object oriented than Java
because it does not have primitive types. Also, the ascription that it
is an interpreted languages is at least incorrect in two ways: it
insinuates that it is slower than compiled languages - which it is not -
and it misses the point of modern HotSpot JVM’s with dynamic compilation
of byte code into machine code.

This site is about programming languages in general, and is designed to be a starting point for people interested in learning more about a given programming language.

I’d be really grateful for people to look at the site and let me know any feedback about the content and how it is presented.

In particular interest to this group is the Ruby page:
http://programming.dojo.net.nz/languages/ruby/index

The introductory sentence misses the phrase “object oriented” which I
consider at least as important as the others (if not more important).
I’d probably write “Ruby is a dynamically typed, object oriented
programming language …”

If anything this seems to be an ambitious project. Good luck!

Kind regards

robert

Dear Robert,

Thanks for your well thought out response.

On 3/05/2010, at 6:15 PM, Robert K. wrote:

On 05/02/2010 02:28 PM, Samuel W. wrote:

This is a follow up from previous postings about teaching Ruby in the class room.
I’ve now come full circle, and put together this website:
http://programming.dojo.net.nz/

I don’t find your description of Java accurate. For one, it has a slightly negative tendency (“This can make it difficult to write short and concise Java programs.”). I’d rather stick with descriptions as factual as possible. I would only put such a statement in a later chapter but not directly on the introductory page.

Yes I agree with you. I’ve removed the statement.

Are there any other issues which you feel are not correct? I’d prefer to
make it as good as possible, so if there are other inaccuracies it would
be good to improve.

Then, you could argue that Ruby is even more object oriented than Java because it does not have primitive types. Also, the ascription that it is an interpreted languages is at least incorrect in two ways: it insinuates that it is slower than compiled languages - which it is not - and it misses the point of modern HotSpot JVM’s with dynamic compilation of byte code into machine code.

Are you saying that I should not describe Ruby as an interpreted
language? Or, should I discuss that interpreted languages can be as fast
as compiled languages through advanced techniques such as hotspot
compilation?

The latter seems like the best option to me… what do you think?

This site is about programming languages in general, and is designed to be a starting point for people interested in learning more about a given programming language.
I’d be really grateful for people to look at the site and let me know any feedback about the content and how it is presented.
In particular interest to this group is the Ruby page:
http://programming.dojo.net.nz/languages/ruby/index

The introductory sentence misses the phrase “object oriented” which I consider at least as important as the others (if not more important). I’d probably write “Ruby is a dynamically typed, object oriented programming language …”

Yes this makes sense, I wonder how I missed that… to many late nights
:stuck_out_tongue: I’ve updated it with this new text.

If anything this seems to be an ambitious project. Good luck!

Kind regards

robert


remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Thanks for your feedback.

Kind regards,
Samuel

2010/5/3 Samuel W. [email protected]:

Then, you could argue that Ruby is even more object oriented than Java because it does not have primitive types. Also, the ascription that it is an interpreted languages is at least incorrect in two ways: it insinuates that it is slower than compiled languages - which it is not - and it misses the point of modern HotSpot JVM’s with dynamic compilation of byte code into machine code.

Are you saying that I should not describe Ruby as an interpreted language? Or, should I discuss that interpreted languages can be as fast as compiled languages through advanced techniques such as hotspot compilation?

The latter seems like the best option to me… what do you think?

Sorry, that was not clear enough: the paragraph refers to your
description of Java. Java is not an interpreted language - at least
not completely.

Thanks for your feedback.

You’re welcome!

Kind regards

robert

Dear Robert,

I see. Yes, Java isn’t always interpreted, strictly speaking. But… in
the general case it is interpreted before it is optimized. However, I
will think about the best way to address this.

It is kind of like how C isn’t always compiled… its a very gray area.

I think the definition has to be such that interpreted is basically the
opposite of compiled… but even then, we compile Java to bytecode, which
is then interpreted, which might then be compiled to native code… heh
:stuck_out_tongue:

Kind regards,
Samuel

On Mon, May 3, 2010 at 12:51 PM, Samuel W.
[email protected] wrote:

I was reading this with quite some interest when it struck me that you
might consider the audience as a tie breaker. If I understood
correctly you are talking to beginners. In that case I suppose there
is not really much room for sophistication. Considering that almost no
interpreted language is really purely interpreted (MRI 1.8 being one
of the exceptions, but one could argue that it is compiled into an AST
first[1]) but compiled into some sort of bytecode first, Java clearly
qualifies as an interpreted language. It is probably necessary to hide
some details from the beginners.

Cheers
Robert

[1] As a side node JRuby is a nice example of how complicated stuff
can become. IIRC it is interpreting the AST, compiling hot parts into
Java bytecode, and then depending on the JVM of course all sort of
other optimizations (including another potential JIT) are taking
place. Thus interpreted and compiled just become a matter of the
viewpoint.
R.

Dear Robert,

Even thought the audience is a beginner, many people will have questions
about these topics; it is important to have a good resource which has a
basic explanation of what is happening under the hood - a diagram might
be suitable on the page which explains interpretation.

I’ve updated the Ruby page with better example and structure. If you
have any suggestion about “Why would I learn this language?” section,
please let me know

http://programming.dojo.net.nz/languages/ruby/index?new

(I’ve appended ?new just in case the page is cached).

Kind regards,
Samuel

Dear Alec,

I think C++ is generally not a good language for teaching programming :slight_smile:
It probably depends on the level of the student and what they are trying
to achieve.

But thanks for pointing that out.

Kind regards,
Samuel

In message [email protected], Samuel
Williams [email protected] writes

Dear Robert,

I see. Yes, Java isn’t always interpreted, strictly speaking. But… in
the general case it is interpreted before it is optimized. However, I
will think about the best way to address this.

It is kind of like how C isn’t always compiled… its a very gray area.

FWIW, there are a number of C++ interpreters too: UnderC, Ch, CINT, to
mention just these three. Although these have minority use, and C++ is
almost always compiled, I guess they have particular merits in a
teaching/learning context.

Alec

In message [email protected], Samuel
Williams [email protected] writes

Dear Alec,

I think C++ is generally not a good language for teaching programming
:slight_smile: It probably depends on the level of the student and what they are
trying to achieve.

Well, that’s another debate, that I’ll not plan to join here - only to
say that I agree w/ your second sentence; and that I’ve seen a
successful Introduction to Programming course using C++ as its main
vehicle. (It only used a simple subset of the language, for
simplicity.) And that for sufficiently mature, and capable, students,
IMHO it has a lot to recommend it.

But thanks for pointing that out.

That was my intent.

Regards,

Alec

On Mon, May 3, 2010 at 12:35 PM, Samuel W.
[email protected] wrote:

Dear Alec,

I think C++ is generally not a good language for teaching programming :slight_smile: It probably depends on the level of the student and what they are trying to achieve.

But thanks for pointing that out.

Just to reinforce the point. Computer language are neither inherently
interpreted nor compiled. This is an aspect of an implementation.

There’s also a bit of fuzziness in what compilation vs. interpretation
means. At one end of the spectrum is an implementation which compiles
source code into the native machine instructions for the target
platform, at the other end is one which re-parses source code every
time and interprets it. There are very few implementations at the
second end of the spectrum, most ‘interpreters’ actually ‘compile’
source code into some intermediate representation for
execution/evaluation.

The MRI implementation of Ruby pre-1.9 ‘compiles’ ruby source into an
abstract syntax tree. Ruby 1.9 compiles to what are effectively
instructions for an ‘artificial’ virtual machine, this is similar to
how most Java implementations work, with detail differences.

Similar ‘byte’ coded VMs have been used for implementations of
languages such as C/C++ which are normally compiled to machine code.
And there are cases where such implementations can outperform
‘traditional’ implementations on some platforms, because the
executable code is more compact, keeping the working set size down and
reducing virtual memory swapping/paging overhead.

Lisp one of a triumvirate of the earliest programming languages (along
with FORTRAN and COBOL) has a traditional implementation similar to
Ruby 1.8, aided by the fact that Lisp is a homoiconic language which
makes the ‘compile’ part particularly early. However, Lisp too can be
compiled, the Scheme dialect, developed by Guy Steele and Gerald
Sussman at the M.I.T. AI lab in the mid 1970s-early 1980s provided a
hotbed for such activities.

Sussman and Steele’s original ‘Lambda Papers’ are seminal works which
have informed quite a few language designers.

http://library.readscheme.org/page1.html


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

Not that it matters, but I was curious as to why the doors examples are
different.

For example, the ruby example could be written:

for i in (1…100) do
root = Math.sqrt(i)
state = (root == root.ceil) ? “open” : “closed”
puts “Door #{i}: #{state}”
end

which would closer match the PHP one:

<?php for ($i = 1; $i <= 100; $i++) { $root = sqrt($i); $state = ($root == ceil($root)) ? "open" : "closed"; echo "Door $i: $state"; } ?>

I just think having a side by side comparison of closer related methods
might help.
Good luck with the project! I’ll probably use it if you throw
Objective-C or Lua on there :slight_smile: I really want to learn those two, and the
resources I have found aren’t that great.

~Jeremy

Dear Jeremy,

Yes, I’m aware that the PHP version is optimized - this is something
which will be corrected (de-optimized).

Kind regards,
Samuel

Interesting, Thanks for the information.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs