Elegant Ruby: Code Quality Automated

Have you ever found yourself staring at photos of someone’s dog, cat, or kids, only to grind through a smile that’s not authentic? It’s a universal fact that we all think the things we do and produce are wonderful. The code we write is so witty! We’re like the fable of Jupiter and the Monkey; it doesn’t even matter if others scoff, we believe our creation is beautiful.
So how do we get objective with such a curse?! In what way can we protect ourselves from such bias? We could always ask our fellow developers, but is that effective? As fun as it sounds, even if you did, there’s no guarantee that they wouldn’t apply their own bias until your code reached some kind of median between the both of you.

Link: https://dzone.com/articles/elegant-ruby-code-quality-automated?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

What Is a Source Map?

These days web assets such as JS and CSS aren’t simple text files. Instead, they’re typically minified or come from a complex build process involving compiling or transpiling. For example, CSS can be generated from a SASS file. JS can be compiled from ES6 using Babel. These toolchains make working with assets easier for developers and make following best practices such as minification much easier. Yet, there’s a problem. What do we do when there’s an error? If there’s an exception in your JS and it’s minified, you will have short variable names which are all on one line and it’s impossible to see where the error comes from. Source maps seek to solve this problem.
What is a source map? At its core, a source map allows a browser to map the source of an asset to the final product. In our previous example of an error happening in a JS file, if the JS file had a source map, it would allow the browser to translate the location of the error to the original unmodified file on disk. Pretty cool.

Link: https://dzone.com/articles/what-is-a-source-map?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

I Know How to Code, I Can Code in Anything

Every time I talk to a recent grad I hear a variation of the phrase, “I know how to code, I can code in anything." This is, on the surface, true for some bits like boolean logic and loops. Where it starts to fail for me is when I need to leverage a language’s ecosystem. I’m a Ruby programmer at heart (for the last 10+ years), yet I’m being forced to write in other languages through my CS Masters classes at Georgia Tech. I know I’m a competent coder, but can I really "code in anything"? How much does skill in one language translate to another? First a story about not knowing a programming language. In 2012, I was working for Gowalla (THE major competitor to Foursquare). When the company went under, I started looking for a new job right away. I had two great phone interviews with another social networking company, whose name will be withheld for dramatic suspense. The team was small, but I talked to both founders and we hit it off.

Link: https://dzone.com/articles/i-know-how-to-code-i-can-code-in-anything?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Creating Configuration Objects in Ruby

There are many kinds of applications and many ways to manage how they behave or perform via configurations. Software is designed with default behavior built in, so some specific configuration is usually required before the software works (like a path to reach a dependency), or a default and possibly rudimentary implementation may run without it.
From system tools that can have a central configuration for system-wide settings to a local user configuration to perhaps a per project config, the layers of configuration and the means by which they are stored can vary greatly. The choices for how you implement a configuration object should depend on where and how it will be used.

Link: https://dzone.com/articles/creating-configuration-objects-in-ruby?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Rails Resource: Awesome Ruby

If you’ve ever searched for a specific gem functionality, you’ve likely sorted through reviews, forum posts, and articles detailing the specifics of each gem before settling on what to use. Before that, maybe you searched for “authorization gems” or “data visualization gems” to find out which ones you want to research further. You can skip that step by starting from the Awesome Ruby instead. This Ruby on Rails resource lists hundreds of Rails gems by functionality, in alphabetical order. It’s essentially a Rails gem directory, saving you a little time whenever you need to find a new gem to use.

Link: https://dzone.com/articles/rails-resource-awesome-ruby?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Understanding Ruby Metaprogramming and DSLs

A DSL, or Domain Specific Language, is a language that has a specific purpose rather than a general purpose, like C or Java. One of the most popular DSLs is SQL because it’s the standard for querying a relational database and its syntax is specific to activities such as sorting, filtering, and displaying data.
SQL falls under the category of external DSLs, which means it requires its own parser and implementation of all of the necessary components. Other examples of external DSLs are Gherkin, for writing feature files, Make Files, for building C and C++ applications, and HTML, for declaring webpages).

Link: https://dzone.com/articles/understanding-ruby-metaprogramming-and-dsls?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Dealing With Ruby Dependency Conflicts

Dependency hell: If you’ve done any significant amount of programming or system administration, no matter which framework you used, you’ve been there — you’ve found yourself bogged down in cross-dependency and package configuration issues.
While a certain amount of dependency resolution is a fact of life for most developers, there are tools that can help to manage it. How you ask? This article discusses tools designed to mitigate dependency conflicts for Ruby programmers including ActiveRuby.

Link: https://dzone.com/articles/dealing-with-ruby-dependency-conflicts?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev