• You are here:
  • Home »
  • Archive: January, 2018

Archive Monthly Archives: January 2018

10 Handy NuGet Packages for Your Next .NET Project

One of the great things about modern development is how easy you can leverage code written by others. Package managers like NPM and NuGet make this process even easier. The only problem is that there’s so much available code to choose from. For example, there’s over 100,000 packages on NuGet. In my travels as a .NET developer, I’ve found a few packages that made my life a little easier. Here’s a list of 10 handy packages you use in your next project:

Refit

Refit is a library that helps you automate calls to REST APIs. To use it, you first define your APIs as an annotated interface. Then you use Refit to turn that interface into a class. I love this package because it allows you to create incredibly terse API callers.

Swashbuckle

This package should be installed by default on any .NET API project. It automatically adds swagger documentation to your API. In addition to that, Swashbuckle creates a handy web page you can use to document and explore your API. I’m a big fan of this package because it links your docs with your actual code. It becomes even more important in a microservices environment where you have lots of services to keep track of.

Polly

Polly is a fault handling library that allows you to write more resilient code. To do this, you create policies. These policies define what happens when a particular operation fails. These policies include things like Retry, Circuit Breaker, and Fallback. It’s great for operations where there’s a chance of failure, like a REST call over a flaky network connection.

MoreLINQ

LINQ is my preferred way to deal with enumerable objects. MoreLINQ adds lots of useful operators to traditional LINQ.

Dapper

Dapper is a Micro OR/M made by the same folks that gave us Stack Overflow. If you hate fiddling with Entity Framework configurations and just want to write some damn SQL, Dapper is for you. It’s been around for a while, but I’ve only recently gotten a chance to use on a project. After trying it, I’m a huge fan of this approach. I’ve spent way more hours than I’d care to admit trying to shoehorn Entity Framework’s API to get the data I want. I’ve also spent countless hours trying to figure out why my five lines of C# produced 3000+ lines of sketchy looking SQL. Sometimes it’s easier to do things yourself.

Filesystem Abstractions

Generally, when you want to unit test an operation that interacts with the file system, you would need to write a separate interface and class to abstract away the IO operations. With Filesystem Abstractions, you no longer need to do that. Filesystem Abstractions wraps System.IO in a useful interface. Instead of making your own file system access class, you can inject an IFileSystem and get access to all of the IO methods you know and love. Filesystem Abstractions also includes classes to mock the file system, so testing IO operations becomes really easy.

Moq

Moq is a handy library for mocking interfaces in unit tests. You’re probably already using this one.

Xunit

Xunit is a unit testing framework for testing .NET code. It’s like MSTest and NUnit, but it has a few interesting features. One of those is the use of theories. A theory allows you to run the same test with several different parameters. It’s a handy way to test multiple values without having to write multiple tests.

MiniProfiler

MiniProfiler injects a small unobtrusive profiler into your MVC application. As you complete operations, Miniprofiler will display the time it took to complete each step. Tools like this make it easy to diagnose performance bottlenecks.

CSV Helper

The CSV helper makes it easy to create and read delimited files. If you work in an environment where you have to create or process lots of CSVs, this package is a good one to employ.

 

2018 Technology Predictions

Ever wish you could see into the future? I’d love to have known about Bitcoin eventually hitting 17k back when you could pick one up for a dollar. A $200 dollar investment at the time would make for a nice retirement today. Too bad foresight isn’t 20/20.

Even if you don’t want to know everything that happens in the future, you make predictions everyday. You predict that you’ll get paid regularly (if you’re a salaried employee). You make certain assumptions about your health and abilities. You likely predict that the technologies you’re currently learning will be useful in the future. The skill of predicting the future is essential.

It’s also a skill that most of us aren’t very good at. To improve my own prediction skills, I’ve read several books over the past year about prediction and how to discern the future. Here’s a few of the better reads.

The Inevitable – Kevin Kelly

Kevin Kelly lays out 12 different technological trends that will shape our world in the coming decades. I found this to be an interesting look ahead. Different trends include the dissolution of specific versions of software, increased personalization through automation, and the rise of virtual reality.

The Signal and the Noise – Nate Silver

Nate Silver one of the top predictors of election outcomes and other events. His book talks about some of the difficulties in creating useful models. He emphasizes the importance of probabilistic thinking and enumerating your own inclinations.

Black Swan – Nassim Nicholas Taleb

In Black Swan, Taleb talks about the need to prepare for unpredictable events which he calls “black swans”. Even in situations that look stable (ie. the real estate market), certain system shocks can suddenly appear and destroy the fortunes of the unprepared. Only one of these black swan events can cancel out the gains of all previous years. Black Swans work both ways though. You can profit if you can jump onto a positive Black Swan event.

The Age of Spiritual Machines – Ray Kurzweil

Ray Kurzweil is regarded as one of the most accurate futurists in the industry. Age of Spiritual Machines was written in 1999 and contains predictions for 2009 and 2019. While he credits himself with being mostly right, I laughed out loud at some of the predictions while I was listening to the book in my car. Even the best futurists often fail.

Crystal Ball Time

One of the major themes throughout all these books is the need to write down your own predictions and see how well (or poorly) you did. People have self-serving biases that distort past predictions. Writing them down prevents you from forgetting how awesome you thought MySpace and Betamax were going to be. Learning about your own fallibility makes it easier to correct your judgement and improve. To improve my own prediction abilities, and provide my future self with some entertainment, I’m going to make a series of predictions. I put a reminder in my calendar to check back over the next few years to see how well I did.

Disclaimer: Don’t bet the farm on this stuff.

Technology Over The Next 1-3 years

We won’t see a major new JS framework this year. The market has stabilized around React, Angular, and Vue

Rationale: Web frameworks have reached a stability point. Each framework generation has offered diminishing returns and the time to learn them isn’t getting any shorter. Unless something major comes along, we probably aren’t going to see any major new web frameworks.

Web Components will move towards the mainstream

Rationale: Web components have the possibility of lowering framework dependence. I think they’ll be welcomed by people who are tired of having to keep up with a yearly JavaScript framework. While this may trigger a new series of frameworks, my guess is that web components will integrate with existing frameworks.

AI is over-hyped.

Rationale: With the advent of commoditized AI, people are freaking out about various doomsday scenarios. While I think AI is important, it’s probably not going to be all that different from every other major technological shift.

XR (augmented and virtual reality) will continue to advance, but people won’t find the “killer app” for it yet

Rationale: There’s a ton of long-term potential with XR, but I don’t think we’ve figured out the “killer app” yet. We’re still in the phase where people are experimenting and building stuff that’s not useful.

Analog technologies will continue to grow in popularity.

Rationale: During the late 1800’s and the 1900’s, people began to go to the woods for recreation. This was a reaction to urban life of the time. The urban populace wanted to get away from the concrete jungle. As cities incorporated more green elements (parks, gardens, etc…), the desire to camp has flattened. As technology advances, people tend modernize past activities into modern forms of recreation (camping, hunting, hiking, fishing, etc…). The current trend towards analog books, vinyl records, and table top board games is an offshoot of this broader trend.

3-4 Major cloud service providers will reach feature parity and crowd most of the other contestants out of the market.

Rationale: Most major technical markets tend to settle on 3-5 competitors. Every major technology category tends to have a large number of competitors at first who get acquired or go out of business. Cloud providers will be no different. AWS is the current champion, but I think Azure and Google will also be in the top three. I also think each cloud provider will copy the features of its main competitors so there’s not a huge difference between platforms.

The Bitcoin / crypto bubble will burst, but prices will be higher than they were before the bubble.

Rationale: This has happened several times before and will likely happen several more times. The end game will either be crypto stabilizing at high price or tanking. I’m guessing it’s going to eventually stabilize.

Crypto-currencies will move away from proof of work algorithms because they consume too much power.

Technology 5-10 Years Out

XR will become commonplace as people figure out what to do with it. Augmented reality glasses will replace cell phones.

Self-driving car technology will mature, but won’t be commonplace due to regulatory issues

There will be a 1 trillion-dollar tech company.

The market capitalization of social media companies is going to tank

Rationale: The centralized nature of the big social media companies has led many people to criticize them.  They are a huge target for anti-tech criticism. Social media in general will fall out of favor as more people learn about the abusive practices of the social media companies. Once enough people leave the network, it’ll trigger a spiral where the whole network tanks. Look at MySpace for reference.

Social media will fragment as people realize that they don’t want to be exposed to the whole public.

Rationale: Our society is becoming increasingly polarized while major social media companies are creating arbitrary content filtering policies. Platforms like Discourse and Diaspora allow people to build decentralized communities that can cater to their users needs.

There will be a wave of rapidly falling prices on things that were once labor intensive as AI makes labor far more effective.

There will be at least a few big crypto bubbles before crypto-currency settles on a stable valuation.

Bitcoin will lose out to another crypto-currency like Ethereum or Litecoin.

Rationale: I think Bitcoin is the Apple Newton of crypto-currencies. I think that other coins are going to innovate past Bitcoin and render it obsolete.

Analog and digital will merge due to technologies like 3d printing and the Internet of Things.

Rationale: Things that are analog will become digital and digital things will be able to become analog very easily. A big part of why analog product are succeeding in the modern age is because of technology. Just as cars and lightweight materials made camping a recreational activity, things like easy customization through automated manufacturing and platforms like Etsy will make analog products more appealing. The Internet of Things also gives us the ability to embed intelligence in our analog items.

The web will decentralize as a response to abuse by large technology companies.

There will be at least one major industry shock on par with the financial crash of 2008.

Rationale: At least one highly regulated industry will melt down. There are several industries that have consolidated power and become ossified over the past few decades. Government regulations tend to push industries into a consolidated oligarchy because larger companies are more able to bear the cost of regulatory burdens. When there aren’t many competitors to pick up the slack if one company fails, the whole industry becomes fragile. That fragility exposes the industry to “black swan” events that can cause major damage. Candidates for explosion include: banking (again), telecom, energy companies, and health insurance.

10+ years out

AI and other automation technologies will trigger major political shifts within the next 10-15 years

Self-driving cars will be commonplace in 10-15 years

Rationale: The technology is close today, but cultural and regulatory factors are going to slow down the adoption of self driving car technology.

Major medical breakthroughs will increase health-span and lifespan

Rationale: Life expectancy will climb to new highs and retirement will be a financial goal as opposed to something that happens due to disability. This has major political implications as social security will become even less viable.

Basic income will be standard in most industrialized countries.

Rationale: Technology creates asymmetric effects where small numbers of people can command extremely high amounts of wealth. Technology can also melt down entire industries and leave lots of people scrambling for work. While I think that we won’t have the crazy waves of unemployment that most tech skeptics portray, governments will need to simplify their welfare systems to account for people having to take regular career breaks to retrain in new skills.

The American University system will be replaced by new technology enabled educational processes

Rationale: The American university system has ever-increasing prices for ever decreasing value. Getting a college degree used to guarantee a well-paying job. Now it only guarantees a large amount of debt. People are going to look for more vocational skills training along with shorter times to marketable skills. Since people will likely be retraining several times over their careers, traditional institutions won’t be able to keep up. The technology industry is almost there today. Platforms like Pluralsight, Udemy, and Safari allow technology professionals to constantly train in new skills.

Prognosis: The Future is Tricky

While it’s fun to make random speculations about the future of technology, it’s an important skill to be able to predict major shifts and prepare for them in advance. I’m sure I’ll come back to this post in a few years and have a good laugh at some of these predictions.