Archive for the ‘Cube Life’ Category

On Object Oriented Designs and Complexity

Tuesday, March 26th, 2019

Code Monkeys

Today, with the update of Xcode 10.2, and Swift 5.0, I had to struggle with the formatting of strings in order to find the pattern they represented. The point is really this: Represent the pattern of the characters in a word so that 'bee' and 'too' and 'see' all look like the same pattern.. This is used in my CryptoQuip solver, and the point is to group words by their patterns because we don't know what the actual characters are, but we do know their patterns - because it's a simple substitution cypher.

So how to do that? Well... when we look at Clojure - which just deals with the string as a sequence of characters - just data, we have:

(defn pattern
  "Function to take a word (as a string) and return a vector that is the
  pattern of that word where the values are the index of the character.
 
    => (pattern \"see\")
      (0 1 1)
    => (pattern \"rabbit\")
      (0 1 2 2 4 5)
  "
  [word]
  (map #(.indexOf word (int %)) word))

and if, for the sake of this post, we drop the comments, we get something very simple:

(defn pattern
  [word]
  (map #(.indexOf word (int %)) word))

if we look at this in Swift, we see:

  extension String {
    /**
     Attributes of a string that return a string that is the pattern of that
     word where the values are the index of the character. This is a simple
     baseline pattern generator for the words so they are comparable.
 
    ```
        => "see".pattern
        "abb"
        => "rabbit".pattern
        "abccef"
    ```
     */
    var pattern: String {
      get {
        let ascii: [Character] = ["a","b","c","d","e","f","g","h","i","j","k",
                                  "l","m","n","o","p","q","r","s","t","u","v",
                                  "w","x","y","z"]
        var ans = ""
        let src = Array(self.utf8)
        for c in src {
          ans.append(ascii[src.firstIndex(of: c)!])
        }
        return ans
      }
    }
  }

And the reason to use a String as opposed to a sequence of numbers in Swift, is that those comparisons are not nearly as nice in Swift as simple String comparisons are. But I look at all this, and while the protocols in Swift are nice - to add methods to existing classes - it's much the same in Ruby, and it can lead to some very tough bugs - and so you have to be very careful using them.

And this got me to thinking about the complexity of most systems and the OOA&D systems I've seen in C++, Java, Ruby, ObjC, Swift - and it really is hard to come up with a really great design if you don't put in a ton of effort on the work. Sure... Boost for C++, and Java classes, are good designs - but they had a lot of backing and time to get right. ObjC - specifically Foundation, is well-done, but again, that was a serious investment by NeXT. But most of the non-OS-level projects... like those in the wild, they are a mess.

I don't think this is an accident. I think good, solid, OOA&D is hard because there are so many times when a method isn't clearly belonging to one object, or another - and the language might not be set up to have stand-alone functions as an alternative - Java, Scala. So they have to go somewhere, and that means that things get tossed into the closest reasonable object - as long as it's "close enough". But then 6 months later, it's a disaster. No one remembers why each method is on these objects... and the circular references require interfaces, and then implementations of those interfaces... and it just gets to be a mess.

What I believe is that the simpler the code, the better. This means more abstract. More critical thinking, and less "let's just hammer this out" work. I'm sure there are folks that can do a good job on an OOA&D project - and it could be massive and complex... but those people are rare - very rare. And in general, you end up with really bad objects that create horrible inclusion requirements, and even worse threading issues - because it all mutable, and you just have systems that can't get larger than a certain size.

That's not good. Math doesn't work that way. Neither should coding.

The Landscape is Changing

Monday, March 11th, 2019

cubeLifeView.gif

This morning I read a tweet that was re-tweeted by a guy I used to work with. The tweet said:

If anyone needed to hear it: I don't care about .dev domains or mechanical keyboards, I don't read Hacker News, I don't have a customized terminal, I don't spend all weekend coding, I sometimes use the Git GUI in my IDE, and I am valid in tech and so are you.

The person that wrote this isn't important - they are right - they are every bit as valid in this industry as anyone else. There isn't a "test" of "worthiness" to get, and keep, a job in this industry. And those that treat someone as less of a person, or less of a value to the organization are just missing the point. Badly.

Not everyone has to want to do these things. That's perfectly fine. Take another industry - doctors, lawyers, professional sports - there are all kinds of doctors that don't read up on the medical journals in their weekends... and plenty of lawyers that don't read briefs to stay up on things... and all kinds of different levels of pro sports.

But we can't then also insist that the very best surgeon work on our loved ones. Or that if we're in trouble, and need a lawyer, that you get the very best one you can get to get out of trouble. Right? And we certainly can't be disappointed in our favorite team for not winning - Right? They are just as valid as anyone else in that industry. Right?

Or is 'valid' the only metric we want to use here? I agree that the old Doc Hollywood story is about what you value - and sure, you're not doing amazing surgery saving lives, but that's not what you value - relationships are. But no one would call a Doc Hollywood to do heart surgery - and when you need a heart surgeon, you don't want to think that Doc Hollywood is your best alternative.

And when you feel you've been wrongly accused - you probably don't want to have to rely on the Public Defender. They are just as valid in the legal profession... and no one should make them feel like "less" of a lawyer because they are in the Public Defender's office... right?

As I read this tweet two things struck me:

  • This person works with some serious jerks - it's clear that this person has been working with, or working around, some major jerks that feel there is some litmus test to be a "good developer" - or even a "real developer". That's just wrong, and you can't change other people's attitudes, so my advice would be to find another job. There are better ones out there.
  • 'Valid' isn't the same thing as 'Value' - no one should be so marginalized that they feel that their fundamental worth is in question - but that's not to say that everyone is equal, either. Skills matter. Experience matters. Value isn't the same thing as validity. I can play basketball... but I have no business playing on the Lakers. And I shouldn't expect to.

I would like to tell this person: "Listen, you're right - you work with jerks - ignore them. Get a job that you like, and do your best." but at the same time, I can't say that this person should also expect to see the same paycheck as those that work 7 days a week. Or those that have devoted decades to their craft. Just recognize that choices matter.

Technology really has become the new workplace where classic blue-collar and white-collar jobs are mixed into the same pot. There's nothing wrong with picking what you want to do, and what's important to you - and you should not be made to feel your choices somehow make you less of a person. But they do have consequences.

An Old Knight – in a Rusted Suit of Armor

Wednesday, March 6th, 2019

Sad State of Affairs

This morning I was chatting with my Boss, and we were talking about the progress that was being made - and I had to admit, that we are starting to at least work together - as opposed to hold meetings where we disagree, but make no decisions, and just table the discussion for the next meeting. This works to simply make no progress, and it can be quite effective. But we're not there, and that's a really solid move in the right direction.

But that is not to say that yesterday wasn't a challenge. I understand how oppressive a job can be where you are not valued, where you are not listened to - I've worked in them. But the flip-side is no better - where every person in the company feels entitled to reject an assignment because they are self-empowered, and the management team does nothing to dissuade them of that opinion.

So I find myself in the position of, once again, patiently explaining requirements for a project to members of a team that simply will not accept it, and so won't be on the implementation team, and we'll simply have to get new folks. These guys can support the legacy stuff - it's all their stuff, and it'll be around for at least a year or so, so they have jobs, and comfortable ones, but they won't be on the new stuff - because they don't believe in it.

And that got me to make the statement:

I feel like an Old Knight - in a Rusted Suit of Armor. Way past his time.

and it struck me that this was a turning point for me. To see that Honor, Integrity, and Commitment are so vital to me, and so completely foreign to them. For example, I may not like what I'm doing, but it's the Job. It's the social contract on employment - I agree to do the job they ask me, and they agree to pay me the promised wage.

That's it.

No arguments.

My choice, and my power is to change jobs. That's perfectly acceptable. I can change jobs as often as I want, and for whatever reasons I wish. That's my choice and power. But if I'm here, and taking the wage, then by golly, if they ask you to do the job then you do it. Period.

This isn't about being hired as a Data Scientist, and being asked to pick up an AK-47 and defend the CEO's mansion from zombies... this is about accepting a job to develop software, and being asked do just that. It's simple.

But clearly, in today's environment, it isn't. Which is why I feel so completely out of time with many of my co-workers. They can't understand me because they don't have the same sense of what's important to me, and while I can understand why they feel entitled (too many Participation Trophies) it doesn't excuse the behavior.

Just like an Old Knight... in a rusted suit of armor.

Ordered a Chrome Duffel

Wednesday, February 20th, 2019

Chrome Bag

This morning I got an email that said that the Spectre Duffle Bag I'd ordered from Chrome Industries had shipped from California, and it should be at my door by the end of the day tomorrow - Thursday. The reason for the bag was that I've been using the same luggage that my delightful ex-wife bought for us - as a family, and while it's OK... it's two huge roller bags, and a cosmetic case, that I've been using for the few trips I have needed something.

But I'm old enough to get my own luggage - in fact, it's arguable that it's about time. So when I knew I had to make a trip to Seattle next week, I looked around and decided now is as good a time as any.

My top picks were Chrome bags - and Away Travel. The former made the messenger bag I use daily, and can't say enough good things about, and the latter is promoted on The Talk Show all the time. I like the hard exterior of the Away bags, but I wasn't sure how much they would hold, and they didn't give a lot of details on the size or what to expect.

Then I started looking at the Chrome bags, and I kinda ran into the same problem - What would it hold? Really not easy to see. So I measured the existing bag, and calculated the cubic inches, and then started comparing. Then I went to the airline carry-on page, and saw that the Chrome bag was exactly the right size to be a carry-on, and that you get one carry-on, and one laptop bag, and that would work great for me!

So I ordered the Chrome bag, and selected two-day shipping, because I wanted to make sure that I got it in time for this trip. And this morning, I found out that it would arrive! Fantastic!

Google Docs has a New Look

Thursday, February 14th, 2019

Google Docs

This morning I noticed that Google Docs had done a little bit of an upgrade to the style, and specifically, that the Note cards on the right side of the docs, were sporting a little more whitespace, and the font wasn't tied into the font on the doc.

I also noticed that the buttons on the Slide decks were colored with yellow - for the presentation tool. OK... sure... who doesn't like primary colors? But it was the whitespace that was a little annoying.

I like to keep things tight on the screen - not a lot of chrome, buttons, etc. And certainly not a ton of whitespace - it just takes up space. But at the same time, it's all about evolving and adapting to those things which you cannot change - and Google is certainly not interested in my style preferences.

Wonder if this is something of a bigger change on the horizon?

The Ice Storm Cometh

Tuesday, February 5th, 2019

Umbrella

This morning a friend at the train station in Naperville mentioned that tonight starting at 6:00 pm there was forecast an Ice Storm that would make evening - and morning - commutes really nasty. So I had to look this up when I got into the office... was it really going to be all that bad? What was the latest news?

When I got in, and had time to look it up, it was sound pretty nasty:

...ICE STORM WARNING IN EFFECT FROM 6 PM THIS EVENING TO 6 AM CST WEDNESDAY... * WHAT...SIGNIFICANT ICING EXPECTED DUE TO FREEZING RAIN. ICE ACCUMULATIONS OF ONE TENTH TO FOUR TENTHS OF AN INCH EXPECTED...

and if that wasn't enough, it went on to reassure us with:

POWER OUTAGES AND TREE DAMAGE ARE POSSIBLE DUE TO THE ICE. TRAVEL COULD BE NEARLY IMPOSSIBLE ON UNTREATED SURFACES. THE HAZARDOUS CONDITIONS MAY IMPACT THE EVENING COMMUTE.

And I just started giggling... We just got out of the Polar Vortex, and now we're going to covered in ice - and rain (to make it nice and slick) overnight, so that most places will be very hard to walk in the morning.

I have time, and knowledge, so we'll see what happens to that forecast as the day wears on. But it doesn't look particularly good for tomorrow morning's walk from the train station. But there's also working at home, or toughing it out... we'll have to see.

Creating a Demo Movie

Thursday, January 17th, 2019

iMovie.jpg

This week has been a Hackathon at The Shop, and I was asked to do one on a cross-domain, secure, component-based Web App Framework based on the work done at PayPal in the kraken.js team. It was a steep learning curve for me and the others on the Hackathon team, as none of us had any real experience with Node.js or React, but we had only this week to get something going.

The good news is that we got everything we needed to get running late yesterday, and today I started work on the Demo presentation which happens tomorrow, but it's videos, each group submitting one video. The only limitation is that the video has to be less than 5 min in length - and that's a hard limit I'm told.

OK... so I was looking at all the screen capture tools on the App Store, and some of them looked pretty decent, but the good one was $250, and while I might go that high - I wanted it to be amazing for $250... like OmniGraffle good. And I saw a lot of really iffy reviews. So that didn't seem like the way to go.

Due to the fact that I needed to be able to add in slides and screen grabs, I knew I needed more than a simple "start recording" that Google Hangouts does, and with nothing really obvious in the App Store or in Google searches... well... I hit up a few of my friends in production of stuff like this. Funny thing... they said "QuickTime Player and iMovie"

This really blew me away... I mean I knew about iMovie, but I didn't know that QuickTime Player did screen recordings - and with a selectable region on the screen. And that it also did auto recordings - again, I'm going to need to be able to do voice-overs on the slides and things happening on the screen in the demo.

So I started recording clips. Keynote was nice in that I could make all the slides there, and export them as JPEG files, and they imported perfectly into iMovie. Then I could put them in the timeline for exactly how long I needed them, and do any transitions I needed to make it look nice.

Then I went into a little phone booth we have at The Shop, and recorded the audio with very little background noise. I could then re-record the audio clips as needed to make it all fit in the 5 min hard limit. In the end, I could export the final movie, and upload it to the Google Drive for the submissions.

Don't get me wrong... there was a steep learning curve for iMovie for about an hour. How to move, select, add things, remove things... not obvious, but with a little searching and experimenting, I got the hang of the essentials. And honestly, that's all I needed to finish this Demo video.

I was totally blown away in the end. I was able to really put something nice together with a minimum of fuss, and now that I have the essentials in-hand, it'll be far easier next time. Just amazingly powerful tools from Apple - all installed on each new Mac. If only more people knew...

When is a Free Lunch not Free?

Tuesday, January 15th, 2019

cow.jpg

I'm supportive of places that provide perks like free lunch, shuttle trips to mass transit, things that can really nickel-and-dime employees, and aren't that horrible, but are nice perks. Just nice. Today at The Shop the lunch was... well... I know several folks that liked it, and thought it was really good. But it was way too cheesy for me.

I've been told that I'd never last in Wisconsin, and I have to agree... I probably would draw more than a few odd looks for my love of milk and ice cream, but not cheese. Just no thanks.

So today's free lunch wasn't free to me. But they did have the Honey Nut Cheerios that I grabbed a fist-flu of to cleanse my palette after the cheese.

We have Created Our Own Monsters

Tuesday, October 16th, 2018

cubeLifeView.gif

I know we all just want to have some sense of satisfaction in our lives. To feel that we matter - somewhere. To feel that we make a difference. It's universal... but so many don't have that because of circumstance or society. But that's another issue. What we, in the US Tech Industry have created is a class of people that feel entitled to things that they have no entitlement to. My sister calls these The Soccer Trophy generation.

If someone is told - at every possible turn - that they are amazing, valued, better than the rest, then their sense of reality is being formed in those moments. If all you allow a person to see is a mirror, reflecting back to them that they are the center of the world, then they have no opportunity to see what reality is like outside those mirrors. It's not surprising then, when these people get angry when the context is changed, and it's time to work together with others of differing opinions, and then all of a sudden, things go very badly.

Over the last five years, I have been working with folks that fit this profile perfectly. They are fine people - at least in comparison to most federal inmates. But they are employees that feel the company owes them a sense of purpose, a job that fulfills them... and they have every intention of getting that. But that's not how the world really works. Sometimes it's just a lot of hard work for very little short-term payoff. Life isn't fair. But telling this to our little monsters usually creates such a stink that it's avoided at all costs.

I'm all for being nice. I'm all for being generous. I think these are fantastic qualities, and I try to be as graceful as I can be. All the time. But some days I just want to say "Someone did you a disservice by making you think the world revolves around you. It doesn't." Now let's have a little moment to deal with that, and let's get back to work!

But that's not done... Go figure.

There are No Guarantees

Tuesday, September 25th, 2018

PHB.gif

Late yesterday, a friend of mine was laid off. It happens, but he was on a new project at a new company... probably hadn't been there three months, and the project was cancelled. He was the only US-based employee for the company, and so that was it. No new project. No other opportunity in the company. Gone.

While a part of me understands this logic - you hire for a project, and if it is cancelled, then you don't need the people you hired for it, and so they can go. This makes perfect sense to me as a business owner. There is no fat. But at the same time, when the company has more than 50, or so, employees, and you find a good one, you have to wonder why they didn't plan for the possibility, and find a place for a good person to do good work?

I'll never know why they didn't, and how close they were to pulling the plug when he hired on, but it seems like the relationship between tech worker and employer is at an all-time low. The workers expect the world from the employer - tons of money, ping-pong, meals, stock, etc. and in return, they seem to want to work 4 hrs/day and be treated like royalty. Employers want to hire who they have to, and then drop them when they don't need them.

I suppose it's only fair, but it's sad at the same time. We're getting more like nature where the strong survive and thrive, and the weak, or unlucky, are eaten. Kinda harsh.