Coding Standards

Rules

When I look at code developed by other developers, one of the things I first notice is if the code follows standard coding conventions. For some languages, like Java, coding conventions are very standardized. For other languages, it’s a free-for-all. However, few things are more important to the readability of code than standard coding conventions. Image, for a moment, how important conventions are when reading a book. Capital letters start sentences, periods end sentences, and rules of grammar dictate the order of words. Similar conventions apply to code – variable names, function names, class names, spaces between symbols, etc. Why is this so important? Because when you look at someone else’s code, you expect to be able to read and follow the code. If the writer is using different conventions, it takes longer to read and understand the code. Then, if you edit the code using your own conventions, the code quickly becomes unreadable as every developer uses their own standards for different pieces. Ultimately, you should never be able to tell who wrote a piece of code since everyone should be following the same rules. And when everyone follows the same rules, developers can more quickly find and diagnose bugs as well as add new features. When I work with new developers, coding standards are among the first things I drive home!

Serving Customers

One of the most important things to most customers is customer service. And how do users rate customer service? Typically, by two criteria – the speed at which results are achieved and how satisfactory the results were. You can look at review websites for any product or service and see people complaining about one or the other. As consumers, we want what we want, and we want it now! Of course, there’s nothing wrong with that – capitalism encourages such a model.

But here’s the problem I see in my business – consumers who want something, but won’t communicate what it is they want. Or consumers who are quick to complain about an issue but won’t provide the information to resolve that issue. I have customers who will send me an email about an problem wanting it immediately fixed. But when I send email after email to gather more information, they are ignored. Then, the customer sends me another message asking if their problem is fixed. I have software customers who will report a high priority bug, but won’t tell me how to reproduce it and ignore emails from the ticket tracking systems.

Fortunately, the resolution to the problem is simple: If you want excellent service from the companies you work with, be prepared to offer excellent service to those companies when they are trying to resolve your problem. Otherwise, you only get out what you put in – and that’s not the fault of the company servicing your problem!

 

Free Speech

This time last month, the internet was buzzing with Net Neutrality. Nobody wanted commercial interests injected into the internet, because the internet should allow people to be able to access what they want without impediment. The strange thing is, the internet has never been a particularly neutral place.  Today, for instance, a video was released showing a Twitter engineer talking about what they do to block or “shadow ban” pro-Trump accounts or people who support the 2nd Amendment. Last fall, Facebook was similarly called out for how they curated their news feed as well as their trending news section. And today, the Pew Research indicated that the US media bias is the worst in the world. Of course, Twitter, Facebook, and the US media are all corporations that have a right to do those things. The problem is – it’s not even remotely neutral in any way. Neither Twitter nor Facebook are neutral organizations willing to allow free speech on their platform – both are politically biased, and have used their platforms to further their political agenda. So, the net never was neutral. If you want a neutral internet, fight the companies that create the bias. Hint: it’s not Verizon and Comcast.

Five Technologies for 2018

It’s a new year, and new years mean new challenges. And how can those challenges be faced? By staying up-to-date with technologies and ensuring you have the skills to turn those challenges into opportunities. But there are so many technologies out there, which ones do you learn? I have selected 5 technologies that I think everyone should learn in 2018. These are not necessarily new technologies. In fact, most of technologies listed have been around for awhile and I believe developers can no longer afford to ignore them.

Docker
For the last decade, virtual machines have been used to startup new servers. This work great, but is very wasteful of resources. Not only that, it’s very time consuming to both setup and configure. Docker is much simpler and less resource intensive. Want an Apache server, or a MySQL database? Start a Docker instance with that service. Need to experiment with nginx for a new project? Spawn a Docker server to tinker with your new technology. With thousands of images for a sorts of services, it’s likely that you can find what you need. I run my Jenkins and Artifactory services using Docker – it took minutes to setup and has been running for a year or more. There is simply no faster way to setup servers than using Docker.

Angular
The JavaScript world is in constant flux. Technologies come and go, and it’s hard to keep track of them all. As such, many are reluctant to dive too deep into JavaScript technologies for fear of their pending obsolescence when a new framework come out. However, if you look at job openings for web architectures, you will see over and over the desire for Angular developers. And there’s good reason for that – Angular is a great framework. The best thing about Angular, in my opinion, is how easily it is to write reusable components. In a world where businesses solve the same problems over and over, reusability saves time and money. Outside of the web world, Angular is also used by the Ionic framework for creating cross-platform mobile applications. Thus, if you know Angular you can not only develop cutting-edge web applications, but you can easily move into the realm of Android and iOS development.

Kotlin
This one is a bit more speculation the the other technologies on my list. However, since it’s supported by Android, I expect to see it grow in popularity this year with the possibility of overtaking Java in popularity for native Android development at some point in the future. The Android Developer page for Kotlin lists a variety of reasons to switch to Kotlin – including safer code, concise data classes and lambda expressions, default and named arguments (something very popular in a variety of other languages), as well as being fully interoperable with Java. Numerous JVM languages, such as Groovy and Scala, have failed to gain wide-spread usage, but Google’s support for Kotlin code in Android may just change the game.

Linux
Linux is anything but new. In fact, it’s been around for decades now. However, it’s sad to see how many people in the tech world are still uncomfortable with the Linux command line. With all the technologies available today that use Linux, it’s time to learn it now! What are those technologies? Docker, Raspberry Pi, AWS, Google Cloud, and Android, all use Linux. Mac OSX has, in large part, become amazingly popular with Linux-savy developers because it uses BSD (A Linux variant) under the hood. Countless other technologies run on Linux or simply run better on Linux. For example, setting up a LAMP stack, running Python, or setting up Node is a breeze in Linux – but can be far more painful on Windows. Connectivity tools such as SSH and SCP run natively too – making deployment and configuration of servers and services easier. If you’re not familiar with Linux, you’re probably working too hard to get your solutions working on Windows.

.NET Core
After just enumerating the benefits of Linux, it may be odd to see a Windows technology on the list. However, The .NET Core framework runs on non-windows machines – and that’s exactly why it’s great! Microsoft’s Entity Framework and their MVC implementation both make for greatly streamlined web development. Running it on a Linux server is icing on the cake. I expect to see growth in .NET Core this year as developers exploit the simplicity of .NET development with the control and deployment power of Linux and Docker servers.

Code Warnings

As a developer, I often look at someone else’s code. It may be a coworker, an open source project, or a code snippet on Stack Overflow. No matter the source, I often look at the code and wonder why something was done the way it was. That’s ok – that’s just part of being a developer. But some things make you seriously question the original developer’s technical prowess. For example, I was looking at some code today that was annotated to ignore all warnings. That’s a pretty brave move, as it assumes you know better than the computer does where problems may be. Reality is, you don’t. And when you ignore all warnings, you set yourself up for failure. For example, today I saw a piece of code with countless variables that were all context-specific in Android. When I removed the ‘hide warnings’ annotation, I saw countless warnings about how these variables would cause memory leaks. That’s pretty serious for a long running application, and it negatively impacts the user experience. Certainly some, in fact many, warnings can be safely ignored. But ignoring all warnings is a recipe for disaster.

Cheap Computers

Yesterday, I started up my spare laptop to load an Android Studio project. The laptop I normally use for this project was at the office, and I was sitting at home. I had to upgrade the version of Android Studio first, and then load the project. But, after over an hour, I still had not written a single line of code. On my Mac, I could have upgraded and had the project open and running in under ten minutes – but my old Windows computer is so slow it’s painful.

Consider the company you work for or the projects you work on. What is the cost of using slow hardware to your organization? What about to your productivity on your projects?

Many people look to buy a cheap computer for work and, indeed, a large number of companies do the same. Why spend too much on computers? Here’s why – when you buy a $500 machine instead of a $1,000 machine, you saved $500. However, during the lifetime of that computer – say two years – you will be less productive than on a more powerful computer that doesn’t have you waiting to work. Do the math and you quickly see that the $500 you saved in cheap hardware is dwarfed by the losses to productivity. If a faster computer allows you to work just a marginal 5% faster, that would mean that – during the course of 2 years – you would accomplish an additional 208 hours of work. (40 hours / week * 52 weeks / year * 2 years * 5%) Even at minimum wage, that comes out to over $1,500 dollars of additional work. Some may argue that the work they do doesn’t require a fast computer. That’s fine, buy cheap computers for those tasks. But for me, as a software engineer, the computer is often a limiting factor to my performance. And, I suspect many other fields are the same.

The power of the machines you purchase for your employees has a direct impact on their productivity. You may think you’re saving money with bargain computers, but long-term you’re losing far more in productivity.

Net Neutrality

Many are very unhappy with the notion of repealing Net Neutrality. Shouldn’t the internet be free of corporate interests? Shouldn’t we be able to have access to whatever we want without infringement on our rights by our ISP? But what about the rights of the ISP? Do they not have rights too? In our nation, the first amendment freedoms we enjoy apply to all – business and individual alike. As such, isn’t Net Neutrality an unconstitutional infringement on the rights of the ISP?

Let’s look at some other big issues over the past few years that share similarities with Net Neutrality. First, the case of the baker who did not want to bake a cake for a gay couple. The bakery argued that their religious convictions prevented them from supporting a gay couple in that way but the courts disagreed. This greatly upset Christian groups and other conservatives across the nation. They argued that the business’s first amendment rights were violated by that decision.  How about the revelation that Facebook was curating the news to push down conservative views and increase visibility of liberal views. Of course, liberals thought this was ok – after all, Facebook has a first amendment right under the constitution to engage politically. The arguments for birth control under Obamacare, and Twitter’s removal of conservative voices are more examples where many argued that it was unconstitutional to limit the free speech of businesses on both sides of the political aisle.

So, both the left and the right has agreed in the past that businesses should have first amendment rights. Now, with Net Neutrality, the American people are unhappy that those rights will be extended to internet service providers. But we can’t have it both ways – whether our political views are liberal or conservative – we need to find a consistent voice in determining what (if any) limits exist in the first amendment rights of corporations.

While I personally want my internet to be free from manipulation by my ISP, as a supporter of the first amendment I struggle how to say such a law is constitutional.

Quality & Service

This morning, I woke up to a light dusting of snow outside. I went to sweep the snow from the front steps, and ended up knocking a vertical bar off the hand railing. As the steps are less than 6 months old, this was very disappointing to me. I contacted the contractor and am waiting for a response. I wish I could say that was the only issue I’ve had with another organization’s quality or customer service this month, but I’d be lying. I purchased an annual subscription to an online news site only to find that their computers say my subscription started in March – instead of December – so my annual subscription will be due 3 months after I paid for it. Their support has still not responded to the issue. I contacted a university in Pittsburgh to get information on taking the HSK exam (Chinese language proficiency) and never heard back. A second university I contacted replied within minutes – with two URLs that were both wrong. And, for one more poor customer service issue, I have been unable to get Google to fix a problem with my account for almost two months now. The problem is on their end, it’s documented in numerous places, but all I am ever told is to upgrade to Silver support to have it fixed. I have to pay them more money to fix a problem that is on their end.

These stories are all just from this month. We live in a world where people have become lazy and sloppy. Quality is increasingly difficult to find, and support is often so bad we’d rather not even try. For me, as a software engineer, this is unacceptable. Every line of code I write – whether for my projects or for a customer – is written so that it can be maintained long-term. I take pride in the quality of my code and the applications I develop. I am more than happy to support the applications and code I write because I create a quality product. My code is a reflection of me.

When you’re looking for development resources for your projects, do they feel the same way? Or will you regret your decision this time next year?

Stored Procedures

Of all the technologies out there today, databases are among the most important. Boring as the idea may be, the storage of data drives the information age. Indeed, databases are as ubiquitious as the webpage itself. Order information from Amazon, posts on Facebook, content from WordPress sites – all stored in databases. Because of this, database management is hugely important – so much so that people work full time jobs in database management.

One of the technologies that databases provide is what’s called a stored procedure. Stored procedures are code that runs on the database to aggregate data, calculate information, perform business logic, etc. Many people love to put all kinds of logic in stored procedures so that they don’t have to rewrite the business login on multiple platforms. And, indeed, they can be useful at times. However, during my career I have grown to despise stored procedures.  Why? While stored procedures give the promise of simplifying logic on your application code, what they also do is increase the complexity of deployment and circumvent source control systems.

Since stored procedures are external to the application code, deploying an app is more complicated than simply placing an application on a user’s computer. Now, you have to first upgrade the database functions and then upgrade the application. No big deal, of course, since applications often require database updates. However, unlike table structure, stored procedures are more likely to change frequently in order to fix or tweak the logic. Thus, you end up with different versions of the stored procedure on different databases. Now, the same application will behave differently when running against a different database. This becomes a support nightmare. Is the issue a software bug, or is it a problem with the stored procedure? This leads directly to the second problem – no source control. Traditional application code is managed by source control systems. Every change is logged, and the history of the project can be observed for the entire lifetime of the project. Stored procedures are code applied directly to the database, and tweaks are often not entered in source control. Thus, you can’t easily revert back to a previous version since you have no record of it. This lack of history means we can’t see what other developers did and you have no idea why something was changed.

In my opinion, stored procedures often become the wild west of software development. For all the value they can bring, what I’ve seen them bring is additional bugs and confusion to the software process. When I work on projects, I will fight against the use of stored procedures unless an incredibly strong argument can be provided for their inclusion.

The Importance of Source Control

While professional programmers always submit their code to a source control system such as git, svn, or tfs; most hobbyists and learners do not. This is a huge mistake. I always encourage people to check their code into a source control system. But why? For the learner or hobbyist, there are a few big reasons to do so. First, as developers we often realize we’ve solved the exact same problem before. But when? Where? How? Having a repository of your own demo code gives you reference material for future projects all neatly stored away. Second, as that repository grows, and you mature as a developer, you may want to pursue a job in software engineering. A growing number of companies ask to see your GitHub account – this is a great way for an organization to see what your code really looks like. Start building that portfolio of code now! Third, source control serves as a backup for your code. When the project you spent months working on is destroyed because of a hard drive error, what do you do? If you have your code on committed to a source control system, you download your most recent copy and move on. Very little is lost. There are countless other benefits to source control, but these are some of the simplest benefits an up-and-coming developer can realize quickly. If you don’t have an account, go to BitBucket.org or GitHub.com and set one up!