Your Next Language

I have been re-learning Perl, for a maintenance project at work. If you don’t have a specific task like that, have more fun while learning, with something like a “joke” program that uses the Fibonacci series to display a list of all the characters Lady Gaga has played in her videos. Or the names of Rebecca Black’s songs. Or maybe something interesting instead.

Obvious

Good place to start. Lady Black deserves the best:

  • Blocks
  • Loops and Decisions
  • Functions
  • Comments: line and block
  • Variables
  • Passing variables to a function: by value, by reference
  • Using the public package repository, and package manager
  • Breaking long lines into readable pieces that fit in a fairly narrow window, so you can edit 3 files side-by-side, and still see a Wikipedia list of those songs and videos and you play them one after the other while telling yourself you’re researching. Or maybe I should follow a Slack channel today, that’s also research.

Scale-dependent

What scale of projects will you work on first? This will help you decide what scales of code management to learn about.

One-file script! After Hello World, you probably need to learn:

  • Including packages from the standard library
  • Including packages downloaded from the public repository
  • Calling functions from other files

Two or more files: you also need to know about:

  • Creating other files to include
  • Specifying which functions are available outside that file

Public scale

By Public Scale, I mean that you will share libraries in a private or public repository. You will likely want to learn other things first, even if you need these skills:

  • Using files or packages shared with other projects in your team or company
  • Accessing them from where they are stored (often by an “Include Path” maintained by your language for its own use)
  • Producing packages for use in a private or public repository, for access by the package manager as your personal startup scales up to its first dozen, I mean thousand, customers

Standard Idioms

So, how do you really read from a file in this language?

  • Reading/writing a file
  • Reading line-by-line from a file or variable
  • Reading from a web page, or a REST API
  • Sorting

The Standard Library

What obvious tasks are you likely to need in this project?:

  • Finding things in a string —look for a Regular Expressions library
  • Date math
  • Database manipulation
    SQL, NoSQL, DBM
  • Reading lists of files
  • Creating files, folders, symbolic links

Preparing for Maintenance

After you get the basics lined up, and before you start doing real coding, consider how to make your code better for the maintenance programmer, which will probably be you, 6–12 months from now after the startup you’re in lays off half the staff, and I was the only one left and there weren’t any other jobs to jump to, and I had three people’s work to do, and then it was my turn and that code may never have been changed since. Yeah, right.

  • Test systems
  • Language/compiler settings to enforce good coding
  • Lint-like tools to check for common coding errors
  • Style enforcement tools
  • How to write inline docs for this language, or how to use the multi-language API generator that your team/company already uses, such as Doxygen, or Swagger.

And more

I have written about software development before. You can look through those blogs for stories that will  help you. Try the categories: “languages”, “software”, “software team”.

Originally published on Medium.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s