How To Write Code With Style: 7 Tips For Cleaner Code

Code is communication. It has two audiences: the computer, and the future maintainer. How we communicate with the computer is rather objective: you either gave it the instructions to do what you really wanted, or you didn't.

But people aren't so easy. As computer programmers, we channel our hopes, dreams, and moods into our writing. WordPress popularized the slogan "Code is Poetry". To me, it reads as a true statement.

There are as many ways to write code as there are programmers, and we all do it a little bit differently. There's beauty in this diversity, but it also makes it harder to be understood. And the harder it is to read code, the longer it takes to maintain and extend it. Time is money, so this is a bummer when it comes to building a tech business.

How can we effectively communicate with other humans when we're programming? Write code with style! In this post, we'll explore seven rules of thumb that you can use to write cleaner code.

Read More

How To Clean Up Your JavaScript Build With Tree Shaking

The world of JavaScript development can be frustrating and exciting.

Every day, new libraries and modules are published, and it can feel overwhelming to try to keep up. On the other hand, all of this change has its benefits. As a community, we're heading more and more toward an ecosystem that's easier to work in and reason about. We keep getting new candy, and it makes our lives better!

One JavaScript improvement that's been getting some attention lately is the idea Tree Shaking. What's that, you ask? Simply put, it's a way to clean up your bundling process by excluding code you're not using.

We all hate bloat in our projects. Unused code increases mental overhead and makes it much harder to understand what's going on. More importantly, it increases the size of the payload we're sending to users in front-end projects.

In this post, we'll take a look at tree shaking with JavaScript. What it is, how it works, and how to get started using it.

Let's create a cleaner build for your project!

Read More
Learn about Engine Yard
Try Engine Yard for your Ruby or PHP Apps

Docker Cookbooks on Engine Yard V5

As described in our V5 announcement post, Engine Yard now supports Docker.

When designing support for Docker in our custom Chef cookbooks, we decided to build on what the Chef community has already built.

The Docker cookbook in the Chef Supermarket provides custom resources to define how your instances will run, download, or build Docker containers. This makes it straightforward to deploy Docker containers into your utility instances.

To see how straightforward it is to deploy Docker on Engine Yard, check out our collection of sample Docker recipes.

As part of our work on this, Engine Yard also gave back to the the community. We created a new custom resource to install the latest binaries from the official Docker tarball packages. This allows you to utilize the latest versions of Docker without waiting on Engine Yard's hardened Gentoo portage tree.

To install a new version of Docker, just add this to your Chef recipe:

docker_installation_tarball "default" do
  source "https://get.docker.com/builds/Linux/x86_64/docker-1.12.0.tgz"
  checksum "3dd07f65ea4a7b4c8829f311ab0213bca9ac551b5b24706f3e79a97e22097f8b"
  version "1.12.0"
end

For more info, check out our pull request for this feature.

Engine Yard V5 Adds Docker Support

We're thrilled to announce the Engine Yard PaaS V5 release!

This is a platform-wide upgrade that comes with a long list of new features, the latest versions of Ruby, PHP, NodeJS, and much more.

In addition, once you've written your application in the language of your choice, you can choose to deploy it on our new Docker infrastructure.

Why Us?

Engine Yard is ten years old. For a decade, the support team at Engine Yard has been taking care of application developers like you. Twenty-four hours a day, every day of the year, Engine Yard provides deep engineering, database, and operational support to thousands of customers.

We believe in what we do, so we measure 100% of our support calls and publish the results publicly on our web site. With over one billion AWS hours run on Engine Yard, we have proven we can get your software deployed fast, and keep it running successfully. Every time.

Here's what Charles Ju, CTO of PennyPop, has to say about V5:

"PennyPop has been using Engine Yard for several years now and we're very satisfied with their service. With Engine Yard, we can easily deploy changes across multiple instances with the touch of a button, which saves us tremendous amounts of time. The switch to v5 allows us to work much more effectively by providing us the ability to connect to the latest technology, including Postgres 9.5. Engine Yard also has superior customer service, which allows us to minimize troubleshooting time so we can focus our efforts on our game development."

Read More

Autoscalers the Hard Way

If you’ve been following along on the Deis blog, they published a post showing you how to build a custom Kubernetes scheduler with Elixir.

That post was inspired by a recent talk by Kelsey Hightower.

Kelsey also tweeted:

I would take this logic and apply it to autoscalers too.

While everyone doesn’t need to go and build their own autoscaler, it can be beneficial to understand how they work. And one of the best ways to gain that experience is by trying your hand at writing your own.

Read More

CHECK OUT OUR CURATED COLLECTIONS

Look through our specially curated posts to get focused, in-depth information on a single topic.