One year with Ubuntu

One year ago in a day similar to today I installed Ubuntu on my machine and started evaluating it. I did it not because MS Windows is a bad OS but because it is not available in the country due to political clashes and also because people tends to use cracked versions due to cultural problems. In the other side Ubuntu is not a very common OS but instead is totally free and legal.

I could not able to migrate my development tasks from Windows to Ubuntu because I'm a long term .Net developer. Also many of my clients/employers only want Windows. Instead I managed to switch to Ubuntu in my other daily tasks very quickly. LibreOffice replaced MS Office very easily. Internet browsing could be done in Ubuntu very easily too.

During the year I did my best to migrate all my tasks to Ubuntu. I found many alternatives for my previous Windows based applications like OrchardCMS and others. Also tried hard to bring APS.NET running in Ubuntu or learn Linux friendly software development platforms.

ubuntu

Today LibreOffice works perfectly for all my office requirements. Firefox, Chrome and Thunderbird for Ubuntu help me using Web and Email very perfectly. Gimp helps me editing images very good. I even had experiences with Inkscape for vector graphics. Integration with Windows is not bad. I can remote desktop to Windows machines just from my Ubuntu machine. Ubuntu can read FAT32/NTFS partitions good. All my previous MS Office files could be read and edited by LibreOffice too. Also my 4 years old child could use Ubuntu to access online games, play videos and music and even run games and educational applications like GCompris.

I learned many command line tools and terminal during the year. I even have an operational Ubuntu VPS live on Internet that is running WordPress, RedMine and Vtiger CRM very nicely. I do all maintenance tasks of server via terminal and it is joyful.

I have tried establishing software development environments on Ubuntu. Rails, Node.js and Java have been setup successfully. Even I was able to develop simple introductory applications with help of them and Sublime Text. It was a good experience but I still have doubts about choosing which of them to continue.

Choosing a new development platform for a .Net developer

I'm evaluating some programming languages to learn instead of Microsoft .Net. I'm a software developer with more than 10 years of commercial software development experiences mainly in Microsoft .Net platform. I have worked both as employee and as freelancer. Now for some reasons I'm interested to learn something new other than Microsoft .Net. Some of reasons are:

  • Moving to a new company may need knowing new programming languages and development platforms

  • Getting a remote job or project will potentially lead me to learn something other than Microsoft .Net

  • My own start-up projects and custom software development projects may be done easier and more agiler with help of technologies like Node.js or Rails/Ruby.

  • I have a passion on Linux and .Net is not fully available on it yet by Jan. 2016.

  • Moving to a new city or to a new country needs me to have a broadest skill sets.

  • I need to do something new!

My main experiences are in web application development specially in back-end. So I have developed lots of code and pages in ASP.NET Web API, ASP.NET MVC, ASP.NET WebForm and even Nancy. Also have experiences in WPF/MVVM and JavaScript.

It's near a year that I'm trying to switch to Ubuntu and finding a good alternative to .Net. First thing first I liked to have .Net in Ubuntu but it is not complete yet and it may need few years to be fully available and adopted by the community. I did a technical comparison between Ruby, Python and Node.js but in realty I need to make attention to job market too. A good software development platform is a platform that has good community adoption and good salary too.

Along this journey I tried to get my hands dirty with my favorite platforms with help of quick starts. Quick starts are good points to learn programming languages. A typical quick start learns you how to setup the platform from scratch, how to develop a basic application with it and lets you get acquainted with concepts and tools. I started with my most loved technology Rails/Ruby. Tried to get a bit deeper on Rails but after a while suspected is it a better to learn something that already can be used in my projects? So tested Node.js a bit.

Last week I thought twice about priority number 1, moving to a new company. Major IT companies in the country that mostly are in banking, financial and government field prefer Java for their projects. Many of their projects are enterprise level and no surprise they prefer Java over other platform. So after getting hands dirty with Rails and Node.js I got Java installed in my machine and built a simple basic hello world with Java, Eclipse, Hibernate and Play. Play felt very similar to Rails which Rails itself felt similar to ASP.NET MVC.

Playing with Java showed me that Java is not very strange for a long term C# developer. This sense was common when trying Rails and Node.js specially when regarding with Web development. Rails, Play and ASP.NET MVC are very similar to each other as they are base on MVC pattern. In other hand C# and Java are very similar languages with similar internal structures. Also Node.js is not very un-familiar for developers with front-end development experiences. IDEs of all this platforms are not very different at root. Batteries and equivalent components exists.

After all I concluded that switching to platforms like Rails, Node.js, Java, Python and PHP is not a hard or time consuming task for .Net developers that have enough software development experiences. It may be reasonable to wait for a job position or a development project then getting more deeper with desired platform.

Learning Rails/Ruby or Node.js?

It's a while that I'm trying to learn Rails/Ruby. As I'm a .Net developer by day, I didn't have enough time to learn/master Rails/Ruby. So learning it happened very slowly for me. During this long time I have more time to think about it twice.

For many reasons I'm getting in doubt that if it is better to learn js (or front end development or even Node.js) instead of Rails/Ruby? By now I have a live project mainly developing in js. This project tell me to learn js because it has immediate benefit for it. As a long term ASP.NET developer I've always feeling that I need to know more about front end development. Knowing just server side is not a good idea for today's software development. Single page applications is on trend for some years now. Even mobile software development is easier if knowing js/HTML5. A mainly js application using HTML5 could do many tasks like a native app.

And the last reason is that in Country's current market trend, Rails/Ruby development has no many fans. Teams and companies prefer to use .Net, Java, PHP and JavaScript. I think being a Rails/Ruby developer is less wanted that being a front end developer, a JavaScript developer or even being a Node.js developer.

Learning Node.js instead of Rails/Ruby has the chance that you can do something in the market with JavaScript while Ruby is a rare wanted skill. Consider that Node.js is more speedy that Rails/Ruby and like Rials is in trend for a few years.

Update: Read article Why The Hell Would I Use Node.js? for getting more information about Node.js.

Books/Resource for learning Ruby/Rails

There is a well known book on Ruby and another one for Rails. Both of them authored/co-authored by Dave Thomas. I thought they are good points to start. I started from “Agile Web Development with Rails 4th edition”. But I found it is a little bit simple for an experienced ASP.NET MVC developer. The book started near everything from base. For example it describes what html.erb files are and how they work. It also describes from scratch what is meaning of MVC and how directory structure is in a Rails projects. While all these information are very helpful but if you have been an ASP.NET MVC developer in past then this book is not suitable for you. Because already you know many of them.

 

Haven't read “Programming Ruby 4th” yet but I think this would more useful especially if you have no prior experience with Ruby. I believe it's better to start with Rails then when you need more info on Ruby go back and read more on Ruby.

 

A good resource for learning Ruby/Rails is Rails's official guide. It is more fascinating for web developers with some previous expreinces. Learning by this site is a bit quicker and needs a bit lesser time. It does not start with trivial subjects. It is like a concise reference. One lovely thing about this guide is that it starts database access very soon and has less things about Ruby itself.

Proper open source project to contribute and learn Ruby/Rails

One of approaches to learn a new programming language is learning by doing. When the target language is Ruby/Rails then there are many open source Ruby/Rails projects that may need contributions. As a long time ASP.NET MVC developer, diving into a Ruby/Rails project must not be a very hard work. One of good resources to find active open source projects that needs contribution is Github but a faster way is CodeTriage. It helps finding projects simpler and faster.

For a person like me there is some considerations to select a project for more investigating:

  • Prior familiarity with the field. I have backgrounds in developing software in categories of ERP, CRM, MIS, Accounting, CMS and Trouble Ticket systems.
  • Being a user of the software. For example Redmine is a plus for me because I’m currently using it as an issue tracking system.
  • Possibility of making money from the project. It include consulting services, localizations, custom developments, etc.
  • More people will benefit it. No doubt a music playing or photographing software is good for people too. But I think there are some other areas that have better impact on people. For example if a software or system can reduce traffic jam in cities or helps NGOs fighting poverty that will be more desirable.
  • Project characteristics. A project with high technical standards and welcoming people is always a good project to deal with.

With these consideration in mind I picked 4 primary projects from CodeTriage.

  • Ekylibre, Simple ERP for little enterprises. Developing mainly by European folks.
  • Fat Free CRM, Ruby on Rails CRM platform for Web 2.0 and beyond
  • Loomio, an open-source web application that helps groups make better decisions together. Developing mainly by New Zealander folks.
  • Grow Stuff, Open data project for small-scale food growers.

Among them, FatFreeCRM is most popular and active project. It has 2636 stars, total number of 183 pull request and 83 contributors. It also has 988 forks. Contribution in FatFreeCRM in addition to learning Ruby/Rails can help making money as it is a demand software in business. GrowStuff seems as a suitable project too. Despite it is not used in businesses as much as FatFreeCRM, it has a welcoming community. 635 total pull requests, 52 contributors and 201 total issues shows its diverse community of contributors.

Remote software development jobs

Software development job is from few jobs that can be done remotely. While demand for software development jobs are high in developed countries, software developers in under development countries can get jobs remotely and benefit from being a member of a more professional software development team and also benefit from noticeable difference between their original countries salaries and new salaries from remote jobs.

But being a remote software developer is not an easy task. First problem is trust. People usually can’t trust people thousands kilometers away from them. Language, communication and cultural differences are other problems that exists. If you live in some specific countries you also can have political and money transfer issues too.

BTW people do not stop and continue to find new ways to get remote jobs. It is important to have something to start with, a friend in a remote job position or a list of companies that are happy with remote jobs. Recently John O'Duinn has published a list of companies that their remote employees think they are remote friendly. Many of them are software development jobs. Among them, Jessica Card’s list is very helpful. Some companies of her list are familiar through Zapier’s amazing e-book titled “The ultimate guide to remote working”.

Trying new programming languages and platforms

With about 10 years of developing software in Microsoft .Net platform since 2005, I decided to try something new. Microsoft .Net, C# and ASP.NET are my good friend but I think they are not very fast in agile world and in fast growing startup demands. Also Microsoft .Net essentially require Windows eco system that is not free to use that can be problematic specially in countries that are sanctioned to buy legal licenses and is not rich enough to pay the prices.

As a mainly web developer I decided to gather more information on Ruby, Python and Node.js. They all have rich library of components and reusable components and batteries and also can be developed and hosted in a Linux machine. A good decision needed to me to get hands dirty and try them practical. My first try was Ruby/Rails. A small database driven web project was offered to me to evaluate and estimating the price. It was good situation to do it in Ruby/Rails especially I am an ASP.NET MVC developer and I was not un-familiar with MVC pattern. Finding good tutorials I started installing Sublime Text and Rails on my Ubuntu machine and exploring Ruby/Rails. The project I were offered to evaluate go cancelled finally but I learnt good thing about Ruby/Rails. Rails itself id pretty much similar to ASP.NET MVC. Controllers and Views (erb files) were pretty similar to ASP.NET MVC Controllers and Razor views (cshtml). Previously in an ASP.NET WebForms project, our team were using Castle ActiveRecord over NHibernate for data access. So Rails’ ActiveRecord pattern was also very similar.

Never had situations to try Python yet. Even I may remove it from my to-try-list. Because I see no business opportunity on it yet. In the other side I have a chance to install and use some portions of Node.js (npm) on my machine while trying AngularJs that will describe it later in this text. BTW as times go on I’m thinking that it’s better to wait for a new project or job position that needs or fits into a certain language/technology then try to learn and master it. This is mainly because my job position is not very stable now and may have changes soon.

As I’m deciding it’s better to learn a new language/tools when a new project arrived or a new job position is offered I started to try AngularJS as I’m offered to do sections of a web project in SPA style. First decision was selecting a good framework. Mine was AngularJs. Though Angular 2 is not finalized yet I decided to use it because our product is not very large and sensitive and will not be in production very soon. Using TypeScript over CoffeeScript was my second decision as it tied with Angular 2 and is very similar to C#. I guess I will use a little Angular 2/TypeScript in this project because main requirements of the project are satisfied with use of Angular routing module.

My journey is not finished here. I may try Perl too as my favorite help desk software, OTRS is written with Perl and a time in future I may develop some plugins for it.

Autofac vs Ninject vs Unity regarding OWIN

I have a WebAPI .Net application that used StructureMap as its DI. Recently I upgraded it to OWIN and Helios so getting rid of System.Web.dll
and so not having access to IHttpModule anymore. This project uses Entity Framework and it's important to manage DbContext life cycle correctly. Unfortunately that seems that StructureMap does not have proper life cycle for OWIN context. My StackOverflow question has been remained unanswered 6 days now. Also other people are trying to find a solution.

After all tries my team decided to replace StructureMap with a DI framework that has better integration with OWIN. There are many comparisons out there like this and this. But most of them are outdated and have nothing about OWIN. Whatever I learned from them is that Autofac is fast and easy while Ninject and Unity are slow. BTW I'm going to make a new comparison of popular DI frameworks Autofac, Ninject and Unity by myself. This comparison is done in Sep. 2015 and is based on their github and Nuget stats. All of them have support of OWIN.

  Autofac Ninject Unity
Comparison of .Net DI frameworks with support of OWIN
OWIN Support yes yes yes
Github Star/Fork 697/227 1313/374 73/5
Number of questions in SO 1781 3032 2556
Latest Stable Version 3.5.2/August 12 2014 3.2.2/April 02 2014 3.5.1404/April 22 2014
NuGet Downloads (latest version) 306232 390602 630456
Official Website http://autofac.org/ http://www.ninject.org/ github

All of them seems to be very simliar except that Unity has lower popularity in github that can be because of its shorter presense on Github. BTW this indicates that all these DIs are good enough and more investigations must be done by applying them in a real project.

Migrating from Orchard CMS to WordPress

Well, it may be a little strange. Migrating from a more universal CMS like Orchard CMS to a simpler CMS like WordPress is not a job everyone wants to do. There are several tutorials for migrating from WordPress to Orchard CMS but I found few on migrating from Orchard CMS to WordPress. One of guides I found was Ricky Smith's guide.

Orchard CMS is a .Net open source CMS. It has little community in comparison with WordPress. So has fewer themes, plugins and developers. Orchard CMS is also a bit complexer than WordPress. It only install on Windows server while WordPress can be hosted on both Windows and Linux. These were my reasons to migrating from Orchard CMS to WordPress. My website was not very complex, it contained three blogs with likely 500 posts, some 30 pages and a simple data gathering form.

I found that Orchard CMS's original Import/Export module is my best chance. Select Export tab then check “Blog Post” and “Data” options and finally hit “Export” button. A file named export.xml will be downloaded for you.

orchard-cms-import-export

There are many import plugins for WordPress. One of them that works well is “WP All Import”. With it importing data into WordPress from XML files is easy. First step is uploading XML file into it. Then specify if you are importing data into Posts or Pages. Step 2 is very important. Here you specify what section of XML file contains actual data. By adding filter options you tell the plugin what records must be imported. For me “blogpost” section had all data I needed. I used XPath based filtering mechanism to exclude some unwanted records.

wp-all-import

In step 3 you tell “WP All Import” what data field from XML belongs to what data field in WordPress. It is drag and drop. See following picture as a sample. Don't worry for mistakes. The plugin allow to go backward/forward in steps.

import-details

Following next steps you will import data from Orchard CMS to WordPress successfully. Notice that in this scenario I haven't imported comments. Enjoy your new CMS!