Skip to main content

Stepping out of my comfort zone, trying different languages and web frameworks.

For the longest time, I've been developing on the Microsoft technology stack, with MVC using C# for web application development, WCF for web services, MS SQL server for the database, and of course, Windows and IIS for the OS and web server.

But I then started asking myself... is this the best way to develop? What are some of the other languages and web frameworks like?  Easier? Harder?

I knew I didn't want to really mess around with PHP, just because I don't like how the code feels like spaghetti code of classic ASP.  Another reason for not going PHP is due to performance benchmarks.

Here's a neat site that shows how programming languages compare in performance:

I decided to try out the Python language, using the Django web framework thinking that it would perform fairly quickly due to the fact that it creates "compiled" files, but found that simple web pages rendered slowly.  This of course could be due to the Django framework slowing it down too.  However, I did really like programming in it and found that the MVC model closely matched that of Microsoft MVC making it fairly simple to transition.

I then started to read a lot of hype over the Lift framework, and it helped to have a big name like foursquare using it too. It uses the Scala programming language which I then started to practice with a few tutorials.  The source I used primarily for learning was this easy to follow eBook called "Programming Scala" written by Dean Wampler and Alex Payne.  Lift uses an interesting approach where you decorate your view with CSS classes and your code targets those classes.  The concepts really seemed nice on paper, but trying to actually use it is really hard with their poor documentation.  Many of the documentation pages still say "TODO" or "FIXME".

Getting back to scala... scala is a mix of functional and object oriented programming. By default, it uses the Java VM to run so the performance should be comparable to Java. The nice thing about it is that you can run scala on the .NET runtime.  It also seems to be getting a lot of hype so I thought it'd be worthwhile to invest some time to learn.  Not being thrilled with the lackluster documentation that lift has, I found another framework that runs on scala, which is the Play framework. Play originally runs on Java, but you can download the scala module and create a scala based project.

Play's current support (version 1.2.4) for scala isn't quite up to par with the Java support however, version 2.0 will be built for scala.  Play so far has been my favorite.  It does have a very similar feel to MVC, and the convention over configuration model made it really easy.  I looked at Struts and Spring MVC a while back and was turned off by how much configuration it required and the poor template engine.  Play MVC realizes that their is already a language built for the web which is HTML/JavaScript and doesn't try to hide that.  They do have a few helper methods for creating form elements and script references, but they don't create a bunch of non-standard tags for your markup unlike other frameworks.  Play's library make it easy to create comet actions, or web sockets for your web apps too.

Not to mention, the performance isn't too bad.  When combined with an alternative template engine such as "fastergt" or "japid", the performance is even better.

After doing some research, I think Play is going to be what I'm going to play around with (no pun intended) to expand my horizons and get a feel for a different product.  I am pleased with it so far.  Even though Scala is the big thing right now, the current version of Play doesn't have the same support level as it does for Java, so I've decided to use Java.  It's also easier to program in Java coming from C#.

As far as IDEs go, I've been playing around with a few different ones, primarily, eclipse, Netbeans and IntelliJ.  I've already used eclipse before for Java/Android development so I'm familiar with it already.  Netbeans was ok, but just didn't feel like it had all the features.  Finally, I was hesitant to try IntelliJ because it's not a free product, but I do like JetBrains (the maker of IntelliJ) because they make a great product for the .NET world called ReSharper. I gave it a try and I must say I really like it.  It has great intellisense (not sure if that's the term they use, but that's what it's called in Visual Studio), and it already has support for the Play framework. The support mostly consists of having auto completion for the template tags and having a built in Play console. I'm currently using the trial version, but hoping I will be able to get a free copy with their open-source license, or I'll probably just end up buying it at their discounted academic price.

I'll keep you updated on my findings.  If you have any other ideas or suggestions for other languages and frameworks to consider, I'd love to hear it.


Popular posts from this blog

Using the BIQU Hermit Crab CAN

I was recently offered to try out the BIQU Hermit Crab CAN.  This was great timing as one of my printers was down due to a bad thermistor cable in the cable drag chain.  I was in the process of removing the wiring and also replacing the drag chain to an open style which allows me to open up each segment and easily add or remove wires.   What is the Hermit Crab? The Hermit Crab is a quick change tool, which allows you to easily and quickly change out your tool. For example, you can change to a FDM extruder, or a laser engraver, or a cutting tool, or whatever you want. The CAN version uses just one USB-C cable (doesn't use USB protocol, just uses that style cable for convenience). The USB-C cable carries the data and power to the hotend. The CAN version has a bunch of nice features such as accelerometer, Neopixel RGB LEDs, and TMC2209 stepper driver. Current setup In this photo, you can see my current setup as I'm in the process of rewiring.  I've got an Orbiter extruder with

Leading zeros in SQL

So at work today, I ran across a SQL stored procedure called 'fixLeadingZeros' that has the below implementation. It's actually much longer than this since it does it for several columns.... and some columns have longer values. In other words, if the field is supposed to have 8 digits, it has 8 statements.  I couldn't help but to feel a bit disgusted from it and had to share it. UPDATE [SomeTable] SET SomeColumn = '0' + [SomeColumn] WHERE len (SomeColumn) =4 UPDATE [SomeTable] SET SomeColumn = '00' + SomeColumn WHERE len (SomeColumn) =3 UPDATE [SomeTable] SET SomeColumn = '000' + SomeColumn WHERE len (SomeColumn) = 2 UPDATE [SomeTable] SET SomeColumn = '0000' + SomeColumn WHERE len (SomeColumn) =1 UPDATE [Some] SET SomeColumn = '00000' WHERE SomeColumn ='' OR SomeColumn is null This could have been done a LOT easier.  If your goal is to update existing columns so that t

Debugging .NET Windows Service apps more easily

Here at work, I keep seeing a couple of my fellow developers struggle to debug their Windows Service apps that they're writing.  What they have to do is remove the service, install the new version of the service, start the service, then attach the debugger. If there's an error when the service first starts up, the workaround is to introduce a Thread.Sleep before it actually does anything, giving you enough time to attach the debugger. By default, you can't directly run the service from within Visual Studio. If you try, you get the following message: If you look at the code that actually starts the service, you'll see that it's not that different from a console app. By default, it looks something like this:      internal   static   class   Program     {          ///   <summary>          ///  The main entry point for the application.          ///   </summary>          private   static   void  Main()         {              ServiceBase [] Ser