Experimenting with Paid for Ads for Web Traffic

Experimenting with Paid for Ads for Web Traffic

Why Did I Consider Paid for Ads?

I wrote a post about focusing on some of my strengths in order to minimize risk in new areas, and part of that meant focusing on increasing brand awareness for DevLeader as a proving ground. The idea of driving more web traffic to my blog via ads came up because I was interested in experimenting with Instagram ads for my show car branding, but not knowing anything about paid for ads made taking that first step feel pretty risky.

What should I expect for paying for ads? What will $1 get me? What will $10 get me? I have no idea where to start with this kind of thing, so I felt it was important to use my more solid brand, DevLeader, as the basis for this experiment. If I can watch what happens with traffic to this blog by playing with ads, then I can apply that learning to my vehicle brand.

Free Credit For Ads!

One thing that I found when playing with some of my SEO tools is that many paid-for ad services will actually give you a coupon or some sort of matching credit for using their ad service. What does that mean? Well, like almost everything in life… if it sounds too good to be true, it probably is. The coupons or credits don’t mean that you get to pay nothing for your ads, but it’s still a cool opportunity. Generally, these services will say “If you spend X dollars with our ad service, we’ll give you a credit to worth Y dollars that you can use for your NEXT set of ads”.

Make sense? They want to cover your NEXT purchase you make with them to get you on board with them. So it’s not a free experiment to try this out, but it means that if you’re going to drop $100 into it, that $100 might technically stretch out to be valued at $200 if you were to get a $100 coupon from one of these services.

Just something to think about! If you’re serious about looking into advertising and you’re willing to make the initial investment, it seems like a great opportunity.

Google AdWords

The obvious choice for me to start with was Google AdWords because all of my accounts are linked up in someway through Google at various points, and I use a lot of their tooling. The setup was very simple, but you’ll need to remember to have your credit card on hand. Like I said, nothing is free. You can stop your ads at any time though, so you don’t need to be paranoid about accidentally spending $500 on an ad. I mean, I think it would be difficult to have that happen and I’m a total newbie.

Google AdWords guides you through setting up your first ads pretty well, especially for someone that’s never done this before. When it comes time to pick keywords and bidding strategies… I sort of just guessed. It’s an experiment, right? They offer tools to measure your metrics, so you can try changing keywords to see how the effectiveness changes. I started by creating a search campaign that would maximize clicks. I set my spending limit to $3/day. Picked some popular keywords for my blog, like programming, C#, and Unity. And… now I wait to see what happens! I hope to follow up on all of this experimentation to share my learnings in this area so that anyone else on the fence can learn from my experiences.

For free credits, Google AdWords claims to match up to $150 of your first months spending, so I think I’m going to try shooting for that. I’ll start off at spending $3/day and see if I can experiment with a few different options for ads. By the end of the first month, I hope to use all $150 of my initial investment so that I’ll have $150 from Google to play with in the upcoming months!

Bing Ads

Bing Ads was a cool option to explore after setting up Google AdWords, so I suggest if you’re going to try both of these that you do Google AdWords first. Once I created my account for Bing, I was actually able to import my Google AdWords campaign I created extremely easily. I didn’t even have to think about it. I plan to measure the return on investment of both of these with the same campaign setup to see which one is more effective.

The great thing about Bing Ads? Once you spend $25 (USD), they’ll give you $100 (USD) for your next purchases. Just a $25 experiment that if it works well, I can get 3x the investment back to play with! Very cool!


Doubling Down: My Specific Strategy

Doubling Down: My Specific Strategy - https://www.publicdomainpictures.net/en/view-image.php?image=130306

Doubling Down: The Quick Background

I recently wrote about how and why I’m looking to double down on my strength to improve a weakness, and I figured it would be a great follow up to try and explain the specifics in my strategy. It’s an interesting learning opportunity for me, so why not share it with those that are interested?

The format of this post is really just to call out the specifics of some strategies I’m looking at exploring when building the brand for my vehicle to help with sponsorship opportunities.

Reach Outside Core Audiences

This one shouldn’t be a shock to you if you’re familiar with this blog already. It’s primarily aimed at programming, leadership in a tech environment, and self reflecting as a means to improve. One of my goals is to explore attracting other audiences that might have a bit of overlap with my core audience in order to build up awareness of my brand. In this particular case, I’m writing about branding in the online world and attempting to relate it to setting personal goals and establishing a plan to reach them. So while this topic is outside my core domain here, I think there’s some interesting overlap, and working on this will help me build up the knowledge for how to apply this to my vehicle brand.

I’d like to practice on this blog by writing about some things that are slightly outside of the norm for the content here and gauge how readers react. This learning will be used to expand the brand awareness of my vehicle when I apply it in that domain. Or that’s the theory, at least.

Linking to Related Content

If you’ve been paying attention, I’ve been trying to link you, my fearless reader, to other content I’ve created. It’s a simple tactic to provide you with more opportunities for the information you’d like to read more about and simultaneously keep you engaged with more of my own content.

The specific goal here is exploring how readers consume related information. When it comes to my vehicle brand, perhaps those that are interested in the wheel brand I use will also be interested in the air suspension setup I run. Perhaps the shop that does my work can gain more business because someone clicked a link or followed the breadcrumb trail to their site. Something about content synergy <insert eyeroll>.

Content Planning

Between the last post on doubling down and this current post, I had to do a little bit of work beforehand to plan content. This is something I need to practice more of, and I think I can do a good job of it when it comes to writing programming articles. So for example, I’m picking up more Unity3D work and would love to write more about Unity3D.

This will have great carry over for social media platforms when trying to plan content around events that my vehicle will be at. I can engage audiences better if I have a better plan for content, but this will take practice, time, and effort. The practice part is something I can work at on this blog with little risk because it comes a bit more naturally.

Ads: Hosting Them and Creating Them

This is a big one for me because it’s very new to me, in general. This blog runs ads, and without much experience, they’ve been able to generate a little bit of income (and I mean, very little). It’s something I can work at tuning to get better results, especially because I at least have a starting point to work with.

On the flip side, I’ve never created ads for my blog to drive traffic to this site. This is something I need to explore in order to help with the vehicle brand, and is a great example of doubling down on a strength. This devleader brand has better online presence (at least in terms of a website) than my vehicle’s brand. I think it would be a significantly easier experiment to work on creating ads for this site to drive traffic here and perhaps use my small ad revenue to seed this initial experiment. Minimize the risk!

Once I learn how to use ads better, I can perhaps apply this to the vehicle brand to drive more traffic to the content I create for that.

Calls to Action

For social media engagement, it’s really important to have calls to action. In the last post on doubling down, I added a call to action right at the end of the post. Did you see it?

Maybe not, and that’s okay because I’m practicing it. For Instagram and Facebook, it’s extremely helpful for generating impressions when you have your audience interacting with you. The more practice with creating good calls to action, the better I can do with my vehicle brand.

Next Steps

My next steps for my doubling down strategy are to start with creating some Unity3D articles. As I mentioned above, I’m looking to work more with Unity3D so it’s another great doubling down opportunity where it’s minimal investment for me (I’m already doing the research, I just need to write about my experiences) and a low-risk area to experiment in. I can practice some of the individual pieces of my strategy (as outlined above) in creating a series of Unity3D articles, and measure my success along the way.

If you’re a Unity3D programmer, what sorts of Unity3D articles would you be interested in? I plan to start some on Autofac and some cool patterns I’ve been using, but I’d love to hear what you’re interested in!


Delta State Algorithm Creation Series

Delta State Algorithm

Delta State Algorithm Motivation

This post will act as the table of contents for an algorithm I’m developing for calculating deltas between state for generic sets of data.

I figured this would be an interesting series to write about so I can document my thought process, trials, errors, and successes. At the end of this I plan to share working code that implements this algorithm so that you can use it in your own work.

Now that I’ve been not diving more into Unity3D development for my hobby programming, I’m getting to a point in game development where I need to manage state for data in a way that allows patches of state to be applied in a layered fashion. A couple of examples of this include:

  • Applying save game state to a base game state
  • Applying a patch to a base game state
    • Optionally allow save game state to be applied on top of this and completely override as necessary
    • Optionally allow save game state to be applied on top of this but “retroactively patch” existing save game data

I believe that I can design an algorithm that’s relatively simple that should allow the layering to work, but I have a lot of potential corner cases to figure out (especially when considering retroactively vs not for applying game patches). I’ll be exploring data structures to use and technologies to leverage for persisting this state.

It should be pretty exciting!

Delta State Algorithm Series

Just a reminder that if you’re interested in this series, you’ll want to use this page as the starting point. As I continue to add new content to this series, I’ll come back and update this page with links to the parts of the series. Ideally at the end I’ll have some working code I can share!

  • Part 1 – Exploring Graphs and Trees (TBD)
  • Part 2 – Undo/Redo Patterns (TBD)
  • Part 3 – Generic State Serialization to a Graph (TBD)
  • Part 4 –  … TBD

Double Down On Your Strengths!

Double Down on Your Strengths - https://www.publicdomainpictures.net/en/view-image.php?image=130306

Double Down: Why I’m Working This

I haven’t written in a while, and despite setting a goal for myself to start writing more, I’m not going to kick my own butt over not getting around to it. Actually, if anything my priorities and goals have been evolving over the past while and it’s been a great growing opportunity. Previously, I wanted to start up writing again to work on my ability to self-reflect. In all honesty, other factors came into play and this started to happen more naturally without forcing myself into writing more.

Now that my goals are changing again, I’m realizing that I need to come up with some creative solutions for addressing them. For total transparency, one of my hobby goals is creating a brand for my show car, Ignantt. It’s a fun hobby of mine, and in order to keep it going I’m looking into sponsorship opportunities to take things to the next level. Sponsors are interested in your social media reach, and rightfully so. They want to make sure they can reach a wider audience by working with you.

I’ve been active on social media for my vehicle’s brand, but I’m interested in accelerating this. One option I’m exploring is paid promotions, but like many people, I’m a little bit skeptical and I feel weird about spending money out of my pocket to do this. Social media marketing is certainly not a strength of mine, but I would love to work on that.

So that’s where my creative strategy comes in!

Focus on Weaknesses or Double Down?

I read a lot about focusing on your weaknesses to become better and more balanced, and that concept makes sense to me. It’s going to take trial and error in addition to consistent effort to become better at something. Time. Resources. It’s just the nature of the beast. I’ll give you a few examples:

I’m interested in strength training. When you’re looking to improve a lift, whether it’s your bench press, your squat, your deadlift, or any other lift, you need to actively train that movement. As a novice, you’ll quickly see strength improvements. However, as your body adapts these improvements slow down. If you’re trying to increase your one rep max and progress is stalling, it might be a great opportunity to train strength in other rep ranges that you’re lacking in. The side effect of this can be that your one rep max strength breaks through a plateau. Maybe you have a weak body part you need to build more strength in, and as a result, fixing this imbalance allows you to continue to progress in your strength. These are all examples of working on a weakness to become stronger in another area, and in this particular case it’s physical strength for a lift.

I’m also interested in bodybuilding. Similar examples apply here as with strength training because bodybuilding has a lot to do with symmetry and balance. Got big arms but tiny legs? You won’t do great on stage until you bring up your lagging legs because judges are looking for symmetry between your upper and lower half. Arnold Schwarzenegger was known for blasting his small calves until they were no longer a weakness. It’s about balance in bodybuilding, so turning your weaknesses into strengths is important.

Double Down to Reduce Risk

So why might I suggest that you double down on your strengths instead of just hammering away at your weaknesses? Well, in this case I’m looking to reduce risk in terms of time and money while taking a more slow and steady approach to working on my weakness. My blog for development and leadership has been more successful in terms of generating online traffic and ad revenue. It’s nothing crazy, but it’s been proven more successful than my other blogs or sites. For me to invest more time and money into this blog is actually minimal effort, minimal risk, and it’s also aligned with some of my other goals (which I’ll follow up about). In fact, instead of feeling like a forced scenario to write, I have some topics I’d like to write about because they’re recent learning experiences.

My thought process is that I can continue to use this blog to:

  •  Generate a small amount of revenue
  • Experiment with content creation in an area I’m stronger in and have more experience with
  • Use my learnings to carry into a different area/domain but with similar goals

Generalizing My Double Down Strategy

While I absolutely believe balance in many things if very important, I think there are opportunities where you can double down on your strengths to help improve in other areas.

This boils down to:

  • The area I’d like to improve in is something I’m lacking experience in and as a result, could be risky to heavily invest resources into
  • I have an area I’m strong in that has potential carry over to my weak area
  • My strong area can be used as a buffer to minimize risk (i.e. potentially use ad revenue from one to pay for ads for the other)
  • Focusing on my strength is aligned to something I enjoy, so it won’t feel forced to work on it

Double Down Summary

While this may not make sense to do all the time, I think the timing works really well for me. I’m going to write a follow up to discuss particular examples of how I plan to execute this and how they relate to building the brand for my vehicle.

Can you think of any areas that you can double down in to improve another area in your life?


Resolutions: Why Have Them and How to be Successful

Resolutions

What’s Up With Resolutions?

It’s that time of year! You know, where everyone is thinking back on all of the things they wish they had actually accomplished this year and they’re convincing themselves they’ll get it done next year. It’s time to set some New Year’s resolutions!

But what’s up with that? Why does it take people a whole year to reflect on what’s going right or wrong in their life and try to change their direction? Why does it take you a year to realize your diet and exercise regime is something you couldn’t stick to and you’re no better off than you were last year? Why were you still unmotivated in your career doing the same old thing? Why didn’t you get your head in the game for school? Why did you continue to pursue toxic relationships?

Continuous Improvement

Resolutions are all about trying to get better; we’re trying to continuously improve. Often when I talk to people about “agile” software development, all that I really try to drive at is that “continuous improvement”, in my own personal opinion, is really the important part.

So to continuously try to improve, you need to analyze what’s going well and what’s going not so well, set some goals, try things out, and re-evaluate. It’s a nice iterative cycle. It’s kind of like setting mini resolutions for yourself (or in the case of software development, maybe for your team or teams).

The big difference is the amount of time between measuring whether or not your change is having an effect! Waiting an entire year to try and measure your success would be absolute insanity in a fast moving software environment… why haven’t we gotten better at realizing this for our own personal continuous improvement?

Mark Manson

I’ve been reading a ton of Mark Manson material lately because of events going on in my life and the fact that the way he writes really aligns with how I often talk to my close friends. There’s analysis, there’s some humour, but it’s often a bit blunt and to the point. It’s actually a really nice change from many leadership, self help, or similar content where everything almost feels impossibly positive. This just feels like a real person talking to you.

Mark talks about setting goals in this blog post, and it got me motivated to reflect on my own goals and even write this post. In Mark’s post, he talks about our identities being built up by a bunch of habits, and goes on to state that some research shows that often habits only take about 30 days to form. In his opinion, using a whole year to set a goal of changing, adding, or dropping a habit just allows us to procrastinate for the entire year and then ultimately we fail.

His suggestion? Shorten the time frame.

If it takes on average 30 days to make a habit, why not have a “New Month’s Resolution”? Setting resolutions this way should then allow you to establish a new habit and then at the end of the month reflect on whether or not it worked well. You have less time to procrastinate. Your iteration is much shorter. Interesting.

My Own Goals

I figured I’d wrap this up by sharing some of my own goals publicly. I have a few things I’d like to work on coming up for the year, so I’ll outline them briefly:

  • Read more:
    • I’ve definitely dropped the ball on this one. I always had the excuse for myself that I don’t have time to do it. However, I found when I read the most consistently was when I found a decent book that I could read for a few minutes before I fell asleep every night. No pressure to get through it, but the books were there if I felt intrigued or needed to relax my brain a bit.
  • Try meditation:
    • I’ve always associated meditation with being spiritual or religious. Both of these things don’t really mesh well with me, personally. Mark Manson mentioned meditation in his post that I mentioned earlier, and it gave me a different perspective. I know I get stressed easily and I used to have pretty bad anxiety problems. Maybe this is something I could try out?
  • Write more:
    • I used to blog a lot. Between this blog, my fitness blog, and my car blog, I used to write content multiple times per week. It was always a bit of a social media experiment to get a better feel for how internet traffic works and where different types of content get the best visibility, but it also let me express myself. My content production has been almost nothing over the past year, and it’s something I’d like to look at more of.
  • Try public speaking:
    • This was something my HR Director had a chat with me about as a potentially cool opportunity. We were discussing getting more involved with the community and pushing boundaries, and she proposed speaking to students at local colleges or similar. I was turned off by it at first because I don’t like public speaking. But then the more I thought about it, I don’t know what public speaking is because I’ve never really done it. So why not try it?

But those aren’t my resolutions! Those are all just ideas for things I’m interested in improving. So taking some of Manson’s advice, I’m going to take ONE of those things and try to form a habit out of it for a month. Focusing on one thing at a time allows you to really give yourself an opportunity to establish the habit without worrying about too many other things, and ultimately setting yourself up for failure.

My first resolution is going to be to try out meditation. So for the first month, I’m going to try meditating four times per week for about 10 minutes at a time. I should be able to easily do this for two days on Saturday and Sunday where I don’t really have any external commitments, and then during the week I should be able to find at least two days before work where I can give this a shot.

Small steps, but small steps still take you forward.


How to Refocus: Getting Back in the Groove

How to Refocus: Getting Back in the Groove

Identifying when you need to refocus

It happens to everyone at some point to varying degrees, for various reasons, and at different times in our lives–but it’ll happen! You hit a period or a rut where you can’t keep your focus on continuing to be successful (and I’m over-generalizing that for a good reason).

Maybe this means you can’t focus at work to perform at an optimal level. Maybe you’re falling off the diet you’ve been working hard on. Maybe your training in the gym or for your sport is taking a hit because your head isn’t in the game. Maybe you find yourself unable to hit the books studying or completing your projects in school.

It can look different for everyone.

There are a bunch of different little warning signs that things aren’t quite on track and you need to refocus:

  • You’re losing interest in what you’re working on or have been working towards
  • You can’t seem to keep your mind on the goal(s) that you’ve set
  • You feel like you’re plateauing in your progress toward your goal(s)
  • You’re suddenly finding you’re not happy or not feeling fulfilled
  • You’re taking out stress on your co-workers, friends, or loved ones
  • You’re isolating yourself from friends and family
  • You find yourself overly concerned with things you can’t change (dwelling on the past or fearing a future event, like an exam)

But don’t freak out just yet… you need to see and acknowledge the signs before you can start to make any progress. Feeling pretty good about everything in your life? Then keep doin’ what you’re doin’! If any of those points seemed to resonate with you, then let’s continue on!

Don’t worry

If you’ve found that you’re in a bit of a rut, it’s important to not worry. You need to remind yourself that you were once on track and you’ll get back on track. You’ve already identified you need to refocus, so you have the power to get back on track.

Worrying about the fact you’ve identified you’re not in an ideal state of mind doesn’t help anything; in fact, it makes it worse.

“I can’t seem to find my focus at work… I’m going to be such a bad employee. I wonder if I can even get my work done now. My colleagues are going to notice… My manager will notice!”

“Training has really been kicking my butt… Why am I even doing this? I wonder if I should just give up. I haven’t seen any progress in my abilities in the past couple of weeks. I’m hopeless at this.”

“There’s a lot going on at school now and I can’t seem to keep up anymore. I’m going to fail this project that’s due next week because I can’t seem to get started on it. And my exams are coming up and I can’t seem to study. I’m going to fail this term.”

All of that kind of talk is negative and it’s not going to help you progress! So why are you continuing to focus on hampering your progress? Don’t do it. Instead, acknowledge you’re looking for a positive change, and then acknowledge that you’re in full control to start making that change.

And step one is to stop worrying and drop the negativity.

Analyze what’s getting you down

I get told that the engineer in me talks too much about analysis… but I think it’s a critical step! You need to understand the things that are getting you down. You’ve identified that you need to refocus because you’re not happy with your current behaviour or state of mind, but what are those things that are getting you down?

If you understand what’s getting you down you can start to take corrective actions. It’s got a (cue the fancy buzzword) synergistic effect with my previous point–Drop the negative thoughts and work on correcting them in parallel.

Let’s look at a couple of potential examples:

  • You’re unable to see any progress in your work, schooling, or training
    • How are you measuring progress right now?
      • Some things aren’t well suited for quantitative measurement
      • Try and identify a consistent mechanism for measuring progress
    • How often do you measure progress?
      • Some things don’t change very frequently so it’s hard to notice progress
      • Many things don’t progress in a totally linear fashion
    • Is it time to update your strategy for continuing success?
      • How long have you been doing the exact same thing expecting to get the same increase in results?
      • Have other environmental factors changed that suggest you should update what you’re doing?
    • Have you actually compared your current status to a previous point in time, or is it just how you feel?
      • Maybe it’s all in your head!
      • Try reflecting on where you were a month ago, 6 months ago, and a year ago.
  • You’re constantly comparing yourself to others
    • Do you actually know all the ins and outs of a person’s life?
      • Just because you observe certain things, it doesn’t mean they’re exactly as they seem
      • If you don’t have the full perspective and details on someone’s life, you’re guaranteed to be misunderstanding something
    • Can you change other people?
      • … Even if you could, you shouldn’t!
      • See the next major point 🙂
    • Are you comparing different subsets of your lives and expecting them to align a certain way?
      • Other people are not you and are living a different life
      • You can only truly compare yourself to your own self at various parts in your life
  • You’re dwelling on things you can’t change
    • Are you expecting to change something in the past that’s already happened?
      • Unless you have a time machine, you absolutely cannot change past events
      • Trying to understand past events can be helpful learning for the future
    • Are you dreading an event in the future that’s unavoidable?
      • If you can’t avoid it, then work at accepting it’s going to happen. (Things like exams or year-end reviews for work, for example)
      • Ask yourself why you’re dreading it. Try applying this example of analysis to THAT reason and dive deeper.
    • Are you focused on the thoughts and emotions of other people?
      • You can’t (and shouldn’t try to) control how other people think and feel
      • The best you can do is focus on yourself and live the values that you believe in
      • When it comes to thoughts and feelings, we all observe and interpret on our own
    • Have you considered whether this situation is temporary?
      • When you don’t know how long you’ll be out of control, it can make you feel helpless
      • Knowing there’s a point in time where there’s a change that can affect your situation can be a great help (i.e. money is tight for two weeks and you just need that next pay cheque to come through)

These are just a handful of examples, but hopefully you can see a pattern:

  1. Identify a particular thing that you know is getting you down.
  2. Ask yourself what effects it’s having and why you believe it’s having those effects on you.
  3. Dive deeper on each one of those by repeating these steps.

It’s nothing groundbreaking and I’m not claiming it will magically fix your problems… But analyzing things can lead to understanding, and understanding can lead to progress.

Remind yourself of your strengths

Everyone gets down on themselves at some point and this will cause you to lose focus on your goals. But I guarantee you if you stop and think about it, there’s a lot of great things that you got going on!

Don’t believe me? I challenge you to take a pen and something you can write on.

  • Write three things you’re proud of or that you’ve accomplished
  • Write three things about why your best friends like you
  • Write down the thing you love doing most or loved doing most before this point in time
  • Write down the thing you think you’re best at

Now step back for a second and think about the things you wrote.

  • It’s very likely the accomplishments you made or things you’re proud of required you to overcome something. Unless you got lucky or had some magic, odds are you used your strengths to achieve these things.
  • Your friends stay by your side because they admire you. They admire the qualities you have and see strength in you. You might not realize these strengths, but your friends perceive these about you.
  • If you love doing something, you’re probably pretty good at it, and if you’re not, odds are you’ll get good at it because you love to do it! Acknowledge and understand what you’re passionate about because it will tell you about your strengths.
  • Sometimes you’re good at things that you’re not totally passionate about. That’s cool too! What makes you good at this thing? Can you apply this to other areas in your life?

Set some goals

At this point you’ve:

  • Identified that you’re not content with your current state
  • Reminded yourself that you can make a change
  • Analyzed what’s getting you down so that you have a better understanding of some direction to take
  • Reflected on your own personal strengths

And now… It’s time to set some goals!

Goals you set should ideally align with SMART goals. Do yourself a favour and check that page out for a little bit more information so you can set yourself up for success. You want to make sure you’ve agreed your goal is achievable within a certain period of time and that you can measure progress in some way as you go. This is critical for a few reasons:

  • No time box? How will you know if you’re on track?
  • No way to measure? … Same problem!
  • Not realistic or achievable? You’re setting yourself up for failure.

It seems obvious when it’s laid out like that, but this will keep you from setting goals like “I’m going to do better at work”, “I’ll kick my training up a notch”, or “I’ll worry less about what’s going on in other peoples’ lives”. None of those goal statements indicate when you’ll be done by or how you’re going to measure progress.

Here’s a simple example:

In the next month, instead of missing on average three practices per week, I’ll reduce this to one. I’ll make sure that I have things put into my agenda ahead of time so I won’t schedule things over practice sessions, and if something critical comes up last minute, I can use the following week to compensate for it.

  • Specifically about not missing practices
  • Measured weekly by an average of missed practices
  • Achievable because it’s an improvement and not an expectation of perfection
  • Realistic and with the reward of getting to more practices
  • Time boxed to one month.

Start slow and set one or two SMART goals. As you build confidence that you’re progressing in your goals, try adding in another. You don’t want to overwhelm yourself!

Be brave enough to ask for help

If you’re reading this and you’re considering making changes then you’re already starting your path to progress. That’s AWESOME and you’re a strong person for being able to get started.

Sometimes things can get tough though. You might feel you’ve made progress over a few weeks or months and seemingly fall back to square one. You might feel like you’ve set SMART goals but you’re having trouble even getting started. Maybe you read this and still don’t even know how to get started.

There are a million reasons why getting started or continuing can be hard. Be brave though. Ask for help. I can guarantee you have some amazing friends and family that love you that want to see you be successful. There’s nothing to be ashamed of when asking for help! It’s a courageous thing to admit that you’d like assistance on your path for doing better, and people see that. You might feel embarrassed or ashamed, but other people see a brave person trying to move forward.

Summary

It’s a common thing for people to fall into a figurative rut in life. It happens to everyone at some point and it’s nothing to get down on yourself about. You’re not a bad human being if it happens to you, so don’t sweat it.

Analyzing your current situation and why you feel certain ways can help you gain an understanding of what’s going on. Focus on driving out the negativity and create actions to try making progress by leveraging your strengths.

In the end, remember that you control your life and you can make all the positive changes to it that you want to see. It takes time and hard work, but if you put in the effort, you’ll always get to where you want to be.

Now get out there and go kick some ass.


What Makes Good Code? – Should Every Class Have An Interface? Pt 2

Should Every Class Have an Interface?

This is part two in the sub-series of “Should Every Class Have an Interface?“, and part of the bigger “What Makes Good Code?” series.

Other Peoples’ Code

So in the last post, we made sure we could get an interface for every class we made. Okay, well that’s all fine and dandy (I say half sarcastically). But you and I are smart programmers, so we like to re-use other peoples’ code in our own projects. But wait just a second! It looks like Joe Shmoe didn’t use interfaces in his API that he created! We refuse to pollute our beautiful interface-rich code with his! What can we do about it?

Wrap it.

That’s right! If we add a little bit of code we can get all the benefits as the example we walked through originally. It’s not going to completely fix “the problem”, but I’ll touch on that after. So, we all remember our good friend encapsulation, right?

Let’s pretend that Joe Shmoe wrote some cool code that does string lookups from an Excel file. We want to use it in our code, but Joe didn’t use the IStringLookup interface (because… it’s in OUR code, not his) and he didn’t even use ANY interfaces. The constructor for his class looks like:


public ExcelParser(string pathToExcelFile);

On this class, there’s two methods. One method allows us to find the column index for a certain heading, and the other method allows us to get a cell’s value given a column and row index. The method calls looks like:


public int GetColumnIndex(string columnName);

public string GetCellValue(int columnIndex, int rowIndex);

We can wrap that class by creating a wrapper class that meets our interface, like so:


public sealed class ExcelStringLookup
{
  // ugh... we have to reference the class directly!
  private readonly ExcelParser _excelParser;

  // ugh... we have to reference the class directly!
  public ExcelStringLookup(ExcelParser excelParser)
  {
    _excelParser = excelParser;
  }

  public string GetString(string name)
  {
    var columnIndex = _excelParser.GetColumnIndex(name);
    // assumes all of our strings will be under a column header
    var cellValue = _excelParser.GetCellValue(columnIndex, 1);
    return cellValue;
  }
}

And now this will plug right into the rest of our code that we defined originally.

This doesn’t totally eliminate “the problem” though (the problem being that some class doesn’t have an interface (what this post is trying to answer)). There’s still a class we’re making use of that doesn’t have an interface, but it looks like we’ve reduced the exposure of that problem to JUST this class and the spot that would construct this class. Are we okay with that?

Thoughts So Far…

Let’s do a little recap on what we’ve seen so far:

  • Having interfaces for our classes is a nice way to introduce a layer of abstraction
  • Interfaces are just *one* tool to get layers of abstraction introduced
  • If you wanted to have interfaces for all of the classes in your code and some third party didn’t use interfaces, that code is likely not as common in your code base (especially if you wrap it like I mentioned above). This may not always be true in your code base, but it’s likely the case.
  • The amount of work to wrap things can vary greatly. Some things are straight forward to wrap, but you need to add many methods/properties. Sometimes it’s the inverse and you only have a few things to wrap but they’re not straight forward.
  • The number of classes you’d need to wrap to get to this state can vary greatly… Since even built-in System classes aren’t all backed with interfaces!
  • There’s certainly a trade off between the original work + maintenance to wrap a class in an interface versus the benefits it provides.

Is that last point blasphemy?! So there may actually be times we DON’T want to have an interface for a class?

Watch this space for part 3 where we start to look at a counter-example!

 


API: Top-Down? Bottom-Up? Somewhere in the Middle?

A Quick Brain-Dump on API Desgin

I’ll keep this one pretty brief as I haven’t totally nailed down my thoughts on this. I still thought it was worth a quick little post:

When you’re creating a brand new API to expose some functionality of a system, should you design it with a strong focus on how the internals work? Should you ignore how internals work and make it as easy to consume as possible? Or is there an obvious balance?

I find myself trying to answer this question without ever explicitly asking it. Any time I’m looking to extend or connect systems, this is likely to come up.

Most Recently…

Most recently I started trying to look at creating an API over AMQP to connect my game back-end to a Unity 3D front-end. I had been developing the back-end for a little while now, so I had a pretty good idea for how things needed to work from that perspective. The front-end? Not so much really. I knew some basic actions that I was considering, so I tried coding up an early API for them.

A lot of my focus was around how I was going to implement the code on the back-end to make this API work. It resulted in some of the API calls looking a little bit gross. But the idea was that if I settled on an API that would make the back-end easy to implement, I could get it up and running faster.

After a little while, I feel like my API isn’t getting any cleaner from a consumer perspective, and funny enough, it’s not actually as easy to implement as I was hoping on the back-end. Which had me reflect on a work example…

Once Upon a Time at Work…

Well, it was only a couple of months ago, really. I was working with a colleague on integrating a new system into an existing code base. We decided we wanted to approach the API problem from a consumer perspective. We said “let’s make this as easy to call and use as possible so that people ACTUALLY want to use it”.

We set out with this mission, and created a pretty simplistic API. The challenge? There was a lot of heavy lifting and a bit of voodoo going on behind the scenes. But you know what? We hid the magic in one spot of the code (instead of having ugly stuff scattered all over the code base) and it ended up being a very usable API.

So…

So does this consumer-first, top-down approach to API design always work? I’m not sure. Some similarities/differences in the scenarios:

  • In my current situation, I have a back-end implemented and very minimal code implemented on the caller side. In the work example, we had nothing implemented on the back-end, and a ton of code implemented where the caller side would be.
  • In both examples, at least one of the caller side or back-end side was reasonably well understood. For my game, the back-end was pretty well understood. For work, the caller side was pretty well understood and we had experience with what we’d call a “failed’ back-end implementation (that we were actually setting out to redesign).
  • The work example was a relatively small subset for an API, but the game example was about to be a very specific implementation that I’d need to adapt into a pattern for all messaging in my AMQP system

So there’s a few things to consider there. I think I’m at the point in my game where I’d like to revisit how I’m forming this API and try it from a client-first perspective. Now that I know some of the catches, maybe I’ll shed some new light!

How do you approach API design?


What Makes Good Code? – Should Every Class Have An Interface? Pt 1

What Makes Good Code? - Should Every Class Have An Interface?

What’s An Interface?

I mentioned in the first post of this series that I’ll likely be referring to C# in most of these posts. I think the concept of an interface in C# extends to other languages–sometimes by a different name–so the discussion here may still be applicable. Some examples in C++, Javaand Python to get you going for comparisons.

From MSDN:

An interface contains definitions for a group of related functionalities that a class or a struct can implement.
By using interfaces, you can, for example, include behavior from multiple sources in a class. That capability is important in C# because the language doesn’t support multiple inheritance of classes. In addition, you must use an interface if you want to simulate inheritance for structs, because they can’t actually inherit from another struct or class.

It’s also important to note that an interface decouples the definition of something from its implementation. Decoupled code is, in general, something that programmers are always after. If we refer back to the points I defined for what makes good code (again, in my opinion), we can see how interfaces should help with that.

  • Extensibility: Referring to interfaces in code instead of concrete classes allows a developer to swap out the implementation easier (i.e. extend support for different data providers in your data layer). They provide a specification to be met should a developer want to extend the code base with new concrete implementations.
  • Maintainability: Interfaces make refactoring an easier job (when the interface signature doesn’t have to change). A developer can get the flexibility of modifying the implementation that already exists or creating a new one provided that it meets the interface.
  • Testability: Referring to interfaces in code instead of concrete classes allows mocking frameworks to leverage mocked objects so that true unit tests are easier to write.
  • Readability: I’m neutral on this. I don’t think interfaces are overly helpful for making code more readable, but I don’t think they inherently make code harder to read.

I’m only trying to focus on some of the pro’s here, and we’ll use this sub-series to explore if these hold true across the board. So… should every class have a backing interface?

An Example

Let’s walk through a little example. In this example, we’ll look at an object that “does stuff”, but it requires something that can do a string lookup to “do stuff” with. We’ll look at how using an interface can make this type of code extensible!

First, here is our interface that we’ll use for looking up strings:

public interface IStringLookup
{
    string GetString(string name);
}

And here is our first implementation of something that can lookup strings for us. It’ll just lookup an XML node and pull a value from it. (How it actually does this stuff isn’t really important for the example, which is why I’m glossing over it):

public sealed class XmlStringLookup : IStringLookup
{
    private readonly XmlDocument _xmlDocument;

    public XmlStringLookup(XmlDocument xmlDocument)
    {
        _xmlDocument = xmlDocument;
    }

    public string GetString(string name)
    {
        return _xmlDocument
            .GetElementsByTagName(name)
            .Cast<XmlElement>()
            .First()
            .Value;
    }
}

This will be used to plug into the rest of the code:

private static int Main(string[] args)
{
    var obj = CreateObj();
    var stringLookup = CreateStringLookup();
    
    obj.DoStuff(stringLookup);
 
    return 0;
}
 
private static IMyObject CreateObj()
{
    return new MyObject();
}
 
private static IStringLookup CreateStringLookup()
{
    return new XmlStringLookup(new XmlDocument());
}
 
public interface IMyObject
{
    void DoStuff(IStringLookup stringLookup);
}
 
public class MyObject : IMyObject
{
    public void DoStuff(IStringLookup stringLookup)
    {
        var theFancyString = stringLookup.GetString("FancyString");
        
        // TODO: do stuff with this string
    }
}

In the code snippet above, you’ll see our Main() method creating an instance of “MyObject” which is the thing that’s going to “DoStuff” with our XML string lookup. The important thing to note is that the DoStuff method takes in the interface IStringLookup that our XML class implements.

Now, XML string lookups are great, but let’s show why interfaces make this code extensible. Let’s swap out an XML lookup for an overly simplified CSV string lookup! Here’s the implementation:

public sealed class CsvStringLookup : IStringLookup
{
    private readonly StreamReader _reader;
 
    public CsvStringLookup(StreamReader reader)
    {
        _reader = reader;
    }
 
    public string GetString(string name)
    {
        string line;
        while ((line = _reader.ReadLine()) != null)
        {
            var split = line.Split(',');
            if (split[0] != name)
            {
                continue;
            }
 
            return split[1];
        }
 
        throw new InvalidOperationException("Not found.");
    }
}

Now to leverage this class, we only need to modify ONE line of code from the original posting! Just modify CreateStringLookup() to be:

private static IStringLookup CreateStringLookup()
{
    return new CsvStringLookup(new StreamReader(File.OpenRead(@"pathtosomefile.txt")));
}

And voila! We’ve been able to extend our code to use a COMPLETELY different implementation of a string lookup with relatively no code change. You could make the argument that if you needed to modify the implementation for a buggy class that as long as you were adhering to the interface, you wouldn’t need to modify much surrounding code (just like this example). This would be a point towards improved maintainability in code.

“But wait!” you shout, “I could have done the EXACT same thing with an abstract class instead of the IStringLookup interface you big dummy! Interfaces are garbage!”

And you wouldn’t be wrong about the abstract class part! It’s totally true that IStringLookup could instead have been an abstract class like StringLookupBase (or something…) and the benefits would still apply! That’s a really interesting point, so let’s keep that in mind as we continue on through out this whole series. The little lesson here? It’s not the interface that gives us this bonus, it’s the API boundary and level of abstraction we introduced (something that does string lookups). Both an interface and abstract class happen to help us a lot here.

Continue to Part 2


Staying Productive

Staying Productive

Background

I wrote a post a long while back about how I started to use Google Keep to get myself organized. Google Keep has been a go-to app for me on my phone for a long time now. I love using it to make lists of things, and I find it much more convenient than a paper notebook.

Don’t get me wrong–I think a paper notebook still has plenty of uses! I love my notebook for long running meetings with open-ended discussions or brain storming sessions. It’s great to be able to take a pen/pencil and doodle down any idea that comes to mind. When I’m having a free-form conversation, I need a free-form way to take notes.

However, my phone is something I almost always have with me–and my paper notebook isn’t. My phone allows me to take my Google Keep notes and email them to myself. It allows me to have a reminder right on my homescreen every time I unlock my phone. It’s just more convenient.

But something happened since the last time I wrote about using Google Keep. I use it more and more, and at some point I felt like I was getting less and less done. This is less about in the office and more about how productive I feel at home. So how can I be getting less done (or at least feeling that way) if I’m taking my own advice and using Google Keep to hack my TODO list?

I have tons of lists and no actions.

I think that’s the big take away. I list all the things I’m thinking about, and I keep making more lists. There’s no time frame around actioning things with the lists I’m making! So, in the spirit of continuous improvement, I set out to make some changes.

Inspiration

I know I wanted to make some changes with this part of my life because it was starting to weigh down on me; I didn’t feel productive. But I knew this wasn’t going to be something I’d answer over night. I kept my eyes and ears open for ideas for a little while before I thought up some tweaks.

The first thing I came across while living my alter ego was an Instagram post by Big J. Big J is this guy that’s incredibly big and incredibly strong. He’s lived the bodybuilding life and has a lot to show for it… And because being successful in the bodybuilding and strength world means being extremely motivated and hardworking, it’s no surprise I picked up this little bit from Big J:

Simple idea, right? Put some time into planning your schedule for the upcoming days. It almost seems to obvious to not be doing. I mean, don’t I do this already? I have meeting invites and stuff in my calendar for work… But, that’s right! I don’t have anything in my calendar for my own personal things that I like to do outside of work. Hmmm…

The next little tip to push me along was after a conversation with a teammate of mine at work. Our conversation was mostly about work-life balance, but my colleague was telling me about something he was trying out around forming habits. Essentially, over a period of time he’s been recording his success at keeping on top of good habits and identifying reasons why he’s sometimes missing them. Definitely right up the continuous improvement alley! Another great point he brought up was that good habits need to be introduced one at a time and only once you’ve been consistent with your other habits. By adding too much at once, you can derail the whole good habit process.

The “Staying Productive” Hack

This is the hack I’ve been implementing for a bit over a week now, and it’s helped tremendously with feeling productive!

Every night when I’m laying in bed, I spend about 5-15 minutes with my phone and I schedule personal activities in my calendar for the following day.

There it is. It’s not rocket science or something Earth shattering, but it’s definitely helping. Taking a page out of Big J’s book and a tip from my colleague, I’ve modified my schedule to introduce a very brief planning period every day. And it’s just one change that I think is helping introduce a good habit into my life.

This has helped me:

  • Stay on top of prepping food (which is a big part of the lifestyle I try to live)
  • Schedule time to relax (yes, I even schedule time for things like video games!)
  • Schedule time to blog (I run three blogs, and sometimes finding time to write feels like a chore)
  • Work on personal projects
  • … Feel like I’m being productive.

And no, I didn’t drop Google Keep–It actually helps feed into my scheduling! It’s great to look over my lists of things and try to create actions for them.

Next Steps

This simple hack is not only nothing particularly fancy, it’s also not bullet proof! But that’s okay when you’re always trying to continuously improve. Some snags I’ve run into or things I’ve thought about are:

  • How do I adjust my planned schedule when unexpected things come up? If someone drops in for a visit out of nowhere, or my car breaks down, or my dog decides to tear up the furniture, how do I make sure I can continue on with my planned schedule? Right now some things drop off the schedule or I push other things off to compensate. This hasn’t been too big of a problem so far, but sometimes this has a bit of a landslide effect and it makes the rest of the day feel unproductive. A little bit of dirt in the cogs seems to throw the whole thing off for me! This is something I’ll be thinking about as I encounter it and I’ll try to thing of some easy solutions.
  • How can I be more like Big J?! Aside from being bigger and stronger, how can I plan for more days? Big J plans every Sunday but I plan every night for the next day. Is there a happy medium? Planning every Sunday would potentially amplify the landslide effect I previously mentioned, but it would be a convenient single planning session for the whole week. Perhaps I’ll continue with the advice of my colleague and modify one part of my new habit at a time and look at planning for an extra day at a time and see how that goes!

If you’ve been making checklists and find that you’re unable to action items, try this approach! It takes only a few minutes every day, and so far I’ve been having great success in feeling productive. It’s not difficult, so it’s worth a try!


  • Subscribe to Blog via Email

    Enter your email address to subscribe to this blog and receive notifications of new posts by email.

  • Nick Cosentino

    Nick Cosentino

    I work as a team lead of software engineering at Magnet Forensics (http://www.magnetforensics.com). I'm into powerlifting, bodybuilding, and blogging about leadership/development topics over at http://www.devleader.ca.

    Verified Services

    View Full Profile →

  • Copyright © 1996-2010 Dev Leader. All rights reserved.
    Jarrah theme by Templates Next | Powered by WordPress