Coding Reflection – Reading and Testing

Reading Reading books about the technologies that you are using is really important. It gives you something that just looking at existing code doesn’t. Over time a code base tends to...

Reading

Technology booksReading books about the technologies that you are using is really important. It gives you something that just looking at existing code doesn’t. Over time a code base tends to train developers into doing things “it’s way” and it takes an external influence to help pull the team into better ways of doing things. My Kindle has been an amazing resource, as I can have all of my technical books with me whenever I am on the train or find myself waiting in line. Then, when I’m working at my computer, I can use the Kindle app to pull up relevant sections that I remember. Searching for something that you know exists in a good technical book can be 50 times faster than looking for it on Google.

One important optimization to this is to spend time reading books about the things that you are doing. And not just “oh, I’m writing rails code, so I should read a Ruby on Rails book”. That’s a great place to start, but if you have a specific thing you will be  working on the next day, read that book. So if I was going to spend my next day writing and fixing tests, I read an RSpec book. If the stuff that I’m working on is mainly plain Ruby code, I read a Ruby book. Playing with Routes tomorrow? read the Routes section of a Rails book.

Testing

Unit testing is unit testing, not integration testing. Don’t confuse them. Tightly coupled unit tests where you create factories for 6 objects and rely on pulling in RSS or JSON from an external service make life hell for everyone. Yes, it’s more work and it seems silly to mock everything out when you’re doing it, but being militant is the only way to keep things clean. It also makes the specs a lot faster, something that makes up for the extra time you spend building a mock object instead of just using FactoryGirl.

The other benefit is that if your proper unit tests are hard to write then that’s a pretty clear code smell. Rewriting the code to make the testing easier can lead to much cleaner, less coupled code. When you have to pay attention to everything that your code interacts with (by mocking out each interaction), you become a lot more sensitive to how much it relies on that other stuff that it really shouldn’t be relying on.

 

 

 

Reflection Reboot

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…...

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.

The nature of success

On the surface, watching this video is incredibly inspirational:   How Bad Do You Want It from Greyskale Multimedia LLC on Vimeo.   However, as I watched it, there was a rush of...

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?

Why I think Google Plus is revolutionary

I wrote the post below on July 2nd 2009. It sat in my Evernote for just under 2 years now, but with Google Plus, Google just did so much of what...

I wrote the post below on July 2nd 2009. It sat in my Evernote for just under 2 years now, but with Google Plus, Google just did so much of what I was talking about that I guess I should share it now. The rough draft that I wrote is below. I’ve put in how Google plus fulfills the pieces below that.

[three_fourth]

//Stuff I wrote in 2009:

Coming up with the perfect Communication system:

These are all the avenues I use to communicate with others:

  • In person
  • Phone
  • Windows Live Messenger
  • Windows Live Messenger (video)
  • Gtalk
  • Skype
  • Email
  • Twitter
  • Blog
  • Facebook Chat
  • Facebook messages
  • Facebook Wall
  • SMS (text messages)

How can we classify these though?

Length:
-Short form: SMS, Twitter, Facebook Wall
Medium form: Email, chat, blog, blog comments
-Long form: Email, Chat applications, Phone, Blog

Fidelity:
-Face-to-face: In Person, Video Chat
-Voice: Phone, Skype
-Text: Email, Blog, Chat, Twitter, Facebook Wall

Urgency
-Urgent: SMS, Phone, Chat applications
-Important, but not urgent: Email, Facebook Messages, direct twitter rmessages, in person
-Neither urgent, nor important: blog, twitter, facebook wall.

Audience
-myself: delicious, notes, google tasks, word documents, reminders
-small audience: SMS, Email, Chat, Twitter direct message, phone in person,
-medium audience: Facebook wall, Twitter
-large audience: Blog

Temporal
-Synchronous
-Replies within short time frames
-Whenever
These are my rules for which apps to use, rules that I kind of instinctively obey because they are the most convenient. They are rules that I break all the time. They probably have differences and similarities to your rules. Why is that? Each of the services that we use has different social connotations to us. I might believe a Facebook message is for important things, but you might think it is just for fluff and never check it.

How to fix it?

Here is my proposal for the workflow of my dream communication device:

  1. Choose who you want to communicate with, person, group, all your friends, open internet (Which is what Facebook’s privacy changes have just done)
  2. Choose the urgency (this should probably be more granular than what I just set up).
  3. Choose the fidelity that you require (text, voice or video).
  4. Choose how synchronous you want it to be.
  5. Specify how long you want the message to be (for text this step could be automatic, just letting you know when you start to cross boundaries).
  6. From the receiving side, you specify how you want messages to come to you from certain people.

Now, the critical part of this system is that the receiver gets to define how they are notified about your intent to communicate. These can be rules based on your location, your status, the time, what your calendar says, who is trying to contact you. even who you are with. So for instance, all urgent messages from your close contacts are pushed to your phone which beeps or vibrates. If it is not urgent, it is sent to your desktop, where a popup can appear every hour detailing how many new non-urgent messages are waiting (this stops the smartphone syndrome of constantly checking email, facebook etc jsut to see if something important has come up).

//End of stuff I wrote in 2009.

[/three_fourth] [one_fourth_last] [framed_box bgColor="undefined" textColor="undefined" rounded="true"] Some random images from my phone… no uploading required!
[/framed_box] [/one_fourth_last]


Now for how Google Plus implements so much of this:

Choosing who:

Circles is 95% of the way there. Between Circles, individual people, people with the link, public, they’ve really made that part super easy.


 Choose the urgency:

Not implemented by Google Plus… here’s hoping they do.

Choose how synchronous you want it to be.

The difference between the chat and the sharing pieces.
 Choose the fidelity that you require (text, voice or video)

All in Google Plus.

Fidelity choices on Google PlusFidelity Choices on Google Plus

Specify how long you want the message to be:

Google Plus just does it automatically. I’m not sure if this one is relevant anymore.
From the receiving side, you specify how you want messages to come to you from certain people:

Google has at least made a start on it

Settings for recieving posts on Google Plus

The big thing is that Google Plus does this all in one space. No message box, chat box and email inbox, no separate places to rebuild your community again and again, just all in one application.

I think that’s kind of awesome.

Ubuntu 10.10 Maverick Meerkat, giving the big boys a run for their money.

I have installed every new release of Ubuntu for the last 8 versions (my first was 7.04 Feisty Fawn). I would use each release for a few weeks, get frustrated with...

I have installed every new release of Ubuntu for the last 8 versions (my first was 7.04 Feisty Fawn). I would use each release for a few weeks, get frustrated with the amount of effort it took, then return to Windows. Every time I could see the potential, but Windows 7 was always just a better operating system on average. I think that has finally changed.

After getting frustrated with Windows 7 taking a ton of time to do anything I installed Ubuntu’s Maverick Meerkat and I haven’t looked back. I think the 6-month release cycle has really paid off in a huge way for Ubuntu. All the little improvements over the versions have come together into something that now competes.

So why is it so good?

Your Personal Learning Environment – Presentation to JumpStart 2010

I just finished presenting a workshop on Personal Learning Environments to around 300 international students for UBC’s JumpStart international orientation. I think it went really well, but for anybody reading this...

I just finished presenting a workshop on Personal Learning Environments to around 300 international students for UBC’s JumpStart international orientation. I think it went really well, but for anybody reading this that went to the lecture, don’t hesitate to comment below on how I could improve.

My story arc was as follows:

In order to create and effective personal learning environment you need to recursively go through the following process:

Are we fighting a war?

I just watched the movie “Idiocracy” as recommended by Brian and Joe. In the words of d’Arcy Norman“damn. that movie was depressing, funny, and awesome”. It tells the story of a distopian future,...

I just watched the movie “Idiocracy” as recommended by Brian and Joe. In the words of d’Arcy Norman“damn. that movie was depressing, funny, and awesome”. It tells the story of a distopian future, where due to the fact that smart people have less children than stupid people, by the year 2500, smart people have died out. Everyone is incredibly stupid. Those left spend their time drinking “Brawndo, The thirst mutilator. It’s got electrolytes!” and watching people get kicked in the balls on television. It’s a future where everyone behaves exactly as Kraft, Walmart, etc want us to behave. It’s a brilliant cautionary tale and I highly recommend watching it.

Idiocracy Poster

Idiocracy poster (via Wikipedia)

Will it happen though?
Is there a possibility that humanity is doomed to get dumber? I think yes. There are many different reasons why this may or may not be so (all of which better suited for a non-wee-hours-of-the-morning post), but I think the largest of those is that in a world of stupid people, the corporations win. Corporations are psychotic entities that would do anything to get us to behave as they want and they have a lot of power (as described in another thought-provoking move, the Corporation). The power is evident everywhere. They are doing their damndest to use all media at their disposal to dumb-down children and make them into perfect buying machines, doing their bidding.

How do we stop it? We fight back in the schools. If education can be revolutionized (and there are many smart people working on it) then we can teach the young how to take back the power from the corporations and to make them do our bidding instead. Eating healthy,  exercising, learning and being compassionate are what smart people do and we need to ensure that despite the corporation’s efforts, everyone is given the tools and motivation to do so.

This is a war, it’s humanity VS. the corporations.We are fighting to see who controls who. If we get real about being flexible and innovative enough to fix education and make it a place where people learn to become smart enough to take back power from our creations.

Kiva – 11 months later.

I joined kiva.org and gave my first loan 11 months ago. 1 Month later (almost a year ago) I wrote a blog post titled “Kiva: The Cheapest way to help poor...

I joined kiva.org and gave my first loan 11 months ago. 1 Month later (almost a year ago) I wrote a blog post titled “Kiva: The Cheapest way to help poor people“. It described how Kiva is a great way to get your feet wet with giving, due to the fact that you loan money as opposed to giving it. It also goes into some depth as to the academic arguments surrounding micro-lending.

So after 11 months how do I feel?

Themes – A personal journey

My site has gone through a lot of them changes over it’s history. Even though one of the bloggers that I admire most (at least before he went off the deep...

My site has gone through a lot of them changes over it’s history. Even though one of the bloggers that I admire most (at least before he went off the deep end) disagrees with theme changes, I feel that creating and changing my themes has allowed me to flesh out my ideas around aesthetics as well as my sense of self and personal style. I started university believing that I had no artistic talent whatsoever and have slowly come to realize that I just never spent any time developing it.  I treat my theme as a personal journey, it showcases my knowledge, ability and feelings at a given point in time and allows me to show everyone in a visual way when those things change by updating my theme.

So although I’ve lost a few of the steps along the way, here is a subset of the themes I’ve hacked along the way…

Learning through a narrative

I just finished reading “The Future of Education – re-imagining our schools from the ground up” by Kieran Egan. It describes the idea of “Imaginative Education” (IE) and gives an example...

I just finished reading “The Future of Education – re-imagining our schools from the ground up” by Kieran Egan. It describes the idea of “Imaginative Education” (IE) and gives an example of a timeline in which this superior form of education could be the norm by 2050. I’m unsure of my opinion about most of IE and will spend a lot more time looking into it before I draw firm conclusion.

The one thing that really struck me about IE was the concentration on narratives. In the book students are given an arbitrary topic when they start school (for example “leaves” or “wind”) and work on a portfolio around that subject for their entire school school career). They are then guided by portfolio mentors to apply everything they learn to this topic. So for instance, when learning about metaphors, they are asked to find metaphors in literature involving leaves. When learning about area, they can find the best way to estimate the area of different kinds of leaves. This way of teaching serves the duel purpose of not only making students an expert in their topic, but also
gives them something tangible to relate their learning in all areas to. It forces them to develop a habit of applying the things they learn.

Now, I haven’t figured out how I feel about the idea of an “arbitrary” topic (I think students should at least have some influence in the choice of their topics). However, at a university level students like myself should have the power to choose their own topic and follow it through. I chose my topic of improving education (both in method and in distribution) a long time ago but can see many points in my education where I have failed to relate my learning back to that. For instance), why was I bored stiff in my databases class when I could have been finding ways to relate it to my passion? Boring as SQL may be, it can be seen as a powerful upgrade to parts of human language due to its exceptional clarity. The questions I should have been asking myself could have been as follows:

Should everyone learn how database queries work simply in order for them to understand the pure logic that it creates?

Is this type of logic necessary?

Does that kind of thinking make innovation more or less likely to happen?

So many questions could be formed from something as boring as SQL queries. I know that the ones above are very surface level, but that is precisely because I was not thinking deeply about this while they were being taught databases in depth. I have this feeling that I would have been able to draw many deep and meaningful connections.

From now on I intend to try my damnedest to relate everything I learn in school to my central topic and in order to test how powerful this way of thinking can be.

Page 1 of 3123