Code Scaffolding

Code Scaffolding


Did you know, internet friends, that Michelangelo had to construct a special scaffolding system to paint the sistine chapel?? Its true. So my meditation on scaffolding is not with out historical precedence.

One of the things I wanted from my time at  RC was to build better coding habits. This included things like consistently posting projects to github, having a good dev environment (ie tricking out my vim conf), but also structuring my projects in a less idiosyncratic way. And that means scaffolding!

This week was hack week at my job, where we hack on personal projects. I was working on a machine learning project – more to come on that in another post. Since my code was going to be in its own repo, and not part of the monolithic code base, I was wondering what sort of code scaffolding I should use. The code in question is python code – fyi…

What do I mean by code scaffolding?  These are the files and documents that every software project has.  Frameworks like Rails, and Django automatically scaffold projects because they are very opinionated in how things need to work. Node also has some great scaffolding libraries thanks to yeoman. Rust and Haskell also have good project generators – but what about python, just plain ole python??

I posted this question to our corporate internal slack … do we have any corporate python project structural requirements?? Crickets. Although one person did point me to a nifty command line parsing library called click. I was going to say I used this in Rust but really I used the clap library -I just cant think straight because 5 planets are in retrograde and I just got off an airplane.

In any case, after a quick google I found this sample module repository, by Kenneth Reitz. It’s nice. The directory structure is set up well with licenses, readmes, documentation (sphinx), and testing (node). I forked one, and will probably modify this for our internal corporate usage, and also for my own personal usage. Maybe I’ll add some functionality for selenium 🙂

Getting into the habit of setting up my projects in a standard and organized way, helps focus my mind on the task of just writing code and it gives me confidence that the code I share will not be arranged in some bizarro manner. Sometimes bizarro is good, but if you are writing corporate code, or code that has to be  reused, best to take your ego out of it and write something clean, functional, and understandable.

Culture and Code


When I was a young programmer I worked with people from many different countries: Russia, China, India, Brazil, Africa. Of the the things that I would think of, was that all the code was in english.  Even though we would write, C++ or Java, or Perl (this was the early 00s), they were really derivative of english. A conditional in programming languages, uses the English words IF.. Then.. Else, even if case of Ruby, which was created in Japan.

I would think about this, what would a programming language look like in French, would there be a tense ending for conditionals instead of  if.. then … else.   What about a Latin programming language, would there be different kind of loops to refer to different types of time spans ? A future perfect loop, a perfect loop, an imperfect loop. What does a programming language look  like if it was built with the Japanese katakana syllabary?

This morning I ran across bato, it is a programming language written in Filipino. I dont read Filipino but this is an example of an if – then else statement:

kapag 1 > 0
  iprint "Kumusta mundo!"
  iprint "Mayroong sira"

Would love to see more experiments like this in the future.