Web, Windows, and Mac: A Story

Like many developers who prefer Mac to PC, I find myself in a position at a place where .NET is king, so having a VM is a part of every day life. That is all well and good, but switching between the two is a huge pain in the behind, especially since I am front to middle web, and my job can be done in either environment.

Enter Visual Studio Code.

This is a new code editor from Microsoft that you can use on Mac, Windows, or Linux. I was stoked to see that there was a version of VS for a system other than Windows. I installed it as soon as I discovered it.

Problem: it’s VS Super-Lite.

This is a little disappointing, because I am looking to be able to ditch the VM and save the company a little money on licensing. Plus, then I could say that I’m Windows OS free at work and at home.

This is what I discovered during set up of VS Code.

1. Code is really a very beautiful code editor, but that’s all that it is, really. I still prefer Sublime Text 3

2. It has some git controls built in, but to get the repos and my computer talking to each other, I had to use command line and set up each repo individually. This includes committing and pushing, it didn’t handle the authentication for pushing at all. Not a huge deal, but it was disappointing. This was compounded by #3.

3. The biggest disappointment was not having it be immediately clear where I could sign in with my MSDN credentials to get access to the company’s VS Team Services. I still can’t find it. My work around was using the command line in #2.

I can 100% see why Microsoft doesn’t want to have Visual Studio on Mac. I do, it makes sense to try and force people into the Windows funnel, more money, keep people in the ecosystem, etc. But, there are people like me who are never going to ditch Mac. I mean, it’s the OS where I first learned development, I’m more comfortable in Mac, and I just prefer Macs to PCs, in general, but this post isn’t about that. Plus, infinitely prefer Office Suite for Mac over the Windows version. So much so that I actually bought it and uninstalled Open Office.

On the other hand, I think Microsoft is missing a huge chunk of money they could have if they had a purchasable, fully functional Visual Studio for Mac use. “But DLLs and stuff!” I know, just let me have this one. Microsoft has a ton of brilliant people working for them, if anyone can figure it out, they can. Because now, with everything I discovered on Thursday/Friday while I futzed with VS Code, is that I did everything in iTerm, their team services website, and I can continue to use Sublime Text 3 to develop. I don’t even really need to have Code installed.

OSS: Ooooh, Shiny! Syndrome

Tech moves fast. Super hella fast. The best analogy I’ve heard was in a meeting recently, tech years are similar to dog years.

In a nutshell, if you haven’t noticed, a new technology is released and BAM they are already announcing the next major version, which probably broke half the things that you wrote in the previous version. This is especially true right now with Angular 2 being such a huge shift from Angular 1.x.

It’s great for innovation, but it also gives us a greater inclination to get “ooooooh shiny!” Syndrome (OSS).

This is good and bad. Good, because it encourages us to try new things, be adventurous. But it can go horribly wrong and cost businesses money. OSS is the rose colored glasses in a new relationship. It hides the minor, and depending on the severity of the OSS, major pitfalls of whatever language, software, tool, etc being evaluated. We are in the process of picking a new Content Management System (CMS) at work (more on that later) which is an interesting exercise in OSS.

The trick is recognizing you have OSS, and allowing yourself to see through the shiny to the iron underneath.

How do you know you have OSS?

Next time you’re evaluating (what will be known from now on as) The Shiny, notice how you’re feeling. Do you feel all bubbly inside as you watch the demo/read the spec/whatever? Like you want to play with it RIGHT NAO? That’s great, it’s a good feeling, and that’s a well done presentation of The Shiny.

What do you do now that you know you have OSS?
  1. Stop. Back away from the email you’re writing to All-Dev-Staff to proselytize about The Shiny.
  2. Take a day – at the very least – to read into more of the nitty gritty about The Shiny. Talk to other people on your team. Especially someone who may have a tendency to be more pessimistic than you are about new tools (it shouldn’t be hard, there are a lot of people who don’t like change) to ask them to take a look and talk the pros/cons of The Shiny.

If you both (or all are) still feeling rosy about The Shiny, congratulations! You probably have a baller Shiny to work with.

How do you prevent OSS?

Well, you really can’t. It’s human nature to get excited about sweet, sweet Shinies. They’re pretty! They fix all our problems! THIS IS THE BEST SHINY EVAR!

But you can take some steps to help prevent OSS blowing up a project and pitting your teams against each other Hunger Games-style.

  1. Have a well thought out project roadmap. Know your start date, end date, and major milestone dates in between. Thinking about how much time you have can really help take some of the shine off. (See what I did there?)
  2. Have your criteria for The Shiny laid out before you start looking at those beautiful shinies. That way you can easily see that “Hell YES this Shiny is awesome, but it doesn’t do half the things we require.”
What do you do if someone else has OSS?

Kindly point out the pitfalls and issues you see from the steps immediately preceding this section. Help them see it in a nice way. Because, if you’re a dick about it? They will probably double down on The Shiny, then you end up in the Arena.

Like this. You don’t want to end up on the business end of an arrow.

 

Your final step, and this is really, very, very important:

Prepare yourself for the come down.

It’s a bitch. It feels like the air being let out of the balloon.

Things that combat Coming Down from OSS (CDFOSS)

  1. Coffee.
  2. Chocolate.
  3. Something that is actually shiny that you can play with.
  4. A big snuggly blanket. Swaddle yourself right up in that!

Have you suffered from OSS before? How do you talk yourself down? How do you talk others down?

Ok. Ok. Breathe. I’m ok.

It’s true, I finally carved out time to write a script for Trello!

With my recent change of jobs, I finally had the energy and interest to write the script I’ve tweeted/written about in my previous Trello posts.

This script handles creating my weekly to do list card with seven checklists (one for each day of the week), my monthly sanity check of what bills I have to pay, and an annual card with a general grouping of things I need to remember to do at the end of each year.

The weekly and monthly checklists are created two weeks and one month ahead, respectively. This allows me to add things to the weekly checklists that are one offs, and check things off of the bills card as they auto-charge to my credit card. I am in a big push right now to be debt free by 30, so I’ve become rather obsessive about where every penny goes, this helps me feel better about that.

A couple of things about the creation of this script. First, it wasn’t a high pressure script, so even though I wrote the script a week ago, I didn’t really try to debug in any serious manner until yesterday. I just threw it up on the server and let the cron job run and send me the errors when it ran at midnight every night.

Second, it’s been ages since I wrote any php, but that’s the server scripting language I am most comfortable with. I’ve been working on several school projects in python, so the context switch came back to bite me more than once. Forgotten semi-colons, curly braces, you name it.

Plus, the Trello API is pretty insistent that it’s ‘idList’ when you’re creating a card array, not ‘idlist’. Crazy to have to follow directions, I know.

$card_data = array(
    'name' => ('To Do for Week of: ' . date('j F Y', strtotime('+2 weeks'))),
    'idList' => '<redacted>',
    'labels' => 'yellow',
    'pos' => 'top'
);

Another hitch I ran into was that I am dumping getdate() into a variable, and had used numeric index instead of key value pairs to access the array.

$date_array = getdate();

//is it Sunday, first of the month, or 1 December?
if ($date_array['wday'] === 0 || $date_array['mday'] === 1 || ($date_array['mon'] === 12 && $date_array['mday'] === 1))
{...

This caused the date evaluations I was using to determine whether it was Sunday, the first of the month, or December 1 to pass no matter what. My conditionals failed to gate anything, because $date_array[4] == 0 always evaluated to true because it was coming back as NULL, which can equal 0. So, it passed and then it failed on the fact that ‘l’ should have been ‘L’ in idList. Isn’t coding fun!?

"Invalid idlist value"

I would be remiss if I didn’t mention Clark Rasmussen here. He saw the bugs I missed in a few places, and also allowed me to use his Trello API script that gets the idList numbers for your columns, as well as his script that handles creating connections to the Trello API, so that was a load off my plate and allowed me to focus on creating the functionality I wanted. You can read more about his adventures with the Trello API here.

He also pointed me towards the date() function in php that replaced about 50-60 lines of logic to just get the date for the card’s title in my weekly card and the due date on my monthly card. Yay for learning!

'due' => date('Y-m-01 12:00 PM', strtotime('+1 month'))

Now that I have properly debugged this script and it works, I have able to ditch my “Perma Cards” column, and since I figured out how to ditch the “food to try” column, I now have only 10 columns instead of 12. In addition, I weekly have my to do list created for me.

weekly

As well as my monthly bills card.

monthly

And my annual clean up/to do list.

annual

All of which get placed at the top of the correct column with my ‘up next’ yellow label. It’s such a little time and space saver, but I am super glad to have finally written something I’ve been thinking about for months.

My next steps are going to be add my grocery list (because, yes, I am that lazy. Most programmers have little hacky scripts that automate the smallest things.) look at making it so that the script looks at which labels are where so that it can drop the cards directly under my green ‘in progress’ label cards, and I’m going to take a look at the Google Calendar API so that if I have one off things like my therapy, doctor, or other appointments that they will be added to my to do list card automatically.

Names of labels in listed cards is done via Chrome Extension, CSS Stylebot.