At Springthrough we use Slack to communicate with each other individually and as a team. In addition to chatting amongst team members, Slack allows for customized commands that will return whatever information that you need. Some are fun, like if you enter a keyword with the Gif command it will provide you with a gif illustrating your keyword. Others are practical and alert our team to work requests.
Frustrations with my daily commute led me to create a Springthrough Slack traffic app. I was tired of getting onto the highway to go to work only to be stopped a few miles down the road because of traffic congestion or an accident, and I wanted a way to check traffic that was fast and didn’t require much thinking on my part.
With my new Slack command, a person can save important locations and use those saved locations to check the travel time between them.
To save a location, simply enter commands like the following.
/traffic save 123 Main St. Grand Rapids, MI 49503 as Home
/traffic save 62 Commerce SW Grand Rapids, MI 49502 as Work
These locations are now saved as "home" and "work".
Now, checking traffic is easy in the morning. Just use
/traffic home to work
to send the command and slack will send something back to the effect of
From this I can tell that traffic is moving along because 7 minutes is about the average amount of time this trip should take. If the time came back as 20 minutes or longer, I would know that traffic is slow and an alternative route is in order.
The traffic Slack app pushed me into a few technologies that I had limited to no exposure to before.
- I learned how to setup a Slack slash command.
- I learned about how best to layout the required elements for a Slack slash command.
- I learned more about using a MongoDB database (where individual user’s locations are saved) for persisting data, particularly in a .NET environment.
Nothing about setting up this command is very tricky. It only required about an hour of reading and then a couple hours of writing the server API that handles and processes the traffic request.
I could go into more detail about setting it up. I could go on and on about how I weighed the options between using a NoSQL database like MongoDB vs using a standard SQL database and why I made my choice as well as how I setup the database to allow me to save individual user locations. I could go into the little ‘gotchas’ in setting up Slack commands. I could talk about using the Google API, its available alternatives, and getting travel time information as well as the steps to set that up.
I could go into all of that here, but I imagine that most (if not all) of you would quickly get bored. I understand; I would get bored too. The nuances of one strategy, technology, or user experience doesn’t interest me too much. I chose what I chose because it seemed to be the best option.
You see, it’s not the technology that I used that makes the difference.
It is the fact that I took what I know (.NET, Azure) to move out of my own personal comfort zone and use some new technologies (Slack interaction, MongoDB). I used a base technology that I know fairly well and leveraged that to jump into new technologies where I don’t have a lot of experience. This is what is important to me in this whole project.
I don’t have any ‘mastered’ languages. I don’t want to master a language. That may sound terrible, but it is how I work. I like to keep learning new languages and then use the best one for every instance. At Springthrough, we primarily use the .NET architecture from Microsoft. I have personally used .NET for years and find it to be enjoyable and dynamic. However, it isn’t the right solution to every issue. There are lots of times when the .NET framework isn’t a good fit.
Take text manipulation. I have several instances where I need to simply convert text to a csv file with some intermediate manipulation. I could use .NET for that, but it would be sort of like using a sledgehammer to kill a housefly. It would work, but it would be cumbersome and slow to setup. For these instances, I go with a different language like a Python or Ruby. (Lately I’ve been using more Python than Ruby). They are both lightweight and quick to get setup and running, especially for something like simple text manipulation.
Why is this important?
In my view, it is important to keep your education going. It doesn’t have to be formal. I have never taken a formal class in Python, Ruby, or .NET. It also doesn’t have to be extensive. I have read and worked through quick tutorials for various languages to ‘get a taste’ of that language and see what it’s about. Some of them I like (C#, Python, Ruby) more than others (C, C++, Go). It doesn’t matter which languages I like/dislike. What is important is that I make sure that I expose myself to a multitude of various languages so that I know what is out there and what those languages can or cannot do. Then, when the need arises, I can make an informed choice about what technologies to use. I used this Slack command as an opportunity to get myself better acquainted with NoSQL databases and to a lesser extent Slack slash commands. I now have more experience with each and can carry that forward to future projects as needed. I am not an expert in either one, but I know enough to know what I don’t know.