Implicit classes
in Scala are an underused and oft misused feature. I
don’t feel that they are explained very well and have a bit too much mystery for
the beginner to grasp. I was playing around and thought it might help to show
the explicit syntax, to more easily explain the “magic” to someone.
I recently went on a domain name shopping spree. My favorite, my flagship, is Incompetent Ninja.
It wasn’t intentional, but the irony was so self evident. I had plans for the domain, but I think I just might leave the error page for my vanity. Fuck it.
So, I have moved on to Bareback Academy. This thing I want to do right. I’ve made it a project to attend to when I’m bored out of my mind.
I have end-to-end IPv6 from my desktop to my data center. I upgraded my home network. The HTTP servers are fronted by CloudFlare with mandatory SSL and, of course, IPv6 + SPDY + DoS protection.
I wrote a widget a few years back. Apple removed my hosted file storage, so it’s become unavailable and I moved it to GitHub. It’s always been free, despite the donation link that’s earned me $6.00 over several years.
It’s not great nor amazing, it’s just a simple tool that got me through a lot of work. Many complaints came from this widget, telling me that I should kill myself. Now the haters can send me pull requests.
A few years ago, after being bewildered by infinite loop problems and convoluted paging algorithms, I wondered why the PHP community hadn’t adopted iterator based looping and sunset the three-statement for-loop like Python.
Some of the resistance I encountered were arguments regarding memory efficency & performance using the range() function. These were the days where PHP lacked generators and yield statements.
In combination with PHP’s SPL, you can do some quite amazing things. For those that don’t know, SPL is the PHP “equivalent” of C++’s Standard Template Library. It offers generic algorithmic data structures, iterators and such. Following is a contrived example, using one of my own package supplied filters.
The real power comes from chaining, slicing, appending and filtering iterators together. Creating large batch sets of numbers together without any memory overhead.
Last I heard, it’s still a standard package in the SUSE Linux repositories. You can still use it, include the source I published in the article, or adopt the modern generator syntax… which does not work with SPL natively in this way.
Almost two years ago, I was using Boost’s PropertyTree library as a JSON serializer. It had a bug that included extra whitespace in the output, when disabling the “pretty” option. I submitted a patch.
I implemented it locally, to reduce bandwidth for a game title I was working on. The bandwidth savings add up, given the frequency of data refresh. It’s a simple fix.
It was finally merged to master five months ago.
I you work in C++ and haven’t tasted the Boost libraries, I’d highly encourage you to do so. Modern C++ doesn’t resemble old school C in the slightest. Some of my most favorite libraries in the world have been included in the C++11 standard.
This was done, and made possible, by Adobe’s FlasCC initiative. KIXEYE ported all of their ActionScript to C++ to run both on the client and server with a shared code base, during my multiplayer implementation project, that I lead. The game still runs in the Flash Player… with more explosions.