When you’re old and everyone around you is doing or buying something you don’t understand, you think they’re assholes; when you’re young, you do it/buy one, too.

assholes



begin

md = 'The song "777-9311" is by The Time'.match(/"(\d{3}-?\d{4})"/)

md[1] if md

end



'The song "777-9311" is by The Time'.match(/"(\d{3}-?\d{4})"/).andand[1]



'The song "777-9311" is by The Time'[/"(\d{3}-?\d{4})"/,1]



'The song "777-9311" is by The Time'[7]

=> 103

'The song "777-9311" is by The Time'[4..7]

=> "song"

'The song "777-9311" is by The Time'[4,4]

=> "song"

'The song "777-9311" is by The Time'['The Time']

=> "The Time"

'The song "777-9311" is by The Time'['The Tyme']

=> nil

'The song "777-9311" is by The Time'[/"(\d{3}-?\d{4})"/]

=> "\"777-9311\""

'The song "777-9311" is by The Time'[/"(\d{7})"/]

=> nil

'The song "777-9311" is by The Time'[/"(\d{3}-?\d{4})"/,1]

=> "777-9311"

'The song "777-9311" is by The Time'[/"(\d{7})"/,1]

=> nil



post scriptum: An interesting distinction.

This statement is intriguing. I recall Michael Lewis making a similar point in his book The New New Thing: A Silicon Valley Story . Michael pointed out that change was being driven by the young because they didn’t have any sense of self to hang on to.This is crucial. If you think of yourself as a—for example—Lisp Programmer, learning Factor and trying it on a project is not just an intellectual exercise, it’s a shedding of a little of who you think you are. If you have built software—successfully—using large teams with meticulous planning, working with a small team in a less structured setting is again more than an experiment, it’s walking away from part of what you are.When you are young, you don’t have that sense of self to protect. You’re driven by a need to find out who you are, to turn the pages of your biography and see how the story turns out. If people around you are doing something you don’t understand, you assume the problem is your inexperience and you go to work trying to understand it.But when you are old, when you know who you are, everything is different. When people around you are doing something you don’t understand, you have no trouble at all explaining why they aremistaken. Let me give you an real-life example.One of the examples I give for using andand is with regular expression matching. I had a bunch of code that looked like this:And being the type of person who dislikes the proliferation of mutable variables, I rewrote my code to look like this:This week, I received a very tactful email from Cornelius Mika pointing out that Ruby has this use case covered:My first reaction was rather unprintable. I have read the documentation for the String class many times, but for some reason this never stuck. My brain refused to parse the fact that [] means all of the following:Quite obviously, my brain is hanging onto a bunch of stuff about regularity, and discoverability, and languages consisting of a small number of features that interact in powerful ways . I don’t understand why [] means index sometimes but search some others. Why does 'string'[5] return a character, 'string'[2,3] return a substring (but not the same substring as 'string'[2..3]) and 'string'[regexp,1] look kinda sorta like but 'string'[regexp][1] but with maybe Monad semantics thrown in? I am confused, and that is before thinking about the fact that [] also means “call” for lambdas!As you can see I was mightily resisting the idea that sometimes, a useful tool consists of a collection of things you need, put within easy reach. I know that I need the semantics that both my andand example and 'string'[regexp,1] provide, and I simply need to embrace the Ruby way of doing it for a while.Recognizing that we need to let go of ourselves in order to learn and grow is difficult. Part of my job is to bring my experience to the table, to guide and grow the team using the things I have learned. But I also have to accept that there are things I still must learn. And because I am a fully formed person, to make room for a new idea I must be willing to let go of an old one, I must be willing to chuck a piece of myself overboard.How do I know when to hold fast and when to try something new? I don’t. Sometimes when a bunch of people are doing something, and my gut tells me they’re mistaken, I override my gut and try it, I go along with what everybody else is doing.If you want a new idea, you have to silence your inner critic. Your sense of right and wrong, of smart and stupid works by comparing new ideas to what you already know. Your sense of what would be a good fit for you works by comparing new things to who you already are. To learn and grow, you must let go of you, you must be young again, you must accept that you don’t understand and seek to understand rather than explaining why it doesn’t make any sense.