RUBYLOVE  

Free Ruby QA session next week

Join me @ my codementor office hours

cover-pic

link to the office hours page

Do you:

  • have questions about how Ruby works?
  • find yourself using loops?
  • want to know how map, select, reject, or reduce work?
  • have questions on procs, blocks, lamda and yield?
  • find yourself stuck in rspec when you could be using minitest?
  • know how .tap works?
  • want to learn how to avoid NILs
  • want to learn to avoid conditionals?
  • have no idea what metaprogramming is?

Continue reading this article..

Where the hell did Jim go?

Building a sailboat!

cover-pic

I apologize. Without any warning, I allowed my blog to go silent a few months ago. I am an avid sailor and am in the process of rebuilding a 40 year old Westsail 32 from the hull up (after I tore it down to the hull).

I rented a new place with a huge yard for the work and I have been eeking by a meager existence thanks to codementor.io, where I put in enough hours to pay for my obsession and rent.

Continue reading this article..

Passing lispy code as data in Ruby

exploration of Ruby's parentage to discover powerful techniques

cover-pic

You have probably heard that Ruby has multiple parentages.

  • LISP for it’s syntax tree and functional enumerators
  • Smalltalk for it’s object orientation
  • Eiffel for it’s blocks
  • Perl for it’s regular expressions

Ruby has four parents, and it takes Matz’s favorite aspect of that language and blends them together into a hybrid, multi-paradigm, utility language that would do everything he wanted to do, and to say it with less ceremony.

Now Ruby certainly gets more ideas from each of these parents as listed above, but for a moment let’s focus on the most mind-blowing, language specific aspects of at least 3 of them.

In this chapter we will explore the first if them, LISP

Please note - for the experts in these languages

I am attempting to limit scope to what is important to the subject at hand. I am not an expert at these other languages by ANY means. I am a Rubyist with a bit of exposure to a few of these.

LISP is essentially boiled down into this for the Rubyist: you have lists, which can contain not just data, but code (functions), and to do that, sometimes a function can become a piece of data, be added to a list, queried as code again when the time calls for it. All in a lazy manner. Let me try to illustrate this for you in Ruby.

Continue reading this article..

As a new Rubyist what can I do?

what should I do to become a GREAT developer?

cover-pic

I get asked this question a lot from developers I coach. Or I get the question in it’s other form, “So how do you learn to write clean, uncoupled ruby?” Or the other question, the one I tend to hear from people who disagree with me… “Why do you have such strong opinions? How did you choose your opinions?”

The 3rd form of the question I will answer like this. I did not choose my opinions… They chose me. Every single one of them was either me losing an evidence and reason based contest of opinion, and the other was experiencing developer pain but not having the solution. The solution was this list below for the most part.

A path to becoming a great Ruby programmer

Continue reading this article..

Why I can TDD and why DHH Can't

coupling, conditionals, and state are making your life hard

cover-pic

I have been writing Ruby for a long time, and Rails for almost as long. However MOST of my work has been Rails, something that I am VERY grateful to DHH for. His excellent ideas that became Rails changed my life, so:

“Thank you David, you can say what you want and write coupled code and not test first, you will always be a hero of mine for making it possible for me and all my geek friends to play with Ruby every day and make a living doing it!”

At first, I HATED TESTING. I fought it’s adoption arguing the position DHH has returned to, browser testing by humans. I hated it because I sucked at it. But I always have a mentor, and I ended up with one who was a XP’er and an old small talker. That changed my life.

But I was still testing too much, testing the wrong things, mocking too much and in the wrong place. I didn’t apparently REALLY know what a unit test was. I was using RSpec and everything I wrote was highly coupled to Rails and the database.

And these are the reasons why I hated testing and thought it sucked. I had code to write.

Why DHH cant TDD

Coupling is the amount of internal knowledge that “leaks” out of the objects you write. When objects start knowing about each other to the extent that you cannot change one without changing the other, or you can’t swap one out without changing the other. There are many other forms of coupling.

I am not the only who thinks this, and case in point, here is the GREAT Jim Weirich DECOUPLING his logic from Rails, something that DHH would have left alone or put into a concern: Decoupling Rails

Isolation is when your object has NO external dependencies. Isolation is where you want to be. Class A may know that it needs another class, but it doesn’t know it is Class B. If Class C follows the same interface as Class B, then Class A doesn’t care which it gets.

Continue reading this article..

TDD isn't dead because DHH doesn't do it

coupled, stateful, complicated code is ruining your TDD experience

cover-pic

DHH’s original post is here tdd-is-dead

My response: Why I CAN TDD why DHH sucks at it

A better much less ranty post with INFORMATION on how to learn to write amazing Ruby can be found As a new Rubyist What can I do?

There used to be a shitty rant here about being banned from a forum over my heated defense of code craftsmanship, xp, and tdd. It has been deleted because I am a shitty writer and it doesn’t reflect the message I care about, Ruby and Coupling and Demeter and Abstractions, SOLID etc. The kind of shit that I am much better suited speaking about.

What follows is the sliver of what wasn’t shitty, which is shitty. So here it is. You want the original crap? Google it.


I hear the argument time and time again, and I heard it on RR Parley several times. It goes like this:

“My code is awesome without TDDing it. I don’t TDD it because TDDing my code is hard.”

Continue reading this article..

Free Ruby TDD Weekend Workshop

google hangout and tmate.io - sunday 12pm-2pm central time

cover-pic

So I am in the middle of a lot of planning for “Ruby Workshops in the Tropics” this summer, where myself and a few other advanced programmers will be holding sessions to help you write tests, more concise, idiomatic ruby, and more….

It got me thinking I should just do some group pair programming on a weekly schedule. I already do several hours of consulting pair programming via CodeMentor and it has been a lot of fun.

So here we go! This Sunday, the 27th from 12pm to 2pm Central Time I will be holding a Ruby TDD session where I answer your questions and do some live coding for you. To participate in the session, you will need to have the Google Hangout plugin installed in the browser of your choice, and know how to open your terminal and ssh.

Continue reading this article..

Writing Ruby that is Easy to Change

my manifesto for clean, beautiful Ruby

cover-pic

I have been on a journey for some time now. It started when I was a 8 year old kid who decided to take his Dad’s Betamax apart to see how the movies got in there. It continued when I was 10 and I got a Commodore and played tape-drive games like Red Baron. My future was forever set in stone when I arrived at a new Jr. High School @ 13 and they had AppleIIes in my home room, math lab, and computer lab.

I would obsessively play Zork and more than anything, I wanted to know how to write such a game. I didn’t get very far on that front, but I did start writing BASIC. I took anything that resembled a computer class, or even a class which had computers in it. By them we had some clone IBM at home, and there I would POKE sounds out and obsessed with learning more.

I am nearly 40 now. In a couple of years I will not be the young crazy guy I once was. I will be a middle-aged life-long programmer. And honestly, shit ain’t so bad yo. I couldn’t be happier. But enough about me, let’s get to my secret for writing solid ruby code that always gets an A on CodeClimate, and rarely has bugs. My secret for writing Ruby code that is easy to extend and change.

Continue reading this article..