<div dir="ltr">Hello all.<div><br></div><div style>TL;DR: I &quot;want&quot; a code review. Link to the repository at the end.</div><div><br></div><div style>This is my first post here so I think it&#39;s appropriate to introduce myself. I&#39;m a professional programmer and I have been programming for nearly twenty years now. At work I use Python and CoffeeScript; before that I used PHP, C++ and C, but I have no formal education in the field, which means that I missed an opportunity to learn about many interesting, but not immediately usable things.</div>

<div style><br></div><div style>For the last few years I have been trying to compensate for this in my spare time. I have learnt, to various degrees, languages such as OCaml, F#, Smalltalk, Erlang, J and Prolog among other more or less interesting languages, dialects and environments.</div>

<div style><br></div><div style>Still, until about a year ago I knew nothing about Lisps. I decided to take a look at one of them and by pure chance I chose Racket. I am in love with it ever since.</div><div style><br></div>

<div style>For the last year I was scribbling Racket code from time to time and reading a lot about it: from docs to blog posts to source code. Everything I wrote was short and incomplete, I was essentially playing with newly discovered features without trying to build anything in particular.</div>

<div style><br></div><div style>It took me so long, because Racket is vast and because I was concurrently playing with Erlang and Smalltalk. I still don&#39;t know much about Racket and I consider myself a beginner, but I decided that it&#39;s time to actually do something instead of just playing.</div>

<div style><br></div><div style>Two weeks ago at work I was asked to prototype a JS app that would display on &lt;canvas&gt; and would allow a user to type some text and then bend it freely along the curve.</div><div style>

<br></div><div style>I needed to figure a bit of math for this. HTML canvas API is rather low level one and essentially everything in the app would have to be computed by hand. I chose to play with math in Racket, using its GUI capabilities and I planned to switch to JS once the equations and basic algorithms were established. Which I did, the project started and the app is being developed right now (I&#39;m not involved anymore).</div>

<div style><br></div><div style>All this left me with about 200 lines of Racket code - the greatest amount I&#39;ve written to date. I thought that this is the chance I was waiting for - all I had to do was to refactor the spaghetti into modules, add some event handlers and I would end up with a working Racket app.</div>

<div style><br></div><div style>For a few days more I was cleaning up the code and optimizing it, trying to transform it into something I wouldn&#39;t be embarrassed of. I still didn&#39;t write a proper contracts nor docs, but I somehow succeeded - I have a little app that works and looks ok to my eyes.</div>

<div style><br></div><div style>And that&#39;s the problem.</div><div style><br></div><div style>I know very well that I&#39;m a beginner and I know that there are vast parts of Racket that I don&#39;t know of. I would like to ask anyone who has a few  moments of free time to review what I wrote and tell me if it is a &quot;good&quot; - ok, passable - Racket code; what should I do to make it better, what mistakes I made and - maybe - what I managed to get right. I&#39;m especially concerned with the style of the code and it&#39;s structure, but any comment is fine.</div>

<div style><br></div><div style>The code lives here: <a href="http://bazaar.launchpad.net/~klibertp/+junk/bezier/files">http://bazaar.launchpad.net/~klibertp/+junk/bezier/files</a> </div><div style><br></div><div style>I will really appreciate any feedback from anyone. Thanks in advance!</div>

<div><br></div><div><div><div dir="ltr">Best regards,<div>Piotr Klibert</div></div></div>
</div></div>