Results for “code”

Interesting links - Is logging a "code smell" ?

I was reading this article it raises quite an unexpected question - "Can we consider logging as a code smell"?

Clearly - the answer is more nuanced than that and whilst I do enjoy the event bus approach from the article - that seems like overkill for m ...

read more

The perils of writing request specs using concurrent-ruby under the JVM

When I write an API, though I'm not a hard core TDD practitioner, I do like writing specs - especially requests specs that test the whole stack.

Adding them into an API is fast and yields quite good results compared to an app with an UI where you have to use chrome-cli or phantomjs just to get near of that level but ...

read more

JRuby, RVM and Vim walk into a (performance) bar

I'm not sure why RVM is still my default Ruby version manager yet the issue at hand should be reproducible on rbenv too.

Let's add a bit of context to this: we have an API written in Ruby and running on JRuby i.e. via JVM which implies slow start-up times compared to CRuby (yes, even with export JRUBY_OPTS='--dev' ...

read more

Programming archaeology: PHP's dollar sigil

I started out with Java as my professional language and before I discovered Ruby, PHP was my main programming language of choice for new projects. This was probably six to seven years ago or more. I had some pretty good times with CodeIgniter [0] and various libraries like HHMVC [1].

In any case, I digress - even ba ...

read more

macOS Sierra upgrade from a developer's perspective

Most developers (myself included) usually wait for the point one release of the next major macOS upgrade. This is mostly in order so that all the related tools/applications maintainers will have time to upgrade and iron out their bugs/issues with the new OS.

Since I use my Mac mostly as a glorified *nix replaceme ...

read more

Using RVM for quite some time? You should clean it up a bit

I can't even remember the last time I ran rvm implode, I'd reckon I've been using RVM for about three years.

Sure: I always update it via rvm get stable but I never really clean up old Rubys or gems, I only run bundle clean --force in each repository from time to time since I don't always use bundle exec.

...

read more

Shedding some light into UUID version 4 in Ruby and Rails

Ruby's standard library and Rails's PostgreSQL adapter use by default version 4 UUIDs. This can be changed in Rails migrations via:

default: 'uuid_generate_v1()'

param whereas Ruby's stdlib only supports version 4.

Another interesting difference is in the implementations:

In the Ruby's s ...
read more

The half-life of a programmer

>Half-life (t1/2) is the amount of time required for the amount of something to fall to half its initial value. The term is very commonly used in nuclear physics to describe how quickly unstable atoms undergo radioactive decay, but it is also used more generally for discussing any type of exponential decay.

I had thi ...

read more

Improve Rails performance by adding a few gems

Working with Rails for some time you start nitpicking on how to improve it. This is a first in the series of articles regarding on how to improve (even marginally) Rails's performance.

I'll focus on a bunch of gems that speed up, in some cases considerably, small parts of Rails, like the html escaping, the String#bla ...

read more

Is Rubinius 2.2.3 production ready ?

Ruby 2.1 was released this Christmas, great news everyone! It sports a better GC (RGenGC - gerational GC), hierarchical method caching, some small syntax changes and non-experimental rafinements. All in all one can expect 5% to 15% performance increase which is quite awesome.

As I was reading the comments in the hack ...

read more

How to reduce the size of your VMs

As the host OS I use Windows 8 (just upgraded to 8.1), well why ? one might ask.Is rather simple: Steam and after some dreadful searching and configuring tools I managed to install the basics for writing and deploying code: Vim, Git, PuTTy and a decent console replacement like Console2 [0].

Of course those aren't eno ...

read more

On Ruby modules and concerns

Modules are useful for highly specialized code that can be injected into other classes for fun and profit or for creating Namespaces. An interesting approach is to use modules as an alternative to classical inheritance (without its the usual trade-offs) : the core idea is to share an abstracted role that can be inclu ...

read more

On semantic Ruby block constructs

I was cruising around my Github notifications and I found an interesting open issue created by Jim Weirich : “The Semantic Rule for { } VS do/end” in the Ruby style guide repository .

>The semantic rule says use { } for blocks where the primary purpose of the block is t ...

read more

On font rendering consistency across browsers

Back in the day (i.e. when Firefox's version was a single digit) font rendering was at its best on Mozilla's browser. I remember comparing Firefox's anti-aliasing to the new-kid-on-the-block Chrome : the difference was huge.

Time went by and we all know what happened : most web developers found themselves using Chro ...

read more
Next page