
How to Program Racket - shawndumas
http://docs.racket-lang.org/style/index.html
======
vince_refiti
This is the kind of thing sorely missing from other language teaching - once
you learn the basics, how to write good, idiomatic code? Btw, I can also
recommend Kent Beck's Smalltalk Best Practice Patterns is you are learning
Pharo Smalltalk.

~~~
mark_l_watson
Thanks for the reference, I just ordered a copy. I have been using Pharo
lately and I need a brush up on good coding practices.

The linked article is good and surprised me, especially using 'define' inside
functions instead of 'let'.

~~~
leoc
A pre-publication version
[http://stephane.ducasse.free.fr/FreeBooks/BestSmalltalkPract...](http://stephane.ducasse.free.fr/FreeBooks/BestSmalltalkPractices/Draft-
Smalltalk%20Best%20Practice%20Patterns%20Kent%20Beck.pdf) is in Stéphane
Ducasse's free collection of old Smalltak books
[http://stephane.ducasse.free.fr/FreeBooks/](http://stephane.ducasse.free.fr/FreeBooks/)
, though not linked from that page for some reason.

------
michaelsbradley
_How to Design Programs_ [1], while not an introduction to Racket _per se_ ,
is a wonderful way to get started with the Lisp-family of languages and with
computer programming in general.

Once you work all the way through _Part 1_ of the book, you really do get a
sense that Felleisen, et al. are trying to teach you the why and how of good
program design, not simply introduce you to a particular syntax.

A small study group has been meeting in St. Louis since mid October 2014[2].
Slowly but surely, we're working our way through _HtDP2e_ and learning a lot
from the book and each during as we go along.

[1]
[http://www.ccs.neu.edu/home/matthias/HtDP2e/](http://www.ccs.neu.edu/home/matthias/HtDP2e/)

[2] [http://www.meetup.com/STL-Racket/](http://www.meetup.com/STL-Racket/)

~~~
hga
" _not simply introduce you to a particular syntax_ "

I don't think Felleisen, et al. get _that_ much credit for this, except of
course in having the uncommon wisdom in choosing The One True Way ^_^, which
for instruction is the simple Lisp dialect of Scheme. There's almost no syntax
to teach, e.g. literals (e.g. numbers and strings), atoms, lists, and special
forms like define/lambda and if. Which of course is a major reason to use a
Lisp for introductory programming, you spend seconds to minutes instead of
weeks teaching syntax (of course the students spend a bit more time in the lab
learning how to use the editor to properly indent the code so it can be
comprehended, but isn't that pretty much what you must do with Python??).

BTW, a counterargument I recently came across in the great SICP vs. HoDP
conflict is that the latter has no "magic". Does that resonate with you? (I
can't comment having started reading SICP back when it was a lively Technical
Report.)

~~~
michaelsbradley
Re: syntax, what you say is true. There was a period late last night when HN
comments could not be updated by their authors. Almost right away, I realized
I could have expressed my point better: _"...not simply introduce you to the
authors' preferred language."_

I have not spent much time with _SICP_ , so I can't really make a comparison.
But I can speculate a little: the point of _HtDP_ is to lay the foundation for
and then form the reader-student according to a systematic _" design recipe"_
that is expanded and refined as one works through the book. Many of the deeper
ideas and surprises of computer programming are not explored, as they are in
_SICP_ , so fans of the latter would probably find _HtDP_ to be a "flatter"
learning experience.

~~~
hga
" _...not simply introduce you to the authors ' preferred language_"

Heh, but that doesn't work either ^_^. Sussman was the co-inventor of Scheme
and still loves it, Ableson I don't know, and don't Felleisen et. al. love the
syntax and Scheme at least to a substantial degree?

(I don't know anything about Racket, Felleisen and company essentially ended
up doing a drive-by shooting of Scheme with R6RS, leaving a _very_ bad taste
in my mouth about them, their technical judgement and skill, language
aesthetics, etc. ... but I gather I should look at what they've done.)

~~~
michaelsbradley
_" Heh, but that doesn't work either..."_

Well, the point of my original comment may have become obscured, I'm not sure.

It was that _HtDP_ is not so much a book about Racket/Lisp/Scheme, as it is a
book that aims primarily to impart sound fundamentals for the design of
computer programs, regardless of the language used. And as I wrote previously,
that becomes quite apparent by the end of _Part 1_ , when the "design recipe"
has seen its second major restatement.

By the way, I am only familiar with the 2nd edition of _HtDP_. I can't really
comment on the 1st edition, and it's possible that it gives a different
impression.

~~~
hga
Ah, I get you.

Yeah, SICP, going from the 2nd Edition because my previous edition copies were
tossed or whatever, is that too, but aimed at teaching different things.
Except for the 4th Chapter, Metalinguistic Abstractions, which of course
introduces the metacircular interpreter ... but if that's "The Maxwell
Equations of CS".... That chapter has other treats, and ends with logic
programming.

And per Wikipedia and my general knowledge: " _Before SICP, the introductory
courses were almost always filled with learning the details of some
programming language, while SICP focuses on finding general patterns from
specific problems and building software tools that embody each pattern._ "

But of course, even if we agree this is the way to teach introductory courses,
there is much debate on _what_ to teach, with MIT abandoning SICP in the post-
doc.com crash panic including a crash in enrollment.

(More than halved after being a steady 2/5th of the undergraduate body for
decades. It's gone back up, BTW, along with Stanford's. CMU only accepts 135
students into its program, and UCB, being a state school, probably also has
limits, explicit or implicit.)

------
brudgers
For me this highlights one of the uniquie features of the Racket community. It
tends to row in the same direction based on a shared core value: education.
Coding style is not the _primary_ way people express their inner snowflake.
Partly because extending the Lisp is more satisfying and accessible even to
relatively new community members and partly because there are more than 50
years of Lisp coding conventions to draw on and mostly because the PLI group
has been standardizing coding conventions roughly by consensus in the form of
_HTDP_ for nearly fifteen years.

------
bhrgunatha
It's nice to see these written down and published. I think most large public
projects should consider writing something similar, rather than leave it up to
the reader to guess - and that includes the dreaded tabs/spaces, line length
and naming decisions.

------
happywolf
Curious the use of this language in industry. Appreciate if someone can share
the use of Racket in production.

~~~
dzpower
My craft + tech startup www.youpatch.com uses Racket for the clever bits:
image-processing, pdf generation, and I find it's great for prototyping and
R&D. Here's my talk wide-ranging talk about it (video and slides)
[http://agile-jitsu.blogspot.com.au/2015/01/my-talk-at-
racket...](http://agile-jitsu.blogspot.com.au/2015/01/my-talk-at-
racketcon-2014.html)

Also at RacketCon 2014 Brian Masterbrook talked about using Racket at
www.airstash.com for testing hardware: links at con.racket-lang.org

