MonoRail’s Incorrect “ExecuteEnum” in v2.0

Just as a quick note, MonoRail's guides are quite inconsistent, so for those tearing their hair out over MonoRail's "Filters" article just be reminded that ExecuteEnum does not exist in v2.0, it has since been replaced with ExecuteWhen – so anywhere you see ExecuteEnum.BeforeAction (or whatever constant you choose) should instead be ExecuteWhen.BeforeAction. I had to post as it's wasted 30 minutes of my morning.

Posted in Pages | Tagged | Leave a comment

The Industry Of Love And Hate

For over two years now I've worked as a professional software developer.  I was freshly bred from the depths of university into a narrow-scoped island of programming where jobs in my area are far and few.  Although the choices for jobs were scarce it didn't hinder the availability of something to help me progress in my career.  Ultimately of course – as a software developer – your growth is dependent on your passion to extend your knowledge and expertise beyond that of your full-time job.  If you keep your work at work, you'll be an average programmer, but if you allow its practices to seep into what you do everywhere else then you're bound to be an exceptional programmer.

If you know me, and you know me well, you'll know that I'm quite stern in my approach to things.  I come from a "don't take crap from anyone" family.  If someone has blatant disrespect for me I'm likely to tell them directly to their face exactly how I feel about that.  This may seem quite brute, but I've always been the kind of person who doesn't beat around the bush.  What I've learnt from the industry that I both love and hate is that you need this kind of attitude if you're to get anywhere.  I have a good friend who is an exceptional leader amongst his peers – he's the kind of person who everyone loves because of his positivity towards every area of his profession.  When we discussed the area of the professional industry in IT and software development we both came to the agreement that it felt very much as though it was a futile environment where everyone was out for themselves.  Either you slag someone else off and tell them what a terrible job they're doing, or you're promoting yourself as the best person to do the job.  I must share my thoughts on this.  I absolutely despise and am completely disgusted with this.  Unfortunately we also agreed it seemed to be the only way to keep your head above water over here in the little sunny island of Guernsey.

I have two ideas in my mind when it comes to my work, and I hope everyone shares in this.  If I'm good at what I do, then I'm finding ways to be better.  If I'm not good at what I do, then I'm learning from my mistakes and finding ways to become better.  Either way I shouldn't be stepping on the toes of other developers regardless of what company they work for.  So here's a little thing most people don't know about me.  I'm a complete raving-mad, Jesus-loving Christian.  This usually means you've got to take me with a pinch of salt, and that you're most likely investing your time in trying to expose the inner-sinner in me by pointing out my faults (note: you think I'm being cynical, but this is actually what people do).  One of my strong beliefs is something called the Culture of Honour which may seem like I've been playing too many video games or watching too many movies but actually refers to a whole biblically-based belief system designed to empower and release people into a more positive atmosphere through the understanding that Jesus came to forgive you.  For those non-believers, just hold out on me for a moment whilst I explain.

Tell me this; what would be the outcome between disciplining and empowering your employee?  If you stick an animal in a cage what does it do?  If you condemn a colleague for a mistake what are they likely to do?  If you can accept a mistake and understand that an individual has also accepted a mistake what good will it do of condemning that person for their actions?  There's a lot of logic in this that people seem to miss.  I'm not saying that discipline shouldn't be carried out, I'm saying that if discipline is to be carried out it should be done with the goal to empower that person into a future wrought for greater success.  I've been on the butt end of terrible management where a manager's only goal is to ensure that the person feels terribly guilty for they did, even if it is something that is negligible.  You can probably tell how frustrated I am by this.  Understand that the root of bad management comes from a person trying to pass off guilt in order to try and make themselves feel more powerful.  You may think that's crazy, but it occurs a significant amount in the industry.  What was the result?  People wanting to quit their jobs and work for someone more lenient.

So what can be done about it?  Don't learn from me that's for sure.  I reacted badly in such circumstances and tried using my knowledge to prove myself.  It never worked simply because I wasn't in a position of power.  If we are to embrace sustainable environments through honouring people then we must be humble enough to identify our own shortcomings.  It's very difficult because we hate acknowledging our own lack – we are human after all.  The big question for upper management is whether the company is surviving through totalitarianism or some form of democracy.  Unfortunately I find it difficult to see how larger companies operate in a manner which honours everyone and where the opinions of even the temporary staff matter.

Final Thoughts

If I ever had the chance to build a company I'd honour those who were a part of it, and like we say at TheLove, be a part of a big italian family.  What happened to companies that functioned with growth through unity?  Surely the root of success is from the inside out, not from decorating the outside with positive-attitude advertisements? What are your thoughts?

Posted in Pages | 3 Comments

New Reformsoft Associate Team Member

We'd like to welcome Nik to our team over at reformsoft.org.  Whilst we seem to be quiet, we are doing lots of work in the background.  Our svn server seems to have a lot of revisions as of late.  Nik works as the graphics designer over at hope.gg but also owns and runs his own graphic design company Cardboard Orchestra.

Posted in Pages | Leave a comment

Developing “The Rails Way”

I've spent the last couple of months working in Ruby on Rails, so I thought I'd share some of my experiences.  If you're unaware of this increasingly popular framework, it's a well known saying to do things "the rails way" which, in a manner of speaking, is a standardised, and perhaps stringent way of completing a given task that adheres to certain rules.  This is a good thing, because it ensures a few things, firstly that other programmers can understand your code, and secondly that you don't go about trying to complete a task in an undesirable way.  When I first kept hearing the "do it the rails way" I personally had the tendency to fight back thinking it was a bunch of egotistical self-confessed developers pushing their opinions on others, but in hindsight, they're usually right.

Rails is an MVC framework built using Ruby.  It uses the Active Record pattern for database manipulation (which basically ties relational databases up with object-oriented code allowing an individual object in memory to represent a row of a table in the database).  I'm still dubious as to whether it's a solution for all cases, it seems much of its use is compared to that of simple database designs which have a single field composing the primary key.  Supposedly it's better to use artificial keys anyway, but that's subject to another discussion.

What I Like About It

You can literally get websites up and running in 20 minutes with fully-fledged feature-rich sites because of RoR's scripts.  Using script/generate you can do all kinds of things.  If it's for simple CRUD pages you can just use script/generate scaffold to get the model, the schema, and the views up and running.  It makes quite a lot of sense that common tasks can be generated from a script, what's the point in doing the same thing over and over again if you know what fields a model consists of and you want basic create, read, update, and delete operations?  Of course this isn't a one-for-all solution, sometimes you have to manually create your views, but the CRUD operations can be done for you as well.

Another annoyance I've in the past is validation, and the complexities and monstrosities that creep up on developers from their over-eager attitude towards the validation of data.  RoR provides a whole set of helpers that you can define in your model to ensure data is validated correctly.  Validation in the model eh? There's a whole number of solutions to validation, for example service layers, and keeping everything in the controller.  This is fine as well, and if you're extremely strict in what belongs to your model then you might want to move it out to your controller.  Rails has the concept of "thick" models, which allows for validation in the model.  I think this is okay, because it means validation doesn't have to be checked in multiple places.  Everything gets validated.

It's also good to know that some major sites are now investing in RoR, for example, Amazon are supposedly now using it, which is brilliant.  I'm guessing their team would've thought very carefully on whether to use it or not, so there's some level of satisfaction in that.

What I Don't Like About It

I'm a stern believer in relations being enforced at the database level.  There's a few reasons for this, and the best would be that if other applications are manipulating the database, not just the web interface, then relational integrity needs to be maintained.  Now whilst I do say this, there are plugins available which keep the constraint definition and enforcement somewhere else in the application and apply them dependent on the database implementation, although I think this should be something that's default and aware of whether it's available to do so or not.

Because of the high level of database abstraction newer developers literally won't need to know a statement of SQL in order to develop the entire application.  This concerns me because I think relational database theory knowledge is fundamental as well as the ability to write a number of queries.

Conclusion

All in all I actually think developers should be working in RoR more-so nowadays.  Yes it's a trend, but it's a trend for a reason, because it promotes high quality development for the web.  Development is quicker, more understandable, and hopefully more stable than building something from scratch.  As long as you know what's going on behind the scenes then I don't think there's a problem with it.  Always worth giving it a try anyway, the RoR documentation is fantastic.

Posted in Pages | 2 Comments

Notification

I think my blog posts are typically too succinct to be classed as a blog post, despite the term "log" being bundled into the "blog" abbreviation, or whatever terminology has crept into the atrocities of spelling and grammar on the web nowadays.  Although one of this is the point of my blog anyway so this can be deemed as ramble anyhow.

Today was something of a day to remember where I have overcome some conflicts within myself that I believe have hindered me in recent times.  The hindrance was the thought of seeking alternative avenues in my career but without the gonads to hand in my notice at work.  Well, today I handed in my notice.  So what happened? What changed from now and before?  The answer is, I really don't know, but everyone whom I'm closest too has been pointing out my new found confidence recently.

So, why did I resign from my current post?  Well, there's already speculation to this of course, but here's the reality of it:

  • I actually took this job as I was increasingly aware that I needed funds and quick, but I also wanted a job in my area, so I didn't "test the water" as so to speak
  • I have a higher interest in MVC architectures with the web using either Ruby on Rails or ASP.NET MVC – the new job actually uses MonoRails which is an (indirect) port of RoR
  • Whilst it's impossible to ignore the finance industry, it's never been my "bag" as to speak.  The problem is that over 50% of my work involves understanding finance concepts.  I blame this on my own high expectations, but I can't break from the thought of wanting to learn more technically.
  • I feel I've reached my potential from a technical perspective in my current role
  • Change isn't a bad thing, I think it helps cultivate character

My current job has caused tremendous improvements for me personally though, especially in regards to turning user requirements into something tangible.  The experience has been quite interesting, especially when a user says "I want this to be able to do that…." without specifying the rules.  Basically you need to engage in a mind-meld with the user in order to extract any kind of understandable information.  A developer has to be a user, and a developer must understand how every user works.  Never in a million years would I have expected this simply because my entire education has taught me that user requirements aren't gathered by the programmer, there's usually a man-in-the-middle doing all that boring stuff.  I actually don't find it boring, because understanding the business makes sure you're good at your job.  My current boss is probably the most knowledgeable person I know in the entire company.  I don't think he has ever been unable to answer a question or get around a business-related problem.

So what's that taught me? That business knowledge is invaluable to a software developer because user requirements are never the full picture.  But this has given me leverage for the future.

The best part of my new job is that I get to work under a very clever chap whom holds a degree in CompSci from Cambridge which means hopefully that fountain of knowledge and experience will be rubbed off in me and help propel my own experience and knowledge to driving a business.

So the new rule of thumb for me is this: step out of your comfort zone every once in a while!

Posted in Pages | Leave a comment

MySQL Can’t Connect Using Ruby On Rails Mac OS X Snow Leopard

I've spent literally a week trying to get MySQL to work with Ruby On Rails.  After much hair pulling, screaming, and crying I finally figured it out.  Much of this article is based on the following command:

sudo gem install mysql — – with-mysql-config=/usr/local/mysql/bin/mysql_config

Install Directories Aren't All The Same

Contrary to the many articles out there, mysql doesn't necessarily install to the same path every time.  The most common location for it to be installed to is /usr/local/mysql/.  Don't take this as gospel when you see it splashed around the Intarwebs.  In fact, your install location could well be /opt/local/var/db/mysql5/ depending on the version.  To find out where your mysql version is simply run "location mysql_config" and it should narrow your search results.  If it's the first time you've run location then the terminal will give you command required to install it.  So, first of all, locate the correct mysql location.

Gem Install

Running "sudo gem install mysql" doesn't necessarily do what you want it to do.  There's no real way of checking until you specify –with-mysql-config as a parameter option to the gem install.  This will fall over and give you some error such as "can't connect to local MySQL server through socket '/tmp/mysql.sock'".  Realistically this doesn't help you.  What it really means is that you're probably pointing to the wrong path, so as the previous step mentioned, make sure you find the correct path.

XCode

It's a very good idea to install the version of XCode from the Snow Leopard DVD, otherwise things won't work.  Also, Snow Leopard supports 64-bit installs now which is another reason to use it.

Build From Source

Personally I built from source.  The last link I have provided shows how to do this.  There's many-a-reason to do it, most of all is the flexibility.  It will take roughly half an hour to do.

Resources

http://stackoverflow.com/questions/1357997/snow-leopard-ruby-1-9-1-mysql-gem-huge-problems

http://stackoverflow.com/questions/1923265/installing-mysql-and-mysql-gem-on-snow-leopard

http://www.icoretech.org/2009/08/install-mysql-and-mysql-ruby-gem-on-snow-leopard-64-bit/ (follow this guide first)

Posted in MySQL | Tagged , , | Leave a comment

jQuery :visible Bug

Pottering around with jQuery I spent a couple of hours trying to figure out why alternating row styles weren't working for hidden rows correctly.  For the life of me I couldn't figure it out, I had done every test imaginable without any results.  The selector $("tr:visible:even") didn't work correctly, certain rows were having the wrong class applied to them, despite working in a clean environment.  When I face a problem for a number of hours I eventually think to myself "why not try the inverse?", so I did just that.  $("tr:not(:hidden):even") did exactly what I wanted.  Strange you say? Indeed it is.  I can't help but think the inverse of visible isn't equivalent to hidden.  This may highlight the difference between display:none and visibility:none, I'm not certain.

Anyway, the problem was overcome as mentioned in case you face this issue.  This applies to 1.3 I believe.

Posted in jQuery | Tagged | Leave a comment

Another Year In The Bag

Work

It's quite surprising at how fast a year can go, especially seeing as though I'm now fully immersed in the working world.  This year has probably been a year where I've learnt the most, specifically in relation to the "programming" industry (if it should even be deemed such a name).

The few things I've learnt so far are as follows:

  • The correct way isn't necessarily the right way.  Speed of development is, in many cases, a requirement of the system.  The overall turnaround time from the project initiation to its actual implementation is what's most sought after.  This means that doing things "properly" isn't a possibility.  Sure, this is a real shame, but it keeps the punters happy and makes sure things get "shipped" on time.
  • Break out of university mode. The problem I've mainly faced is that I've spent the majority of my life studying as opposed to practising that development.  I've always considered the text book way to be the correct way, and it definitely is, however as I mentioned in the previous point, it's not always possible.  It's best to break out of the concrete way of doing things and realise that things can often be done ad-hoc in an environment where things aren't being released to the public.
  • Don't be afraid to be confrontational.  I've been quite surprised at speaking to employees whom are completely unhappy in their jobs, and they're issues which could be fixed if they were raised, but instead the individual makes the decision to quit their job because they become unhappy in them.  Really, the best way to deal with things is to raise them as issues.

Life

Me and my wife are taking the steps closer towards getting a mortgage.  The current industry has an average house price of about £300,000 with 10% deposit required, let alone legal fees and bond costs.  It's a long process, and I advise anyone wanting to own a house in the future to start saving right now, regardless of your age.  One couple we knew had been saving money since they were 16.  The second they were married that were able to buy a house, and already they have upgraded to a large 3-bedroom house, and they're the same age as us.  We are aware, however, that I was at university during this time so we would've been strapped for cash regardless.

Study

As you may know, I've been working towards my postgraduate degree in Software Development and I'm currently working with databases (MySQL for study, although I work in MS-SQL full-time).  I've learnt a considerable amount in a short space of time concerning the structure and makeup of databases from both the theoretical (relational theory) to the practical (actual implementation).  I'm also taking into close consideration the next steps I'll be taking towards study and am pretty set on studying user interface design as that's quite a major part of what I do both in and out of my full-time job.  I was also considering doubling up my study so I will instead be taking on two courses at once, however this depends on time available, and what funds I can magically procure.

Christmas

The best time of year of course, especially when greeted with many presents.  One major thing I love doing in my spare time is playing guitar, and I somehow got myself into the singing routine also due to my involvement in churches.  This year I was given a Shure SM58 microphone and a wireless headset so I can start recording some acoustic stuff.  I've been meaning to do this for quite a while, I've just never had the time or money to do so.

I also received some other great gifts, such as a flying lesson, and a load of books such as Dale Carnegie's set and some books on Ruby and Ruby on Rails.

Next Year

I do have aims and goals, not necessarily resolutions but simply improvements.  I'm really wanting to run a marathon next year if I can overcome a problem in my right calf, and I'm also wanting to do better with my study as time has been really limited recently.  I'm also wanting dedicate more time to reformsoft as we go about some changes and hopefully get some releases in next year.  Otherwise it's just carry on as normal.

Posted in Pages | Leave a comment

Web Address Change

I've moved my blog directory over to the root directory of my hosting as I'm planning some changes in my site very soon, so this is just to keep in line with that.  Please update your RSS feeds!

Posted in Pages | Leave a comment

Master Minded

Last week I received my Open University course materials to work towards my masters degree (MSc) in Software Development.  Fortunately I have youth on my side as it's not a quick process.  If I were to work on it full-time at university it would take me a full 12 months, however, working from home means it will take me roughly 4-5 years.  I'm okay with this, because not only do I have the time, I also enjoy the study.  I've almost finished the first book, which is actually the smallest, out of the four books that there are.  Already I've found that it is formalising my current knowledge to a more reformed version of what I already know.

The course I am studying is the M876 in databases which focuses on a vast array of key areas to do with databases in general as opposed to more specific areas to do with tools and management studios.  This I think is far more beneficial in the long run as it adapts me to use any database system as opposed to having specific knowledge in one DBMS.  What's also great about this is that I work in the industry and use databases about 50% of my time at work, so I can apply what I'm learning to my work.

The database system I will be working with is actually MySQL, which is irrelevant in the grand scheme of things apart from syntax of SQL statements.

That's a short update of what's going on my end anyway.

(Also, get the latest Dean's FCK Editor for WP, it's pretty good).

Posted in Pages | Leave a comment