2011/08/26

Yes I love(d) PERL

So being a lover and not generally a hater... although some may disagree with that statement when it comes to me and closed source/lock in vendors, I really loved PERL in the day. 
I haven't had much chance to wave my fingers at a keyboard in the direction of the first language that I truly attempted OO with . So when I stumbled across Moose, I was truly fascinated by it. After the fascination wore off, I realised I can't read PERL to save my life at the moment and I would really need to start from scratch.
It brings back fond memories of writing a full OO language in PERL, circa 1998, and I was very proud if it. I also remember looking at the code about 6 years later and scratching my head as to what I wrote ;)
That and my terrible short term memory should not dissuade people from still utilising PERL for what it is really worth: Speed, and lots of pre-written modules!!!


So I give you an example of Moose to look at and see if you can read it. I must admit its rather nice and almost tempts me to write a PERL app just for the kick of it again, and to see how good Moose really is. Apologies to the Moose community for plagiarising your code snippet below, but if you want to see the full article go to http://search.cpan.org/~flora/Moose-2.0204/lib/Moose/Cookbook/Basics/Recipe1.pod and have a squizz at the explanations. Seriouslly if PERL 6 is anything like Moose, its gonna ROCK!!!


package Point;
  use Moose;

  has 'x' => (isa => 'Int', is => 'rw', required => 1);
  has 'y' => (isa => 'Int', is => 'rw', required => 1);

  sub clear {
      my $self = shift;
      $self->x(0);
      $self->y(0);
  }

  package Point3D;
  use Moose;

  extends 'Point';

  has 'z' => (isa => 'Int', is => 'rw', required => 1);

  after 'clear' => sub {
      my $self = shift;
      $self->z(0);
  };

  package main;

  # hash or hashrefs are ok for the constructor
  my $point1 = Point->new(x => 5, y => 7);
  my $point2 = Point->new({x => 5, y => 7});

  my $point3d = Point3D->new(x => 5, y => 42, z => -5);

2011/08/10

Patents and Technology (or the world is run by morons)

So, basically an idea that I have, even though it is the only a gesture, means that I now own the right charge people for using it?? imagine if real life was like that. Say I patented the wave gesture, I could effectively sit back and let the money roll in, until someone made a slight adjustment to the wave, like wiggle the fingers and then proceed to sue the crap out of that unfortunate person. And according to the courts at the moment I'd win!!! In fact, after doing no research what-so-ever, I'm pretty sure someone has already patented the wave for a keyboard-less system.

The biggest hindrance to innovation are the big monopolies themselves, instead of actively making something that is beneficial to the public, they instead will go and register idea's just to cut off the opposition. Not only that, they register things that were not even possible at the time. I doubt the big companies even have great ideas themselves, some guy/gal most probably had a great idea, told a buddy, who told a buddy, that somehow got to a prick at a big company that registered the idea WTF!!!! All the while the 'patent' team takes the credit and the company gets the money. It always reminds me the Dolos, a great South African invention, and how the contested origin is now lost in facts and double facts. But the point is in this case there is a physical thing that was not a common action or interaction. Most software patents are just gestures, like swiping my finger across a screen in one direction!!! and that is a patent!!!! What on earth are people thinking!!!!

Technology will stay on earth until people are allowed to try, and extend at will. Instead of screwing the public by locking them in, rather allow innovation and concentrate on build quality. Ultimately the final product is what will win people over, not some cock-a-mainy patent.

governments around the world seriously need to rethink their patent systems and allow growth and ideas to flow, they better do it, because the big companies sure aren't playing nice and will surely like monopolies more than oppositions (even though they deny it).

2011/08/04

Memory vs job security

How interesting is that....
watching the InfoQ presentation on "no GC pauses"(sic), really made me think about something totally different. Firstly they were discussing the heap size that you use. Do most developers even know how much heap they have allocated to their application. At first I thought no, but then again I remember each time I've had to increase the heap. but the really odd thing is that there seems to be a trend at the moment to have reached an artificial cap at the moment at 2-4GB of heap... but the presentation went on to say who uses over 100TB of Heap!!! wow, am I working on small systems or what!!!
An interesting aside is that we need to use more memory to ensure job security. At first I was highly critical of this, but it makes sense I guess, but only in that, by increasing the memory used we are increasing the reach that the application has. By reach I talk about scaling. Which leads me to another thought, by using clusters we are already breaking that artificial barrier, mainly because we have to use xGB of memory on each server. So how many of us are actually running our applications on xGB ram on clustered systems. The majority of us I suspect.


If anything this article was highlighting to me, is that the imagination is the only limitation to what we can do with Java at the moment. So its time to stop thinking about memory and worrying about it so much and let the hardware guys worry about getting us more cheaper ;) Can other languages claim that !!! Long live the king, long live Java!!!


With cheap servers, come limitations, so buy decent hardware, which is still relatively cheap. I recently bought a file server for less that a R1000, it has a dual core AMD 64bit 1.3 GHz processor 4Gb Ram and a 250Gb HDD, so if an end user can buy something like that for home and cannibalise it for a media centre ;) how cheap is good hardware then??? Are companies being short changed and badly, because vendors are used to charging exorbitant fees for them? 


Yeah that was all over the show, sorry...  can't promise I'll improve the thought process in later posts though ;)

2011/08/02

Java 101... or lets just blog something

So a technical blog of sorts needs at least one technical article

After using Java for a while now, sometimes I take for granted that everyone knows or understands Java. But alas the world just does not roll that way. For example if I had to put this piece of code of a say a system administrator that is proficient in php or perl or the likes. Would they understand it?

public class Person {
    private int id;
    private String firstName;

    public Person(int id, String firstName){
       this.id = id;
       this.firstName = firstName;
    }

    public String getFirstName(){
       return firstName;
    }
    ... more to follow.
}

so I looked at this for a while and decided that perhaps when we talk about code to people that have no idea about Java or OO(Object Orientation) for that matter, we need to perhaps think about a better approach, such as rather educating while explaining why things happen. It is of course not possible to explain everything to everyone, so small steps, like what does that key word private mean or what exactly is this class. Or maybe not??? Do they really need to understand that level when dealing with an issue that is technical of nature and not going to be fixing it per say?
Would not an understanding of the overall flow be better for that target audience? Again not sure, but it always seems that we do need to impart some level of technical knowledge onto those that are involved in the applications we write, even if it means they ask you more questions....

2011/07/26

Time vs Money

Its been a while so I'll start off slowly.... not strictly technical... but affects technical people

Perception is key here. For example if it takes you 1 minute to compile and deploy code to an application server, and someone else takes, say 5 minutes. Is the other person wasting time or are they just more deliberate in the way they do things.
I don't advocate wasting time at all, but the assumption is that everyone works at the same pace. Being a fairly impatient person myself, I find myself surprisingly understanding of the way that some people work, especially since I have been in similar situations. I guess understanding what we need to do and understanding how a person gets to a solution is linked in some way.
I guess running people down because they are slower than you is an easy way to vent, but the reality as I see it, is that you, yourself are lacking insight and empathy. The best of us fall prey to this often and being aware of it should always be something that helps keep us in check when criticising someone else.

Pace vs Money.... well if you are working faster and making more simple mistakes due to the fact that you assume you are working better at pace... does this not just slow down your real pace? I would much rather someone work in a deliberate manner and manage that known time, than work with someone that rushes about and slows you down in an unaccounted manner.

more philosophical than technical I know... but in some ways related...

2010/05/05

Java stuff

public class HelloWorld {

    public static void main(final String[] args) {
        System.out.println("After a year of no blogging ... I'm back!");
    }
}

Working hard...

H man hard at work