Blog Programming

Avatar

So long comfort zone

It's taken far too long but I'm finally making my way from the doldrums of Windows and emerging blinking into the sunlight that is Linux.

I'm no Windows fan-boy, although I'll almost certainly be accused of being one in the comments. I think it gets a bad rap but fully acknowledge there are better operating systems around (none of them made by Apple however).

I still have a problem with the open source community's habbit of pulling the ladder up after them and creating an unnecessarily high barrier to entry (or rather, conversion), its snobbery and arrogance, but with products like Ubuntu and its bundling with UMPCs, this is starting to improve.

I'm currently involved in developing a new Web project which is to run on Linux, and rather than stick with Mono, a framework I'm comfortable with (being the open source equivalent of .NET), I felt it made sense to use the right tools for the job.

I've built a very complex Windows-based solution to the same problem, which will be running in parallel to the Linux one, but which (for the moment at least) will be less involved, which gives me the ideal opportunity to cut my teeth on not just a new framework, but a completely new way of developing.

That framework is Django.

I'd delved into Ruby on Rails some time ago, of which Django is a Python-based equivalent, and although the syntax is different, the concepts are very similar, which gave me a lucky head start. The problem however has been the multiple configurations and installations needed to make a start on my first project.

As a Windows guy I'm coming at Django, and indeed Python with a severe handicap. Because I'm not used to spending most of my time inside a terminal window, my head is filled with new commands and strange directory structures. No more Program Files and Documents; now I'm dealing with /etc, /usr, /var and a whole host of others. (This isn't a criticism; this is just stuff I need to learn.)

And as if that weren't enough, I'm also learning a new database engine. Again I could have stuck with MySQL, but after taking advice from Danux I've decided to make the leap to PostgreSQL (pronounced postgress).

I should mention at this point, in the spirit of openness and transparency that I wouldn't have embarked on this without having a Linux guy sat opposite me who I can come to in tears after having broken something. Although not a programmer, his Linux nouse combined with my understanding of principles and ability to follow instructions should make this a lot easier.

So as we speak I've installed Django on my dual-booting Ubuntu/Windows development machine and our Ubuntu Web server, and am now ready to start running through the tutorials on the Django site.

So far it's proving relatively painless. So far.

Byron source code on Subversion

The source code for Byron, the heavily under-development content management framework for ASP.NET is now available through my Subversion repository.

Subversion is a system that allows developers to work collaboratively on applications, because it puts all of the source code in one place. You can also let guest users download the code, and it makes versioning easier and ultimately gives multiple developers more control over their projects.

As I’m the only developer I’m mainly using Subversion as a way of allowing others to see my work. Other sites exist for .NET developers (like CodePlex, Microsoft’s answer to SourceForge) but they often lack the automatic element that allows you to push your changes back to the server quickly. (I use Microsoft Visual Studio 2008 with a plugin called AnkhSVN that provides a fully integrated interface to Subversion.)

Byron is now being used for the Rhubarb Radio Website to power both the text content and the schedule, and in time (once I’ve made a few more tweaks and started writing the documentation and improving the code commenting [ie: adding some]) the framework will have its own site.

Anyway, should you fancy taking a look, you can find the source code for the libraries that are included in a Byron Website at svn.bluemilkshake.co.uk/byron/. Once the system gets its first major version number a test site will be included in the repository, so you can see how a site uses these libraries.

When best practises collide

Best practises are methods and techniques for achieving a certain goal. By their very nature they set the standard for us to follow, and form a mechanism by which developers can be judged.

ASP.NET is my platform of choice when developing applications, but it gets a bum rap from developers on both sides of the open source debate, for its creators’ inherently arrogant approach to Web standards.

While working on a new project I thought I’d have to bite my tongue when I saw some of the .NET markup that was being used, but after a while it dawned on me that what was being written wasn’t incorrect, it was simply following Microsoft’s best practises rather than, for example the W3C.

Under ASP.NET, the tools that allow developers to change the styling for Webpage elements (font faces, sizes, colours, etc) are very close to hand. When adding a text box control to a form, the user can specify its border style, font size and colour aswell as the usual stuff like maximum length and validation functionality. Now as part of the XHTML and CSS methodology, which encourages the separation of content and styling, this type of customisation is abhorrent: it’s simply not the done thing. However, when developing the .NET Framework (and specifically ASP.NET), Microsoft were simply following a pattern.

Some people actually don’t realise, but the .NET Framework in and of itself has nothing to do with Web development: it is simply a software framework. Programmers can build desktop and console applications, libraries and games with it. Now in desktop application development it is very common for developers to be given the option to change how a form looks by hard-coding the window styles directly into the application. There is no CSS technology for desktop applications, and so programmers pick colours from a specific palette (which include system colours) and fonts from a dropdown list, to suit their needs.

Not only can you build both desktop and Web applications with the .NET Framework, you can also use the same software (Visual Studio) to build both types of application, so developers could make the transition from building Windows Forms apps to producing Websites. Microsoft even took care to give the Web versions of their controls (like textboxes and labels) the same or similar name as their Windows Forms counterparts, with the same abilities to change styling that programmers had grown used to.

So I think it’s unfair to rail at Microsoft for not embracing W3C, when this isn’t actually the case. As a standards-conscious developer I’m not forced to use the hard-coded styling method that I would use with Windows apps: I can apply CSS classes to my controls just like I could in HTML.

So hard-coding your “look and feel” doesn’t make you a bad Web developer: just one that’s following one set of practises. Problems only arise when developers pick and choose elements from different methodologies to create their own which makes picking up someone else’s project that bit more difficult.

This realisation has made me a more forgiving programmer: now I just have to learn to resist the urge to force my ideals onto others.

Programmers vs developers

While chatting with Josh Hart - he of Live Brum fame - we both hit upon the idea of programmers being different from developers. This has been discussed elsewhere, but I felt it worthwhile to look at this angle, two years on from the original article that prompted the post in that link.

WARNING: Grotesque instance of management speak following in later paragraphs.

It’s easy to think about the difference between developers and programmers as one that is based on knowledge: a programmer has a deep knowledge of the languages and frameworks he uses, and a developer has a broader but consequently less holistic understanding of them but has the ability to plan, talk to clients and manage a project. There are elements of truth in that statement, but it’s not wholly accurate.

I for example have a foot in both camps. I learned VB by sitting in my room, playing with my custom-built Windows 98 PC and not kissing girls. I got a job fixing computers then went on to develop desktop applications for large companies. I now develop Websites for a living, and I code for the fun of it: the results of which are currently TweetPaste.

But I also blog, work with and build WordPress plugins, collaborate on different projects like The Big Picture and Rhubarb Radio, all of which have come from an active social life. I work on open source and “closed” systems alike because I’ve got the end in mind, not the means. I can do the handshaking, business-card swapping, coffee meeting thing, and I really enjoy it when it’s with people who are there to revel in the exchange of ideas.

Josh told me he doesn’t consider himself a developer, but when presented with the code for Live Brum which he’d written almost entirely single-handed - and was able to thoroughly explain - I balked at that claim. He corrected me however, saying that he was a developer, not a programmer (not to be difficult: simply to draw a distinction).

It may come down to a difference in brain types: some people are logical, others are creative. You can have elements of both of course, but I think one will always outweigh the other.

I’ve had similar conversations with my friends David North who runs Digital Rant and Kevin “DigiKev” Rapley, a programmer and designer respectively; both people with an appreciative eye of the other’s discipline, but a firm understanding of their own strengths. Currently they’re both either engaging in or undertaking projects that will see them finding a middle ground, but having approached it from opposite directions, so perhaps these titles are defined, but not set in stone.

Given the right framework a developer can build very powerful Websites, but can you then take that knowledge and learn a new language from scratch, thus becoming a “real” programmer? Similarly can a “hard-core” programmer take the helicopter view and acquire time management and client-facing skills? Yes, probably, but what’s more important is the question of whether either wants to.

Some are very happy being given a problem and figuring out how to solve it, whilst others like to be given an idea and told to run with it or wait for inspiration to strike. There are opportunities for both, unfortunately there are also frameworks for both. ASP.NET is seen as the programmer’s language whereas Ruby on Rails is for creative types. This is partly because creative people embrace the ideals that open source licensing embodies, but also because of the reputation of the likes of Microsoft, as a stuffy, almost archaic organisation.

Or is it just about mindsets? MySpace is (now) built in ASP.NET, and Facebook which is programmed in PHP is under constant criticism for creating a walled garden (a closed space, far from the ideals of the open source ethos).

So therefore the technology - and even the ideals behind them - are not what makes a programmer or developer what they are: it’s what they do with those technologies that makes a difference.

There’s a whole bunch more I could say on the subject but I think I’ve gone on long enough, so if you fancy telling me which camp you think you belong in - or whether there’s room for a third...or more - please comment away!

It’s all broken!

Why is it that nothing seems to work any more? Websites constantly kick out 404 errors, my OneNote is always getting out-of-sync with my Outlook task list, Dreamweaver is always forgetting my FTP details, and I can’t think of a time when Adobe Acrobat has ever actually worked inside IE.

If you buy a product from a company like Sony, you’re pretty much guaranteed that it’ll work perfectly and never break, because their “reassuring expensiveness” is justified by great build quality. But why does this rule not seem to apply for desktop and web apps?

Now a cynic might attribute some of this down to the ineptitude of software developers such as Microsoft, but I think that’s a complete cop-out. The reason Macs don’t have such widely reported problems is that hardly anybody uses them, because there’s no reason for them, other than to provide work for Mitchell and Webb when they’re between series.

No, I think the constant stream of bugs, be they online or offline, is due not to simple ineptitude, but to the pressure under which people continually put themselves. If the deadline for Windows Vista had been properly thought out and not then been put back, and back, and back (I first blogged about Vista in December 2005 as one of the things to look out for in ’06), maybe it would work flawlessly. If the guys behind MySpace weren’t so keen to attract more and more visitors to their site, maybe they’d spend a couple of days ironing out the myriad bugs and imperfections that plague the site.

I find it so strange that we come to accept crashes, internal server errors or “quirks” as just part of life; it’s also not helpful when certain software giants (naming no names, Bill) continually deny that many of their oldest bugs even exist, a fact which has given rise to a saying in our office: “this bug is by design”.

But what does one do? Complain to the developer? Your local MP? The European Court of Human Rights? Is it not your right to be able to use a piece of software without fear that your brain will turn to cheese through repressed anger at its various gremlins? OK, maybe that’s a bit OTT, but how about the next time you come across a problem with a website or a piece of software, take five minutes to get in touch with the developers if you can, and let them know. If it’s a large company, chances are they already know about it and probably aren’t doing much to counteract it, but if you don’t ask, you don’t get, and you never know, your email could be the straw that breaks the Project Manager’s back and forces him or her to schedule in that bug fix, if only to stem the flow of abuse.

Just a thought. Go in peace.