posted 1 day ago · 6 minutes read
Recently, an opportunity that would have me spend much more time with C# than Ruby has presented itself. After a bit of pondering, I decided to jump in. Oh boy, did I miss many things in the past years!
Ruby is a fantastic language. Probably the one which I am the most proficient with at the moment too. I love its community, its syntax and the many frameworks (Ruby on Rails, for example) built on top of it. Its package management system (the famous Gems) is second to none.
I don't intend this blog post to turn into a flame war bait so if you are a hardcore Rubyist with a narrow vision, please refrain sending me hate mails.
Ruby has a few downsides too. At first, I didn't see them because I was working on small apps with small code bases. When I moved onto larger projects (+300'000 lines of code), they became more and more apparent. This is a list based on what I witnessed. I know that this is a heated topic with a lot of people having very strong opinions about it. I am not trying to start a debate about Ruby vs C#. It would be pointless, there are only right tools for a given job and sometimes, it's Ruby, sometimes it's C#. This is only based on what I noticed and what increased my costs as well as the time I spent coding and debugging rather than devising new features.
Undefined method '' for nil:NilClassanyone?). This can considerably slow down your development process.
I noticed that the time needed to move from the idea phase to the production phase for small projects is increased by orders of magnitude using Ruby. Look at this blog: it took me less than 40 minutes to build it and publish it.
When working on larger projects, it is not so black and white. The increased debugging time, the more tests needed to be written, the lack of candies like Visual Studio's IntelliSense, the lack of auto-documented code, etc... can easily slow down a project immensely.
Individual productivity is also not correlated to team productivity. You can develop faster in your corner but have a hard time working together because of some of the shortcomings of a dynamically typed language.
Over the years, C# and the .NET Framework have gone through major updates. Generics, asynchronous methods, lambdas, LINQ, Entity Framework, ASP.NET MVC and dynamic type to name a few. A strong and mature package management system (NuGet) built right in the IDE also brings a measurable productivity boost. On top of that, Visual Studio 2013 (the first VS version dates back to 1995) is designed to help developers do things faster.
I'd argue that even for small projects, somebody who is fluent with C# can achieve the same level of productivity someone can have with Ruby. Of course, that requires some heavy learning.
In some groups (mostly in the tech startups scene), the .NET ecosystem has a bad reputation. It is often regarded as a subpar technology, owned by evil Microsoft and only used by greedy corporations. Yes, the community comes with a fair share of incompetent coders (but which technology doesn't have them?) and it is often the platform of choice of financial mega-corporations which are not known to be a hotbed for innovation. Many companies are also trying to feed .NET developers with expensive, often useless, proprietary libraries that previously mentioned mega-corporations seem to have an endless hunger for.
Take this noise out of the equation. Remove the corporate architecture astronauts. Keep in mind that Microsoft is not evil and is strongly responsible for the tech world we live in today. Stay pragmatic and focus on the task at hands. You'll find that you are left with a fantastic and modern language designed to be used in conjunction with a beautiful and comprehensive framework that can solve most of your coding-related challenges.
As said before, a newcomer will need to do a lot of learning before being proficient with C# and the .NET Framework. Today, a lot of startups founders turn to Ruby (and Rails) as a) it is very easy to start hacking a basic MVP after a Rails crash course lasting a couple of days, with no prior experience b) some very successful startups used Rails and therefore spawned a mimicking syndrome. It doesn't mean .NET is not a good technology.
I kinda left C# in the back seat for the past two years, missing out on several new features and forgetting a lot of things too. As I'm taking on a challenge that is heavily .NET oriented (ASP.NET MVC 5, Entity Framework, WCF), I will have less time to start new Ruby projects. I need to get up to speed with C# and re-learn some (sometimes trivial) .NET concepts. For example, today I learned that
static constructors exist in C# (and it seems they have been existing since 2005!).
I tend to memorize things better when I write them myself with my own words. I plan on publishing a few recipe-styled posts on this blog with a focus on both C# and .NET. This will help me and maybe, help you in the process.
This is a side note but worth knowing about. Where I live, in Switzerland, Ruby is nearly non-existent. There are truckloads of job opportunities or contracting opportunities (I didn't say interesting, only truckloads!) for good .NET developers. There are close to none for Ruby/Rails developers (I have seen 1 in my area in 12 months).
Although many advocate remote work positions in the (mainly US-based) tech world, I have yet to see one of them hire a Switzerland-based Ruby developer!
posted 24 days ago · 4 minutes read
Let's say you are building or just launching a new product or service most so-called experts will tell you that you absolutely need a presence on major social media platforms such as Facebook and Twitter. Is that really effective, though?
Imagine that Blizzard announces its new game on its Facebook page, Microsoft tweets about a new version of Office or Led Zeppelin says that they are embarking on a worldwide tour on Instagram (do they even have an official Instagram account?). The impact would immediately be huge and hundreds of thousands, if not millions, of people would know about it within minutes.
Now, try to tweet about the imminent release of the product you've been slaving on for the past years to your 53 followers. What do you think the impact will really be?
Why does it work for them and not for you, then? One and only one thing: people already knew about them before following their social media presence. What will make a high profile company tweet successful is that it will be picked up by news outlets and that the information will then be spread by them. It will only reach their most engaged and dedicated customers in the first place.
If you didn't achieve "well-known" status (and the definition of well-known differs from person to person), chances that your status update will become massively shared and retweeted until the web implodes are close to non-existent. Yes, but what if my status gets shared by 10 friends and for each of them 10 of their friends share it and... No! It doesn't happen. Period. (and even if it sometimes does happen, you can't really count on that as a strategy).
There is no strategy. No magic bullet. No books you can read about that. Nobody you can hire to make it happen. No tool to help you achieve this. Even though there are many on the market. If you really want to know, you can read a detailed article (including metrics) on how we broke the 1,000 subscribers milestone with no budget. Spoiler alert: it was not by using social media and it involves grunt work.
What you first need is a product. Not an idea of a product on few slides. Something tangible people can try. Maybe announcing ideas or private work in progress products work for well-known companies, for you it won't. Your social media strategy starts by building something without spending time on social media that would just steer you away from... ...well spending time on your product.
The next step is to build a core audience around your product. Again, social media can only do little for you at this stage. Oldschool forums, communities and specialized blogs will help you. Use these to redirect people to your product's page (in a non spammy-way but instead, as part of a community with a solution to a given problem) where they can sign up for your email newsletter.
Emails are a thing from the past, right? Think again. Weigh the people who opt-in with their personal email address on your website versus people who clicked "follow" or "like" in the hope you'll follow them back. Which category is the most important? Get it?
So, once again, forget the whole "we ride the social media wave like Miley Cyrus rides a wrecking ball" thing and concentrate on your product and its real audience. Send a newsletter when you really have something to say.
Of course, you can have a Twitter account and a Facebook page to relay the news, it won't hurt. But it won't help at this stage and should definitely not be your primary communication outlet. Your emails and your website are.
I've had experiences with various products I made (LinksWeaver, Qwikast, RailsBricks, etc.) all leading to the same conclusion. Right now, we are conducting a private beta phase for HowToCode.io. We have about 600 followers on Twitter. That's not even 5% of the people who signed up on our website with their email address. Registrants come from places where we think our core audience hangs: coding forums, subreddits on education and web design, etc. Not even from Hacker News which is too general nowadays. We even chose to close our Facebook page at the moment. Too much time spent updating it when this precious time could be used building something awesome. We'll reconsider it if we reach the status of "well-known".
+90% of the applicants for the beta phase came through clicking a link in our newsletter even though we announced it through Twitter and that it got retweeted.
We keep our Twitter account because we have a few very engaged people following us but according to our analytics, they first came to our site and then started following us. Not the other way around.
Use social media only if you can afford the time you will spend on it. Be careful, though. Even if you have time now, as you are nearing launch and right after launch, you will have much less time. The reasoning behind this is that if you choose to have a social media presence, you need to keep it updated as even though it may not bring you new customers at first, an outdated presence (for example, last tweet dating back 2 months ago) can deter those who are following you from using your product if they think there isn't anyone behind the product.
As far as your product is concerned, use social media to find a core audience by following thought leaders and looking at their following but don't use them thinking that magically, it will build a core audience for you.
posted about 1 month ago · 8 minutes read
I was recently asked to develop a small native app for Android. Being mainly an iOS user and occasionnally dabbling with Windows Phone 8 (don't laugh, I really wanted to like that OS), my first challenge was to find an Android device I could use as a test device.
As I need to make sure the app works on older devices, I couldn't go for one of the latest high-end models. Instead, I chose a Samsung Galaxy S3, a phone released in May 2012. In 2014, this device still has a large user base worldwide and although it was a premium phone when it was released, today it is a great mid-range device.
This article has one purpose: highlight the differences I found, workarounds and pitfalls for the regular iOS user that I am, coming to Android territory. Leaving the Apple walled garden for the realm of the Google overlords is less painful than I initially thought. Also, to get used to the Android way and get a feel for its UI paradigms, I decided to use the S3 as my primary phone for a while and leave my iPhone 5 at home.
Also, my thanks to Neil for bearing with me while I'm adapting and for answering most of my many stupid questions.
There are many things that I like on Android:
I also have a few gripes with Android:
The first thing to understand if you come from iOS, is that there are many flavors of Android. Not just different themes, icons and colors but different OS'es. Android is based on Linux and just as there are many variations of Linux for your computer, there are several variations of Android for your phone. On top of that, there are different UI layers depending on the version. To make a parallel with Linux, think Unity vs Gnome vs KDE, etc. On Android, this would be Samsung's TouchWiz, HTC's Sense, etc. Oh, and of course, there are also different version numbers for each distribution of Android, think iOS 5, 5.1, 6, 7 (and as of today, 7.1).
Not all distributions, versions and UI layers are compatible with every device but most of the apps from the Google Play store (Google's App Store) run on most of them.
When you get an iPhone, you take it out of the box, you choose the language, enter your Apple ID and that's about as far as setting up the device goes. Except sorting the icons and changing your wallpaper on your home screen, that's also as far as customization goes. It's Apple's "it just works (as long as you use your device the way we want you to use it)" at its best.
Unpacking my Galaxy, I chose the language, entered my Google ID credentials and my device was set, using the brand theme from my mobile operator (Swisscom). As it is a Samsung phone, it comes with an interface layer called TouchWiz. You can't get rid of it if you decide to use the stock Android version that comes with your phone. It's tightly coupled with your device's flavor of Android. It's a bit awkward at first as there are about 5-6 empty screens you can flip through.
On iOS, when you install an app, its icon will be automatically added to your home screen. Not on Android. It will go in your App Drawer. The App Drawer is usually symbolized by an icon representing an assortment of little squares at the bottom of your phone. What you see on your home screen is completely customizable. You can add only the icons you want to see when you unlock your device and leave those you use less in the App Drawer. Think of it as your Windows desktop vs All programs in your Start menu.
Your home screen can also display widgets. Widgets are small dynamic apps living on your home screen. There are widgets for clock, calendars, weather info, news, calculator, music player, shortcuts to settings options such as wifi on/off, etc.
Just the same as with iOS, the bottom of your screen will display a Dock. It's the one line of icons that will be shown on every pages of the home screen.
The combination of home screen + Dock + App Drawer is known as the Launcher. You can install a different one, we'll see how a bit further.
To install an app, you visit the Google Play store, search for one and tap the install button. To uninstall and app is a different process than on iOS. You need to go to
Settings -> Apps -> Downloaded and from there, tap on the app you want to remove to open a menu where you'll find an
Not difficult but I tried to uninstall apps the iOS way by keeping its icon pressed for a few secs in the App Drawer. That doesn't work and instead will add the app to your home screen.
Depending on your launcher, adding and removing apps and widgets on your home screen will be a bit different but a common way for adding is to keep pressing an app's icon in the App Drawer and it will add it to the home screen where you can then set its position. To remove it from the home screen, you keep pressing its icon and drag it at the top, on the
x remove area.
Unlike iOS, if the Android version that came with your device is not suited to your needs, you can decide to change it. My personal main reason is that I really don't like the Samsung TouchWiz. It also doesn't have a Swiss-French keyboard layout (QWERTZ) and only a French one (AZERTY).
Of course, I could have installed a 3rd party keyboard app to replace the stock one (yup, that's the kind of things you can do on Android) but that wouldn't fix my dislike of TouchWiz.
Let's see how this is done but before you try it, know that it will most likely void your warranty! I'm a rebel, I void at least 3 warranties before breakfast so this didn't stop me.
The first thing you will need to do is to enable
root access to your device. Having root access means that you can do stuff that are normally restricted. If you want to learn more what that means, read the Wikipedia page on root access.
The process is different for each manufacturer and device. For example, if you have a Galaxy S3 i9300, Google
Once you have enabled root access on your device, you'll need to replace the default recovery software on it. I used ClockworkMod Recovery. This will allow you to make full backups of your device, including the current Android version. Always do a full backup before changing the OS.
Aside from allowing for complete backup and restore capabilities, ClockworkMod Recovery is also used to install other versions of Android on your device.
After reading a bit, I settled for CyanogenMod 10.2. It is based on Android 4.3 "Jelly Bean". I actually tried an unfinished version of CyanogenMod 11 (Android 4.4 "KitKat") before that but it was too buggy and as a long-time Apple user, I'm not used to having a buggy phone.
Usually, a ROM comes as a zip file. Don't decompress it, simply copy it on your SD card.
For licensing reasons, Google apps don't come bundled with custom ROMs. You have to get them separately if you want them. That includes GMail, Google Maps, etc... ...but also Google Play which you'll need if you intend to install apps from the Google app store.
Of course, you can totally opt out from installing the Google apps and live happily with a Google-free phone. It's just not convenient because Google Play remains the primary channel to get new apps on your phone.
I won't detail the steps to install your new ROM on your phone as there are too many variations of it. You'll need to read the doc for your ROM/phone to get the exact step but it roughly involves these steps
Now, you should be running your custom ROM on your phone. It's time to customize it. Here's a list of the apps I installed on mine and below, a screenshot of how my S3 now looks like:
That's the result:
I didn't comment much on the Galaxy S3 device as my interest is Android, not the hardware. But to make a long story short, let's say that it feels like a bulkier copy of the iPhone 3GS.
I will now take it from here and continue my exploration of the OS while I'm working on developing the app that started this whole Android thing for me.
posted 3 months ago · 4 minutes read
My daughter reached a stage where she needs to start thinking about what she wants to do in her life. Her school has a program that focuses on helping students choose a suitable profession. She's a little bit ahead of the proposed activities as she's bent on learning how to code and become a software developer although that may still change. How many of us are working in the profession we thought was right for us when we were 13 years old?
As we were talking about what was required to become a programmer, she asked me one simple question: why do I like coding so much?
It may sound silly but at that very moment, I was not so sure what to answer except because it's cool and I love technology. Obviously, that answer is a bit too simple so, as I write, I'm trying to have a coherent thought process as to why I really love what I do (and oh, believe me, even if I find it hard to describe, I really do).
First, I have to figure out where this coding thing started. Why did I simply start doing it instead of getting into something else like cooking, design or being a car mechanic.
When I was a kid, I loved one thing above all: video games. These were the days when the Commodore 64 briefly dominated the market and many games were produced for it. Expensive games which my parents couldn't afford. But we had one Commodore 64.
So, I simply decided I could create my own games. From the perspective of an 8 years old kid, this plan seems perfect but in reality, I was lacking several skills, one of them being programming (doh!). I picked up a book on Commodore BASIC that came with the computer and started to read it. I'm not sure about how much I understood but I remember clearly inputing this:
10 "WHAT IS YOUR NAME?" 20 INPUT A$ 30 PRINT "HELLO ",A$,"!"
...and my computer said
HELLO, NICO!. That was magic. Pure magic. It also was the moment where, unconsciously, I knew I'd be a coder.
My work is what puts food on the table but let's assume for a moment that money is not an issue. What would I do with all my free time? Just what I am doing today: sit at a computer and code. Actually, that's what I already do during my free time (1, 2, 3).
That doesn't explain why I love it, though. It just shows that I really like what I do.
Those who create stuff are the people I respect the most. Designers, musicians, engineers. Simply because they make new things that didn't exist before they created them. I had a period in my youth when I wanted to be a 3D artist but I can't draw. I wanted to be a musician but I have no gift for it. All the engineering schools I looked at where requiring an insane amount of maths knowledge and I suck badly at maths.
Still, when I was (and still am) behind my screen coding I get this overwhelming feeling of doing some kind of magic. That's my creative outlet right there: I build things and get the instant gratification of seeing them do something right before my eyes. I'm a digital alchemist: I receive matter (data) and I transform it into something else (output). Or that's how I feel, at least.
Being quickly bored with a task is part of who I am. I need an environment that constantly changes. I don't like doing the same thing twice. Programming answers this need. Being a coder is accepting that our universe is in a constant state of change. What you know today won't be wrong tomorrow but it won't be enough.
I've never really respected people who answer the question Why you do it like this? with Because that's how we've always done it. Programming is in direct contradiction with these people. You can't do something because you've always done it a certain way.
Feeling like a complete beginner and being amazed by some new technology, design pattern, framework or language is something I get multiple times a year! Sometimes, multiple times a month. I love the fact that within my domain of choice, I can be a constant learner.
Here is the answer to why I love coding: because I am easily amazed, because I can't imagine stopping learning, because I can build things on my own rather than being a passive user, because it makes me feel good. Whatever it is that you choose to do in your life, whether being a coder, a nurse or a carpenter, I wish you to feel the same way as I do about your job.
posted 3 months ago · 1 minute read
No need to
git clone inside your
user directory anymore. RailsBricks is now 100% made of Ruby code and available through
gem install railsbricks. The source is still available on Github if you feel like contributing.
Now, the next step for RailsBricks will be the inclusion of a plug-ins system. I started working on it already and will talk more about it soon. Stay tuned!
posted 3 months ago · 1 minute read
Make sure you have a version of Ruby equal or superior to
2.0.0 and use
gem install qwikcrypt. Nothing else needed.
require 'qwikcrypt' some_text = "This is clear text" encrypted_text = Qwikcrypt::encrypt(content: some_text, key: my_password)
require 'qwikcrypt' encrypted_text = "VF80w10EJiw5ZRKWTb7qBe%2B5jEztoO5NSGe1FHON750%3D%0A" decrypted_text = Qwikcrypt::decrypt(content: encrypted_text, my_password)
Additionnally, you can use
iv: as a parameter of the
decrypt methods to set your own initialization vector.
qcrypt -e(ncrypt)/-d(ecrypt) key source_file [target_file]
This will encrypt or decrypt a text file into the
target_file. If no name is provided for
target_file, it will be named
posted 3 months ago · 1 minute read
I try to automate as much basic work as I can with little utilities I make for myself, most of the time using Bash. When one tends to be used over and over, I rewrite it in Ruby and package it as a gem. The packaging part is typically something that can be automated, hence I made qwikGem.
The repetitive tasks in building a gem are the whole "create a gemspec", "add and sign a license file", "create the
bin directory structures", "add some common libraries", "git it", etc. That's what qwikGem does. A bit like
bundle gem would do but adds the parts I need and removes the parts I don't.
To install qwikGem, simply
gem install qwikgem. To use it, go to your working directory and type
qgem -n. Answer the few questions asked by the wizard and you're done. A directory named after your gem will be created with the correct structure.
posted 3 months ago · 1 minute read
Working on many different projects, I always use the same Git workflow. In order to automate some of it, I created a collection of Bash scripts. My collection has grown so I took the time to rewrite them in Ruby and package them as a gem for everybody to use: qwikGit.
Let me give you a quick example. If you are currently working in a
dev branch, are happy with your awesome new feature and want to merge it inside your
master branch, push your repository to your remote repository and then delete your local
git add -A . git commit "some message" git checkout master git merge dev git push origin master git branch -d dev
See? Much faster, less error-prone and gives you more time to code your fantastic app instead of dealing with source control basic tasks.
Displaying posts 1 - 8 of 59 in total
qgit -cmpinstead of a long serie of Git commands.