Life as Code

refactoring my life

Archive for the ‘Development’ Category

cause and effect – more testing doesn’t necessarily improve software quality

with 2 comments

A short story about cause and effect I had in my backlog.

Jim works for a software company or, why not, he may even own it.

Jim realizes that the quality of the software that gets built in his company decreases year-by-year, all over the board. He’s been seeing it for some time now but it seemed like the guys have it under control. You know, the guys know what they’re doing.

After awhile things seem to slip even further….

Read the rest of this entry »

Written by Bogdan

October 17, 2013 at 11:49 PM

the best way to serve static files from Sinatra

with 2 comments

I’ve been using Ruby for a couple of years now, mostly for utility scripts (organizing family pictures, generating XML files, processing CSV files… it’s good for these types of things) and for web prototypes but lately I’ve started to get the taste of it.

Read the rest of this entry »

Written by Bogdan

January 24, 2013 at 1:19 AM

Posted in Development

Tagged with

what’s in a name: Single Page Application

leave a comment »

Just found out that there’s a name for the type of apps that we’ve been working on for the last couple of years. It even has a catchy acronym.

So, you know those RESTful API accessing, JavaScript + JSON powered, highly dynamic, limited HTML web apps that everybody is developing lately?

Those are actually Single Page Applications, or SPAs. There’s even a Wikipedia entry describing the 10 year history of SPAs.

The only good thing is that the page mentions thin server architecture, which is a big win, and probably the only thing that makes sense – the rest is just somebody misspelling AJAX driven web app.

Written by Bogdan

October 31, 2012 at 12:52 AM

Posted in Development, Fun

Comparing SaaS Cloud apps hosting and provisioning options

leave a comment »

This is what popped up while going through a thought experiment on choosing hosting and provisioning for the development of a new Software as a Service offering.

The options considered are:

  • PaaS with multi-tenancy – use a PaaS offering (think Cloud FoundryHeroku, Google App Engine and Windows Azure Compute) to host a multi-tenant system. Provisioning for a new client is zero-cost done inside the system
  • PaaS with one environment per client – use a PaaS offering (think  Cloud FoundryHeroku, Google App Engine and Windows Azure Compute) to host a regularly developed system. Provisioning for a new client means configuring a new PaaS environment, adding an instance and deploying
  • IaaS with multi-tenancy – use an IaaS offering (think Amazon EC2 or Windows Azure Virtual Machines) to run a stack of Virtual Machines configured to run your platform of choice, hosting a clustered multi-tenant application. Provisioning is zero-cost after initial setup
  • IaaS with one stack per client – use an IaaS offering (think Amazon EC2 or Windows Azure Virtual Machines) to run one stack of Virtual Machines configured to run your platform of choice, hosting a clustered (or not) regularly developed application for each client. Provisioning means creating stacks, adding virtual machines, installing OS, DB, platform and deploying application

For convenience I also added a category called UGLY, just to highlight what I consider to be the worst point of each option.

SaaS

Over PaaS with multi-tenancy

Over PaaS with one environment per client

Over IaaS with multi-tenancy

Over IaaS with one stack per client

GOOD

  • Application must comply with platform constraints
  • One version for all clients
  • Single location deployment
  • Automatic scaling
  • Simpler, faster provisioning
  • Simple monitoring at the application level
  • Looks cheaper, pay by CPU-time and resource usage
  • Application must comply with platform constraints
  • Allows for multiple versions at the same time for different clients (even deep customization)
  • Automatic scaling
  • Simpler provisioning
  • More control in choosing platform and technologies
  • One version for all clients
  • Can use farm-deployment for single location deployment
  • Simpler, faster provisioning
  • Simple monitoring at the application level
  • More control in choosing platform and technologies
  • Allows for multiple versions at the same time for different clients

BAD

  • Application must comply with platform constraints
  • One version for all clients
  • Application has to know about multi-tenancy – it should be designed to support it
  • Application must comply with platform constraints
  • Must have tight configuration management to handle different versions for different clients
  • Provisioning may be slower, depending on instance creation speed
  • Complex monitoring
  • Must handle horizontal and vertical scaling
  • One version for all clients
  • Increase in deployment architecture complexity
  • Must handle clustering and state
  • Application has to know about multi-tenancy – it should be designed to support it
  • Must handle horizontal and vertical scaling
  • Must have tight configuration management to handle different versions for different clients
  • Must handle different deployments and deployment scenarios
  • Complex monitoring

UGLY

  • Platform may enforce application architecture and technologies
  • Platform may enforce application architecture and technologies
  • Must manage operating system, storage and database configurations
  • Must manage multiple, possibly different operating systems, storage and database configurations

 

Some points are good and bad simultaneously. Examples:

  • Application must comply with platform constraints – which means that you can’t always do what you want to do, producing
    • GOOD – sometimes enforces good coding and resource-usage conventions
    • BAD – more effort in developing exotic things
  • One version for all clients – there can only be one version in production
    • GOOD – less versions to worry about, less things to manage
    • BAD – you may upgrade users that want the old version or you may have some users that want deep customizations and that are willing to pay for them

The overall conclusion is that the higher you go, the less you have to manage, the cheaper it gets.

For another good read you can check out the PaaS vs IaaS comparison on http://www.engineyard.com/paas-vs-iaas.

Written by Bogdan

October 29, 2012 at 11:35 PM

Users and their strange habits

leave a comment »

Users are strange creatures, and to demonstrate, here are some quick facts:

  • They want to achieve lots of things as fast as they can, without learning anything new;
  • They hate reading and avoid anything that resembles help or a user manual… or even freaking text boxes;
  • They want user interfaces that look like other user interfaces and that function the way that other applications function but that ultimately achieve a different goal;
  • They want things to just work.

Yup, strange creatures indeed. Who would have thought? Not us programmer types anyway.

None of these facts are new. All of them are known since the dark ages of computing. All of them are well documented and repeatedly demonstrated. It just seems that a lot of the things that we used to know and follow are now forgotten.

Users want well designed products that are tailored to their needs and that help them do what they want to do. Users  just don’t want to read the manual and they have  chronic dialog box blindness. For users, the user interface is the product so if you want them to use your product they need consistent and usable interfaces. Users need professionally designed, developed and  production-ready products that just work; not unfinished, buggy, wanna-be software.

Because users are ultimately our customers and because it is the right thing to do if we consider ourselves professionals that is what we must provide. Because that is what they deserve.

You can consider this post a small rant – just blowing off some steam after re-iterating some of these facts to a bunch of confused developers that think users are just plain stupid. They’re not stupid – we are just building software for the wrong people (rocket scientists that can read binary while unit testing in their sleep).

Written by Bogdan

October 9, 2012 at 10:32 PM

Replacing images and icons with CSS3 web fonts

with 2 comments

It’s really hard to create beautiful and clean web interfaces when you have to slice and dice images for every little button, action or highlight. Well, now you can replace them with web-font characters styled with CSS3 – as most browsers have support for them.

Here’s a sample from something I’m working on just to give you a feel:

Image

Wait, there’s more: using styled glyphs instead of images gives you more flexibility with application themes – and less images to mess with:

Image

The nice thing? What you’re actually seeing above is :

<div id="header-toolbox">
     <a href="">c</a> 
     <a href="">U</a> 
     <a href="">S</a>
     <a href="">X</a> 
 </div>

It’s actually dynamically built with JavaScript but you get the idea.

The font that I’m using for the glyphs is Web Symbols, available from http://www.justbenicestudio.com/studio/websymbols/

Written by Bogdan

September 29, 2012 at 3:16 PM

Fastest web stack you could possibly set up for prototyping

leave a comment »

You should be already used to my religious prototyping habits – I tend to try out a lot of stuff, build a lot of things that I later discard and so on.

Knowing that I do this a lot, I tend to actively look for tools that are either very easy to set up or that don’t even have an install footprint. Last year (I think) I found Mongoose, and used it to replace my normal prototyping instance – an Apache instance that I had running all the time on my dev machine.

Mongoose turned out to be the best choice, being just an executable (small – in the hundreds of kilo range) that you can run to get an instant web server, serving files from any folder.

My normal usage is to copy the Mongoose binary and a small config file to an empty folder and then to start churning out HTML, CSS and JavaScript – and it worked fabulous… until I needed something dynamic and I was forced to switch back to Apache.

Well, tonight I got my revenge. I needed some dynamic calls to test a RESTful API, and because my API builder is not ready yet I had to resort to some fast PHP hacking.

As my new home dev machine is not fully configured yet and I had no Apache installed and configured I thought what the hell, how’s about trying to hook up the Mongoose CGI. I knew it had support for it but I never tried it before, until now.

So, without further a due, I present the fastest setup for a prototyping web stack (on Windows) ever:

1. Create a folder – duh

2. Get the latest Mongoose binary from http://code.google.com/p/mongoose/downloads/list and copy it to the folder

3. Get the latest PHP zip distribution from http://windows.php.net/download/, unzip it and copy the php support files for CGI to the folder (php-cgi.exe, php5.dll and php.ini are enough)

4. Create a mongoose.conf file with the following lines:

listening_ports 80
document_root .
cgi_pattern **.php$
cgi_interpreter .\php-cgi.exe

5. Run the Mongoose binary (I usually rename mine to mng.exe) and access it with your favorite browser

And that’s it, you now have a web server and PHP configured, all under 5 minutes. Enjoy!

You should only use this for prototyping stuff – NOT FOR ANYTHING SERIOUS LIKE A PRODUCTION OR CLIENT-ACCESSIBLE INSTANCE!

Written by Bogdan

September 27, 2012 at 11:11 PM

Follow

Get every new post delivered to your Inbox.

Join 260 other followers