Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Sunday, 9 May 2010

Bye-bye Symfony and Netbeans...

I can't believe that it's been almost six months since I last posted anything on this blog. How time flies when you are having fun!
A great deal has happened since my last post. Having written about the Symfony framework, I decided to abandon it after a few days, mainly because the documentation was somewhat lacking. Instead, I opted for the Zend Framework. After checking out a few online documents and buying a few books on OOP, I was away in next to no time.
I am running the latest version of the framework (1.10) on my development workstation and staging server and it is a very good development environment. Once a project is set up, it takes very little time to have a working website.
One area where it scores very highly is the creation of forms. The built-in validators for Zend_Form and Zend_Validate mean that it is easy to create a form which is fully validated when it is submitted to the server. Moreover, the forms should be more secure as there are validators to help stop XSS and SQL injection attacks.

On the subject of integrated development environments (IDEs), I decided to abandon Netbeans and go with Eclipse. There is nothing wrong with Netbeans per se, other than it ran very slowly on my workstation. Eclipse runs much more quickly and once I had got used to its user interface, I felt it was much better.
One thing that I really like is the way it integrates with my subversion server, so I can commit changes to the repository from Eclipse, without having to go into a separate shell. It saves time and encourages good practice.

All of this has meant that once we had agreed on the overall design, I have been able to make excellent progress with the website I am currently developing with a business associate. There is no doubt in my mind that the combination of an IDE like Eclipse and a programming framework like the Zend framework make a huge contribution to productivity and speed of delivery. That said, some of the modules in the framework can be a little hard to get going and it's often necessary to search the fora or google for solutions to problems. Overall though, it's definitely quicker than having to hand craft code.

Tuesday, 15 December 2009

Printers, Netbeans and OOP

Quite a productive day again! I finally fixed a problem with our Samsung ML-1640 printer. It's connected to an Ubuntu server and I have had no problems at all printing from my Ubuntu workstation or a PC running Windows XP: however, printing from a Macbook would throw up errors and occasionally, just print blank pages. It's been driving me to distraction for ages and today, I decided to look at the problem one more time.

The Samsung ML-1640 is a great little printer. Cheap as chips, excellent print quality and fully supported under Linux. My first port of call was to the Samsung website to download a new linux printer driver, which was duly installed on the server. Then I noticed that my Macbook was running with a driver for the ML-1630! So I downloaded the correct driver for the Mac and eventually had everything printing as it should.
The hardest thing was remembering the correct syntax for connecting a network printer to a Windows XP machine using HTTP. Something that I realised AFTER I had deleted the previous instance of the printer in the control panel! But I got there in the end and all of the problems have all been fixed.

I started using Netbeans in anger today. It's a cracking editor, though it can be a bit slow as it checks all of the syntax as you type. I really like the way it's possible to expand and collapse code blocks. The way it highlights instances if variables in a file and braces or brackets is a real boon too.

My attempts at learning Object Oriented PHP are going well too. I had a bit of a shaky start, but I've just finished my first OOP script and the penny is dropping. I have a couple of ideas for mini-projects to consolidate my learning as well as build pieces of code that will be useful for some forthcoming projects.

It's play time now as I've just take delivery of a Bluetooth keyboard for my Macbook!

Ciao!

Monday, 14 December 2009

Beanz meanz Netbeans!

It's been a really fun day. I spent quite a bit of time going through some object oriented php tutorials on the killer php website. There are some excellent tutorials plus short video clips that go a long way to explaining what object oriented PHP is all about and how to start using it.
My previous projects have been based on "traditional" programming methods, making extensive use of functions. Whilst I have gone to great lengths to try and separate dislay code form "business" code, I think a more structured approach is needed for future work. The approach will make a huge difference to maintainability and scalability of any new applications that I write.

I successfully downloaded the Netbeans 6.8 IDE package this evening. Once I had installed a JDK, the package went in without a hitch. I love the way it integrates with Subversion and has support for the Symfony framework right out of the box.
Netbeans is a really feature-rich package and it will take a while to get the hang of its myriad features. The time invested in this (and getting stuck into OOP) will reap dividends though with respect to productivity and code quality.

I also love the fact that I can run the same package on my Macbook as well as my Ubuntu workstation - or Windows if it comes to it, though hopefully, I can avoid THAT route!

Saturday, 5 December 2009

Version Control

Now that I have almost finished developing the back-end code for David Pentland's website, it has become increasingly clear that some form of version control system is no longer a "nice to have". Having created many new php files (and edited even more), keeping track of all of the changes has been a bit of a challenge. Moreover, I am just about to start work on an exciting new project with a partner and it makes good sense to sort out this issue before coding starts in earnest in the next few weeks.
I acknowledge that there is a bit of an overhead in running a version control system, but the advantages more than outweigh the disadvantages.
For me the main disadvantage is having to learn a new way of working and get my head around the ins and outs of the version control system. The advantages are:
  • always knowing where I am with respect to code versions;
  • being able to regress changes easily by "rolling back" to an older version, or being able to "undelete" files which have been marked for deletion;
  • having a repository on another machine means I have a backup of the code by default, albeit minus any committed changes.
Fortunately, I spotted an article in an recent version of Linux Format magazine which compared three open-source version control systems, namely: Bazaar, Git and Subversion. After some fairly careful consideration, I opted to install Subversion on my server.

The manual for Subversion, which, like the software is free, runs to something like 480 pages. It all seems a bit daunting to start with, but thanks to another article in Linux Format magazine and a couple of 'how to' articles, including one particularly good one by MichaƂ Wojciechowski , I had a fully functioning Subversion server up and running within an hour or so.

Now, all I have to do is read the manual, become familiar with Subversion and move my websites into the repository.

Simple!