addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Learning a new Language?

From: Johnny W.
Sent on: Tuesday, November 13, 2012 8:33 AM
Hey Everyone!

Looking for ideas when learning a new language? Check out this email from igal Koshevoy and the PDXruby group.

Happy Hacking,

---------- Forwarded message ----------
From: Igal Koshevoy <[address removed]>
Date: Mon, Aug 20, 2012 at 8:45 PM
Subject: Re: [pdxruby-beginners] beginner programs
To: [address removed]

On Mon, Aug 20, 2012 at 4:39 PM, Nathan Calies <[address removed]> wrote:
Does anyone have any good ideas for beginner programs? Something that involves classes, methods, arrays...beginner stuff like that.

When I want to learn a new programming language, I sit down and write some of the sample programs below. I've done this many times over the years with many programming languages. Figuring out how to do this requires me to pretty much start with figuring out where the various reference information is and how to search it to do what I want.

These specific programs will exercise the most common and important language and framework features, while still being relatively quick and easy to write. I've organized them from easiest to most involved. If you know you can write all of these, then you pretty much know the core language and framework, although not necessarily the best way to use them.
  • UNIX ls command work-alike -- exercises ability to write a program, interacts with command-line input, control structures, iteration, file system interaction, output, error handling, etc:
    • List files, sizes, etc. in current directory
    • List files, sizes, etc. in directory specified as argument
    • Display error messages and help if needed
    • Write this in an object-oriented library
    • Write tests

  • UNIX grep command work-alike -- exercises regular expressions, filesystem recursion, reading files, standard input, etc:
    • Search a file for a string or regexp and print matching lines
    • Search STDIN for a string or regexp and print matching lines
    • Search recursively through files/directories for a string or regexp and print matching lines
    • Display error messages and help if needed
    • Write this in an object-oriented library
    • Write tests

  • Command-line todo app -- exercises database persistence and interactive programs:
    • List, create, edit, delete todos (e.g. title, optional date)
    • Mark/unmark a todo as done
    • Do this with command-line arguments (e.g. use the "thor" gem so you can run `todo add "Learn Ruby"` to add a todo; display ids next to your todo list so you can edit/delete specific tasks, e.g. `todo done 17` to mark todo #17 as done)
    • Do this with an interactive program (e.g. run `todo`) and you'll get a helpful menu of options that you interact with
    • Write this in an object-oriented library
    • Write tests

  • Blog -- this seems to be the most common beginner web program these days. Although it's useful if you're very new to programming, it only exercises a handful of features and thus isn't as valuable as the other web apps I list below. 

  • Wiki -- exercises routing, markup, parsing, error handling, etc:
    • List, create, edit and delete wiki pages
    • Show a wiki page by turning its simplified markup (e.g. into HTML and also turn specifically transformed text into wiki links
    • Visiting a page that doesn't exist should display an explanation and provide a way to create the new page
    • Write tests
    • For a bonus, track wiki page revisions and provide a way to compare and rollback

  • Categorized address book web app -- exercises more complex model relationships, database queries, and views:
    • List, create, edit, delete categories (e.g. "Friends")
    • Show a category and its associated entries (e.g. "Friends" and a list the people in it)
    • List, create, show, edit, delete entries (e.g. "Bob Smith", phone number, address, etc)
    • Search and display list matching entries
    • Write tests

  • Todo list web app -- exercises writing web applications, data persistence, sorting, filtering, and very basic MVC, and possibly AJAX, authentication and authorization:
    • List todos
      • Provide a way to filter the list so you get just the ones that are done and not done
      • Provide a way to sort the list by whether the todo is done or its due date
    • Create a todo (title, optional due date)
    • Edit a todo
    • Delete a todo
    • Mark/unmark a todo as done
    • Write tests
    • Bonus:
      • Try to reuse your command-line todo list as the underlying library
      • Add AJAX support, e.g. mark a todo as done from the list of todos
      • Add support for managing multiple todo lists
      • Add authentication and authorization so multiple users can login, but by default can't see or edit each others lists
      • Improve the authorization so users can grant each other privileges to a particular todo list, e.g. view or modify
      • Add internationalization


Our Sponsors

  • Ascentis

    Hosts meetings and provides pizza and drinks!

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy