Reflection Reboot

printer

In my last coding reflection post I spoke about how awesome the reflection process was and how much it was becoming a habit. Seeing as that was over 2 months ago… I guess I spoke too soon.

I did do my reflections for a week or so after that, but didn’t post them. The reasons for stopping were two-fold:

1) I was running out of “easy” reflections and had to dig deeper to get there.

2) I started Taekwondo. While Taekwondo is awesome (I’m happier and fitter than I have been in a long time) it means that instead of coding till I can’t anymore, then reflecting for a bit and going home, I now work up until practice starts (my Dojang is a block away from Red Rover HQ making it easy to work until the last possible minute). Practice then clears my head of the code (which is great… it stops the nightmares) but it also clears my head of reflective thoughts on that code.

So noting that in the time that I was reflecting my skill level went through the roof, I need to change the system so that reflection once again becomes easy.

The plan is:
ReBoot Discs

1) Instead of reflecting at the end of the day, I will do it at 5pm every day.

2) Instead of making the expectation: “think of all the things you have learnt today” I’m going to reduce the load to: “think of one thing you’ve learnt” and “create shortcut that you could have taken” (taking a cue from Yan).

3) Posts aren’t going to be numbered anymore, but themed. That way I can make each one more self-contained and coherent, while again reducing the pressure to put in too much.

4) I’m going to keep a page of “rules” that I can edit and update as I learn things, to make it easier to quickly review and scan my most importnat learning in the morning.

Coding Reflections – Week 3

Week 3 of attempting to speed up my learning process through reflection.

On the reflection process:

After 15 days of practice, this is really starting to feel like a habit. I’m starting to see the circles get smaller (the Art of Learning is a great book) in my work and when previously I could only think about things in their macro forms, I am discovering even more subtleties.

One way that I am starting  to make the circles smaller in the reflection process is by forming the habit of reflecting immediately when something happens. I think it has to do with what this article suggests, that  the habit of reflecting on mistakes as they happen can greatly increase the speed at which one learns. So instead of spending a long time at the end of the day thinking back on what I did, I am instead reflecting at the point of the mistake (which for me usually means taking too long to find a bug) and trying to find ways to avoid it in the future.

 

Programming:

Sometimes doing the smallest thing doesn’t mean starting small. Instead of building up to something big piece by piece, it can often be more effective to take a large block of code that currently works (from somewhere else in the code base or the internet) and whittling that down to only the essentials. There is skill required in making sure you got rid of all the non-essentials, but if you’re diligent, it can be really successful.

 
concentrate on differences. When faced with a complex system that works and a simpler one that doesn’t, you can either increase the complexity of the broken system until it works, or decrease the complexity of the working one in order to see what parts are truly necessary for what you need done. An example is that this week I had a component that when given a hash with 10 entries would work, but that wouldn’t work when I fed it my own hash with 3 entries. I then methodically added things to my hash until it was exactly the same as the complex one and the function still didn’t accept it. Finally I went the other way and stripped the 10 item hash down to 3.. and the function still accepted that hash. Now with much less complexity I could look deeper and see that the difference wasn’t in the entries, but in the hash type (the one that worked was a “HashWithIndifferentAccess” instead of a normal Hash)

 

Look for more than one example. When you are working with a large code base and have to do something that is done somewhere else in the application, look hard for other places where things are used. Remember to check more than one place instead of assuming that the code is DRY and it’s all done the same way throughout the application. If you do find that there is more than one way to do something, be sure to use the best way possible and then go back and update the bad example.

Kitteh used Scratch!!  Its super effective

 

Write things down. The tactic of writing out all the possible causes has been proving really effective. Like super effective! I’m constantly amazed at how well it helps me spot the areas where I should be focusing on. Tracing out the actual flow of a piece of code across functions and source files is way better out in the open than in your head, your mind makes false leaps and assumptions that the cold hard light of a whiteboard marker uncovers easily.

 

Code in flow state more often. I’ve spent a lot of time building my trigger… now I just need use it more often.

 

 

 

 

Coding Reflections – Part 2

Continuing with my attempt to increase the speed at which I master the craft of programming, here is my second week of reflection.

One part of the reflection process that I noted was that reminding yourself of the previous reflections is crucial. Toward the end of the week I found that rereading me reflections from earlier really helped me to not repeat those previous mistakes.

Week 2:

Always make the minimal amount of changes to go from working to not working. Yes, I know i started with this one last week, but it bears repeating. This week I did a lot of building new things and again found myself being slowed down by making too many changes and then having to figure out which one of those changes didn’t work as they were supposed to. Starting with the simplest thing takes discipline. I’m not sure why that is, but our brains seem to want to see big effects and use those to trip us up. In order to practice the simplest thing we need to be continually vigilant.

Pay careful attention to any error trace. Often the answer is buried deeply and even though after making changes it may look like the trace is the same as before, there could be changes in where the error came from a few lines down from the top of the trace.

Write bad code. One problem that I’ve been having (probably magnified by the fact that I’m working  in Ruby on Rails) is that everything I read really concentrates on writing and architecting really good code. The problem with that is that it is really hard to know what the best code is as you go along. As you code you get paralyzed by the different design choices. You then spend hours trying to make what you think may be good design work, only to throw it away because the direction of the code means that another design pattern actually makes more sense. Instead, if you write crappy code that just gets the feature complete as quickly as possible, you end up with a complete feature and time left over to refactor (of course this only works if you’ve written tests to ensure that everything stays working after the refactoring is finished). I think it’s a lot easier to see where to fix bad code than it is to ponder over what the best code is to write. Of course, a big part of this strategy is the commitment to go back and actually do the refactoring. Code review helps a lot as sheer embarrassment can be a great motivator for going back and making sure your code looks good!

Danbo conoce a Domo - Danbo meets Domo

 Follow the Law of Demeter. There are many complex aspects to this law, but the heuristic that I’ve been using is thinking about it as “don’t take your toys apart”. If your context has a class, then you can call any of it’s methods or attributes, but you cannot “break the toy apart” and call methods of that toy’s attributes. This article does a good job of explaining why breaking the Law would seem silly in a real world context. When you buy something, when the cashier asks you to pay, they don’t “break you apart” by grabbing your wallet (your attribute) and taking the money straight out. Instead, they ask you for the money and you give it to them. They don’t even have to know about your wallet, maybe you don’t have one and just shove your money into your pockets, that would make a waiter trained to take money from wallets very confused and would be a very awkward end to the evening. Throughout the week I found that code following the law was super easy to debug and refactor, code that didn’t wasn’t, with fun little errors popping up like “you called x on nil”.

 

Coding Reflections – Week 1

Working full time as a developer again, I’m trying to apply my years of thinking about learning to my programming. Learning in school is one thing, it’s supposed to be the point of school after all. Learning at school became even easier for me once I reached the all important “learning matters far more than grades” conclusion. Learning while working full time is very different though. You have to explicitly decide to learn, to take extra steps to learn, otherwise learning stagnates and you find yourself stuck at the same skill level for years. I’m determined to not let that happen, so will be making every effort to keep up the pace of my learning.

Of course, there are many ways to practice “continuous learning”, but the one that I’m going to be attempting is just reflection. Sure, learning “the hard way” and other techniques may be more effective in the short run, but using them while at the same time producing as much good work as possible is hard. Using reflection as a tool for learning has the benefit of not taking time away from other important tasks and is arguably a more sustainable learning habit to create.

So the learning plan is as follows:

Every day after work, I reflect on what happened. Where did I make mistakes, where was I brilliant? what did I learn?

At the end of every week I can review the learning and summarize it. I will try and post these summaries here every week. Some of it will be new learning, some of it will be things I’ve forgotten some will be things I didn’t do because of lack of sleep and some will be pure guesses as to what will help make things better. I will break things into sections, general programming  and language specific learning.

Week 1

General Programming:

Much of this week was spent refactoring old code, in order to make a new set of features easier to implement. The process took me much longer than it should have. Here are some ways that I think can make the process of refactoring less painful.

Always make the minimal amount of changes to go from working to not working. My method was to first change the main attributes to be named correctly, then to watch for where things broke when they called for those attributes. Terrible idea.

The last thing that one should do is rename badly named variables and attributes. The first thing to do should be to DRY up the code as much as possible, only after everything is working and the code is as elegant as possible, should you worry about renaming old bad names. a “rename_column” migration is a hell of a lot cheaper than hunting through bad code for all references to a badly named variable/attribute.

On the subject of renaming attributes never use “find and replace all”. Check each instance of something that gets replaced. If there are too many of them, then it means that you haven’t done the DRY work that you should have first. If you do use “find and replace all” then every bug that you encounter for the next hour should have you thinking… “could this have been because of that find and replace all that I shouldn’t have done?”

Basic debugging:

Resist the temptation to just mindlessly trace variables when there is a problem. After the first or second tweak to try and make things work, stop and take a breath. Start enumerating the things that could be wrong. Don’t trust your brain to hold all of these elements, write the various causes for the error down (yesterday I stuck a large strip of dry-erase roll on my des to help with this). Doing it without looking at the code too much helps as well, it gets you thinking more abstractly and actually allows you to put those years of listening to Computer Science lectures to use. Think of all the different ways that you can actually test to see which one of these causes it is. Once you have a list, rank them by probability and work from there. As Steve Wolfman told me on my very first CS lecture at UBC, “Computer Science is the science of clear thought”. Writing things down is the easiest way to make your thoughts clear.

 Ruby on Rails:

use validates_presence_of to ensure that variables that you need are there. Make sure you actually need those variables.

The before_validation callback can be really useful to consolidate and double-check that everything your model needs is there.

Spend every effort as a team to make the specs fast. Every extra second that a test takes, gets multiplied by the number of developers running tests by the number of times it’s run over it’s lifetime. Those extra seconds can easily add up to hours on a big complex project. Slow specs lead to less testing which leads to broken code.

Single table inheritance in Rails is easy. It can be done simply by making a class a subclass or another ActiveRecord::Base class. The caveat is that that superclass’s table needs to have the “type” attribute, in which Rails will automatically store the type of the subclasses.

When converting a non-ActiveRecord model to an ActiveRecord model pay careful attention to methods that may be overriding ActiveRecord methods. Deal with those first.

Rails AntiPatterns is a really good book. I’ve been trying to force myself to read and watch as much as possible on programming in Rails and this book has been by far the most engaging!

Learn to build a sexy website!

Learn to code

I am going to be co-teaching a course soon, titled “Learn to build a sexy website” with Andrei Pop. It’s going to be offered online, on Matygo and it’s going to be kick-ass.

 

So why am I teaching a course despite the hecticness of my imminent move to New York

  • Matygo is an awesome company run by awesome people. I think that their model is definitely going to be step in the right direction for education and I want to be a part of that.
  • Programming is not a mystical force, it’s just a skill that can be learnt and the world will be better off if more people understood it.
  • I’m tired of making websites for people who are smart enough to make them for themselves :P.
  • I spend so much time mouthing off about better ways of teaching and learning that it really is time I put my money where my mouth is and do some teaching myself.

 

The next question I guess is what is this going to look like?

The course will run for 6 weeks. It will be taught in Matygo, which has some elements of an LMS (without many of the downsides). It will be limited to 9 participants, as the live, interactive parts will happen on Google Hangouts.

Hangouts will happen at  7:30 to 9:00 PM on Tuesday evenings starting on October 27th.

 

After the 6 weeks, if you complete all the course material that you will be able to build a great website in WordPress and have a deeper understand of how the internet works and be able to write and hack basic programs.

 

So if you want to learn to code (and hang out with me online over the next 6 weeks) go check out the course page!

The nature of success

On the surface, watching this video is incredibly inspirational:

However, as I watched it, there was a rush of conflicting thoughts and feelings. One part of me was saying, yes he is right, Andre, you need to be better. Work harder, cut out more distractions, become great. The other part was asking, is that really the way? Will I accomplish my goals in life through single-minded perseverance, or is it in the moments of relaxation, in the serendipitous conversations and in allowing the heart and mind to wonder to where it wants to go that will get me there?

Or, is it simply the right balance of both?

Goodbye Vancouver, Hello New York

I’ve been in Vancouver for just over 5 years now. I came to this city and to the University of British Columbia as a result of the promise of beautiful surroundings and an interdisciplinary learning environment. On both counts, this city and UBC have more than exceeded my expectations.

The formal instruction that I received at UBC helped to provide me with many of the technical skills and the conceptual knowledge that I will need to be successful in the future. My work for UBC, with the Office of Student Development, Department of Computer Science, Center for Teaching, Learning and Technology and the Library has taught me the value of continuous learning and has  allowed me to develop my passion for education.

Now however, in the spirit of continuous learning I will be moving to New York City to work with Red Rover, helping them to build out their engagement platform. I will be learning how to write code at the highest standards by working alongside some of the top developers in New York City. I will also be learning about what it takes to have a company be successful.

Most importantly though, if we as a company get things right, I will have the opportunity to create software that have an actual impact of the learning and engagement of hundreds of thousands of people.

Goodbye Vancouver, I’m off to continue my learning. Hello New York, I’m coming soon, get ready.

 

LEARN on Vimeo on Vimeo

via LEARN on Vimeo.

Guest post: The War Against Edu-Industry

a fence

A while ago I wrote a post titled “are we fighting a war” in which I argued that humans being dumber benefited corporations and thus they would fight to make it so. The only way I saw of beating that was to fight back through better education.  Lindsey Wright sent me a great response detailing how the fight may be lost as the corporations are taking over our places of education.

A little bit about Lindsey:

Lindsey Wright is fascinated with the potential of emerging educational technologies, particularly the online school, to transform the landscape of learning. She writes about web-based learning, electronic and mobile learning, and the possible future of education.

 

Take it away Lindsey:

 

Education is constantly in the news. Whether it’s spending cuts, cheating scandals, or abysmal standardized test results, it seems that the only news about education is how it’s failing students. However, beneath the headlines there is a truth — one perhaps even more disturbing than poor math scores and falling literacy rates — and it’s one that school districts, governments, and corporations don’t want to acknowledge. While educators work every day to teach their students, they’re battling a system that is, at its heart, a business. A big business for that matter. According to the Encyclopedia of American Education, the for-profit education industry is a $100-billion-a-year behemoth, and with so much money riding on students’ narrow shoulders, it’s hardly a wonder the industry will do anything in its power to hold school districts in its thrall. However, the questions people should be asking are where is this money spent, how does it affect education, and what is the lasting affect of inviting corporations into the classroom on students?

 

Where’s the $100 Billion Going?

 

The Encyclopedia of American Education cites four specific divisions in the for-profit education industry. The first, which accounts for nearly 40 percent of the industry’s profits, is educational services. This category encompasses corporate training programs (the seminars educators must attend in order to gain or maintain their certifications), tutoring (generally in the form of after-school tutoring at a for-profit institution), language instructions (including English as a second language materials and reading programs for weak readers), and test preparation (the standardized tests that are re-written every year to reflect the constantly changing district, state, and national curriculum goals).

 

Next on the docket with 33 percent of the for-profit education pie are for-profit, proprietary schools. These include daycare; private pre-primary, primary, and secondary schools; and for-profit colleges like the University of Phoenix. However, this segment also includes education management organizations (EMOs). As highlighted by the National Education Policy Center, there are currently 50 for-profit EMOs operating in the U.S. Their operation method is simple. In exchange for a fee, they manage under-performing schools as charter schools, all the while claiming they bring corporate reforms and market-based solutions to education.

 

Twelve percent of the money the for-profit education industry makes is dedicated to the production and sale of learning products. This includes textbooks, educational software, and school supplies. Each time a curriculum changes, new textbooks must be purchased. Similarly, each time a new remedial reading or math program is introduced, new learning software must be bought.

 

Finally, 11 percent is dedicated to electronic services. This includes outsourcing of cloud software (such as Schoolnotes.com), internet education portals (like LexisNexis) and, of course, the ubiquitous online school. It should be noted that, true to the driving push to integrate technology into the classroom, electronic services is the fastest-growing segment of the for-profit education industry.

 

How Does the Industry Affect Students?

 

Unsurprisingly, the for-profit education industry affects nearly every aspect of students’ learning experience, from how they learn to take tests as well as what they are taught, right down to textbooks they are allowed to read. Textbooks are tailored to individual state curricula. Those curricula, generally, are decided upon by the state’s board of education, an elected body that does not necessarily have any educational experience. In fact, in 2010 the New York Times ran an article highlighting just what goes into establishing a curriculum and selecting textbooks. In Texas, 100 amendments were passed to the state’s 120-page curriculum standards affecting history, economics, and sociology courses. The amendments followed along party lines and included:

 

• Changing textbooks to reflect more of the positive contributions of Republicans.

• Eliminating the use of the word “capitalism” in economic textbooks and replacing it with “free-enterprise system” to avoid the negative connotations of capitalism.

• Altering the history of McCarthyism to include the release of the Venona papers (a supposed excuse for McCarthy’s hunt for communist infiltrators that destroyed many lives).

• Cutting Thomas Jefferson’s name from a list of those whose writings inspired revolutions in the 18th and 19th centuries.

 

What these changes reveal, along with the amendments the board refused to adopt (such as acknowledging the contributions of Hispanics in Texas history and the secular roots of the American Revolution), is that the state of the American classroom is a political minefield. Students are subject to the machinations and agendas of political leaders who ignore what’s best for education — in this case, accuracy — for the sake of furthering a political cause and creating a new generation of voters and consumers.

 

EMOs and standardized tests are another way corporations and politics are infiltrating the classroom. In Duval County in Jacksonville, Florida, four schools that had been dubbed “struggling” by the standardized testing of the Florida Comprehensive Assessment Test (FCAT), has resulted in a state mandate that they be turned over to an EMO. Yes, a state mandate. According to the article “Duval School Board Delays Vote on ‘Intervene’ Schools” by Topher Sanders appearing in The Florida Times-Union, should the schools, which have been listed as “D” or “F” schools by the state consistently, fail to show adequate gains on private-company funded standardized tests this year they will be turned over to an EMO. Thus far, it doesn’t look good for the schools.

 

Advocates of educational excellence point out that, if these schools are struggling, something needs to change. Yet the truth is the schools are only struggling when measured by one specific standardized test put forth by a company with a vested interest in ensuring that the state continues to purchase from it. As highlighted in the article “Test Problems: Seven Reasons Why Standardized Tests Are Not Working” by David Miller Sadker, Ph.D., and Karen R. Zittleman, Ph.D., the issues related to standardized testing are myriad.

 

For instance, at-risk students in ill-funded schools are called upon to demonstrate the same capacity as a student from a well-funded school with a strong socioeconomic background — something that is often not possible. Different learning opportunities are one reason. Another? In Ohio, for instance, 80 percent of students from families with incomes of over $30,000 passed the state’s exams, while only 20 percent of those from families with incomes of under $20,000 passed them. Why? It’s a combination of factors such as educational opportunity and emphasis on education, but it’s also linked to the fact that students from households with low incomes are not targeted consumers. Standardized tests are biased against them.

 

Another issue related to standardized testing is that higher test scores don’t actually mean more learning. Rather, higher test scores are related to teaching students how to take the test. Students are taught that test-makers rarely will write three questions with the same multiple choice answer bubble in a row. Additionally, they’re taught how to read the question and eliminate the incorrect responses. Yet they’re not taught how to think critically, decipher information, or develop independent thought processes. Instead students learn to spit out the information the test-maker says they should, to the detriment of their worldview. In fact, standardized testing has actually cut the breadth of school curriculum. Teachers spend so much time teaching to the test that the students do not gain the broad knowledge base they should be equipped with before they enter the real world.

 

Currently, the educational system is beholden to entities that view it as just another way to earn a profit. Students are no longer individuals, but consumers to be generated. As a result they end up  lacking the independent thought and critical thinking skills necessary to decipher positive messages from the negative, strong arguments from their weak counterparts, and consumer-based advertising claims from legitimate studies. It is not the students’ fault. It is that of the system, a system which celebrates mediocrity and doesn’t allow teachers to teach or learners to learn. Instead, the system is designed to indoctrinate students with a particular worldview, the ultimate goal being to turn them into consumers who will continue to fund the corporate machine that made their education, such as it was, possible.

Creating the pull factor needed for a successful social network

TechCrunch just put out an article by Alex Rampell titled “the power of pull”. In the article Alex makes the case that really valuable web applications pull you unconsciously toward them. You don’t have to remember to check them, when you sit down in front of a browser and start typing, those are the URLs that come out.

What creates the pull is a problem that I’ve pondered over for a long time. When BuddyPress functionality was being added to UBC Blogs I knew that it would fail to pull students in, but am still not able to articulate exactly why. It may have had to do with the “silent launch”, but I think the biggest problem was the lack of some key features, those features that provide the pull. Now that Google+ has launched (and I’m really enjoying using it), I’m wondering if it will be able to make the dent that will pull all of the people that I want to interact with into it.

Here are the factors that Alex listed in his article.

Alex’s Factors:

In the article he lists 4 ways to create pull:

  • Plan around events: People will be going to events, so build something that makes them check in with you first before those events.
  • Do something that has an offline analogy: Before Google, people would use phonebooks.
  • Answer Recurring questions: Questions like “where am I going” (Google Maps) and how much did I spend (Mint) answer some of life’s recurring questions.
  • Build brand and familiarity: People shop at Amazon.com because not only do they know it’s big enough to be trusted, it offers a familiar interface.

While I agree mostly with his list, it got me thinking about the sites that pull me and what it is about those sites that create the pull. I came up with my own list.

Here is my list:

Make not visiting your site something that will cause social harm: 

I check my Gmail and Facebook often because people may have left me messages and if I don’t respond to them I will disappoint or anger them. I will respond to Doodle’s for the same reason. Humans love to be liked, so if by not going to the web service a person will be liked less, they will go to it.

Provide Curated entertainment:

I get pulled to YouTube and TED.com whenever I want to watch an interesting videos, I get pulled to GrooveShark when I want music that everyone in the room will and I get pulled to Flixter and Apple Trailers whenever I want to see what movies are coming out. Although making a service that relies purely on content only works for a lucky few, any successful service needs to have something interesting to show their visitors.

Provide more than one engaging activity:

This is a piece that I have taken from my game design research. All popular recurring networks need more than one pull. This not only provides multiple incentives for any given individual, but also ensures that it provides incentives for a wider segment of the population. Facebook is an obvious example, but so is an LMS like Blackboard. There are discussion boards, course content and grades to check. One’s own blog dashboard is another, there are posts to write, stats to check and comments to moderate. I understand the problems of features creep and the danger of adding “just one more pull”, but I think there definitely is threshold of the number of pulls that one needs and the application should cross that threshold.

Create something that easily fits into a daily workflow:

Facebook’s big statistic is that 50% of its users check in once a day. An essential social app has to have something new to come back to daily. If you can somehow embed a utility in your app (Google Calendar, Dropbox, Basecamp are all examples of this) then users have to come back into your application. One needs to find a way to be on a user’s mind after they have left your application.

[divider_padding]

Sure, this list mixes up traditional applications with social networking applications, but I think that is a useful exercise. Just having profiles that others can view is not enough (witness Google Profiles before Google+), I truly believe that there have to be some other pulls. As to what those pulls should be… well that’s the hard part.

[note title=”Bonus Thought: Does Google+ have enough pulls?” align=”center” width=”716″] My hunch is yes. It certainly provides utility with the chat, hangout and photos features. If you add the sharing it had quite a few pulls. The notification icons on top of any Google product also make the daily workflow piece super simple. The sharing and sparks (with a bit of improvement) will lend that curated content. [/note]