Invaluable Human Back-and-Forth

For the past week, I’ve been beating my head against the wall trying to sync what feels like a million of moving parts. Each new forum post that I read to help me understand what virtual environments, file system hierarchies, servers, ports, shells and command lines are led me down another rabbit hole of confusion. Even the responses that I got the the questions that I posted (see below), just led to more questions. It wasn’t until I chatted with a developer over the phone, set up port forwarding and was able to watch him take control of my bash shell (and ask him lots and lots of questions while he showed me how a professional manipulates all these moving parts) that I began to understand. Forums and self-learnings are great. But I find that being able to talk to an expert, watch what he does and stop him to ask questions is KEY to being able to understand some of this stuff. I finally feel like I’ve grabbed a hold of some of these moving parts and can navigate a bit better. I came to feel really anxious and frustrated about all of this development stuff. Those 1.5 hours of human back-and-forth talking time were incredibly valuable. I feel relief.

Development Plan

(from Chap. 4.3 of ThinkPython by Allen Downey)

development plan is a process for writing programs.

There are several strategies for this.

  • The “encapsulation and generalization” process can be useful if you don’t know ahead of time how to divide the program into functions. This approach lets you design as you go along. The steps are:
  1. Write a small program with no function definitions.
  2. Once you get the program working, encapsulate it in a function and give it a name.
  3. Generalize the function by adding appropriate parameters.
  4. Repeat steps 1–3 until you have a set of working functions. Copy and paste working code to avoid retyping (and re-debugging).
  5. Look for opportunities to improve the program by refactoring. For example, if you have similar code in several places, consider factoring it into an appropriately general function.

Classes and OOP Concepts

Modularity:

  • Classes encapsulate methods which encapsulate procedures
  • These ‘modules’ can be used in different programs without having to understand how they’ve been implemented

Encapsulation:

  • Def:  names (of variables and methods) are stored in locations that then have to be accessed, called namespaces or environments.

Substitution Principle:

  • When we create a subclass, we want it to inherit a lot of behaviors of the parent class. For example, when we have classes ‘Student’ and ‘Parent’ (the first being a child class of the latter), we would expect students to behave as people for any piece of code.  In other words, we want the subclass to be able to be used in any context. This saves saves us from having to rewrite code for particular behaviors of different subclasses.

Generator:

Inheritance:

  • Def: The ability to define a new class as a modified version of an existing class
  • The new class (i.e. subclass or ‘child’ class) inherits the methods of the  existing (i.e. ‘parent’ or super class); however, if the subclass uses the same name for a function which has also been used in the superclass, it will only use the subclass definition of that function.

Abstract data type:

  • Def: A set of objects and the operations on those objects.
  • ADT are purely theoretical entities that are defined indirectly, only by the operations that may be performed on it and by mathematical constraints on the effects/cost of those operations
  • Used to simplify the description of abstract algorithms, to classify and evaluate data structures
  • May be implemented in many ways and in many programming languages

Helpful Learning Devices

From courses and hours spent trying to figure out bits of code, I’ve learned that the following are helpful in understanding concepts and code:

1. Seeing a visual explanation of algorithms such as this demonstration of merge sort.

2. Seeing tables with values at every line of the algorithm

3. Running code with “print” statements to see assigned values and how they change throughout the code

4. Seeing code with notations about what’s going on at key lines

5. Watching YouTube videos that explain computer or server architecture, how to set up virtual environments, etc.

Stack Overflow and Dev Community

It’s amazing that I received two really good answers to my question about an algorithm 10 minutes after I posted it. The rate and helpfulness of some developers continues to amaze me. Where else do you find people who readily read and figure out the answers to your questions, reply to them and don’t receive compensation? Does the feedback (eg. votes on questions, ‘badges’ received, views received) motivate these developers? Or are they doing it out of an altruistic impulse? Or because they want to show off their knowledge? Or because they simply believe that an online ‘community’ ought to help one another? This is definitely a question I want to continue to pursue and make note of as I ask for help in learning this stuff.

I’m also still trying to figure out the conventions of these forums. After having my question voted ‘down’, I learned some things about asking question in developer forums. Clarity and precision of questions are important because there are so many language-specific issues. Also, when adding more correct tags to the question, you can involve more people to help. Adding python, for example, will involve people related to python to help. You can accept and vote on the answers. This reflects on your acceptance rate in the community. If it’s high, more people will try to help you in the future.

Below, I’ve copied and pasted some of the forum’s conventions that are explained on the site (under FAQ)

 

What is reputation?

Reputation is a rough measurement of how much the community trusts you; it is earned by convincing your peers that you know what you’re talking about. Basic use of the site, including asking questions, answering, and suggesting edits, does not require any reputation at all. But the more reputation you earn, the more privileges (see below) you gain on Stack Overflow .

The primary way to gain reputation is by posting good questions and useful answers. Your peers will vote on your posts, and those votes will cause you to gain (or, in rare cases, lose) reputation:

answer is voted up +10
question is voted up +5
answer is accepted +15 (+2 to acceptor)
question is voted down -2
answer is voted down -2 (-1 to voter)

A maximum of 40 votes can be cast per user per day, however, to reach the maximum you must vote on at least 10 questions. You can earn a maximum of 200 reputation per day. Please note that votes for posts marked “community wiki” do not generate any reputation, while accepted answers and bounty awards are not subject to the daily reputation limit.

The other way to gain reputation is by suggesting edits to existing posts as a new registered user. Each edit will be peer reviewed, and if it is accepted, you will earn +2 reputation. You can only earn a maximum of +1000 total reputation through suggested edits, however.

Amass enough reputation points and Stack Overflow will grant you additional privileges:

15 Vote up
15 Flag for moderator attention
50 Leave comments
100 Edit community wiki posts
125 Vote down (costs 1 rep on answers)
200 Reduced advertising
250 Vote to close, reopen, or migrate your questions
500 Retag questions
1000 Show total up and down vote counts
1500 Create new tags
2000 Edit other people’s posts, vote to approve or reject suggested edits
3000 Vote to close, reopen, or migrate any questions
5000 Vote to approve or reject suggested tag wiki edits
10000 Vote to delete closed questions, access to moderation tools
15000 Protect questions so only registered users with 10 rep on this site can answer
20000 Vote to delete negatively voted answers and stronger question deletion votes

 you can always comment on your questions and answers, and any answers to questions you’ve asked, even with 1 rep.

If you are an experienced Stack Exchange network user with 200 or more reputation on at least one site, you will receive a starting +100reputation bonus to get you past basic new user restrictions. This will happen automatically on all current Stack Exchange sites where you have an account, and on any other Stack Exchange sites at the time you log in.

At the high end of this reputation spectrum there is little difference between users with high reputation and ♦ moderators. That is very much intentional. We don’t run Stack Overflow. The community does.

Development Tools

One of the developers on my team told me the normal development setup goes something like this (usually day 1 at job):

Create a virtualenv, initialize it
Clone repository to that virtualenv
Install dependencies (packages our software depends on)
Install database (Postgres)
Grab a copy of the database from staging or production, load it in
Run development server locally


He also  made a list of development tools for me:

Package Management for OSX
Homebrew (a PMS for OSX) http://mxcl.github.com/homebrew/

Version Control
Git (a distributed version control system) http://git-scm.com/book
Sourcetree (a GUI for Git) http://www.sourcetreeapp.com/
Package Management for Python
pip (a wrapper around some module bundled with setuptools) http://en.wikipedia.org/wiki/Pip_(Python)
PyPI (where pip looks for dependencies) http://en.wikipedia.org/wiki/Python_Package_Index
Other Stuff
 (see this link for how pip and the virtualenv work: http://guide.python-distribute.org/pip.html)
virtualenv (tool for creating isolated Python environments)
virtualenvwrapper (extends virtualenv’s features to make it easier to manage multiple envs)
django (python web framework for perfectionists with deadlines) https://docs.djangoproject.com/en/1.4/
postgreSQL (database)

starting point and programming/ development goals

My starting point:

  • Some knowledge of foundational programming concepts (from one intro to comp sci course and an online coursera course)
  • A dab of HTML/CSS
  • Motivation
  • A team of two remote developers

Programming/Development Goals: