I’m in love with my Stereo. No My Netbeans

We have moved

If there is one trait common to all developers that I have met, it is their love for art. Topmost is the love for music, good music. Ranging from pop to rock to r&b, most programmers love music. The question is when shall we have an IDE that integrates playing music files by default? at least mp3. I was really hoping netbeans will be the first to take this initiative, but till date no one is talking about it. If you really support me on this, lets make a lot of noise about it. Lets twitter it, blog about it, post questions about it, and maybe someone will just listen and give us native support for playing music in Netbeans. I know you can write a plugin, but I think I prefer if it comes bundled with the IDE itself. I have a few things I will love to see.

1. Support for Streaming from sites like last.fm

2. Support for downloading and playing podcasts

3. Support for playing popular(ogg) and less popular(wma) file formats. :) lol, at least you get the picture.

4. Support for online radio. and more

I have just tweeted about this, you can join me by retweeting, or simply make your own tweet. Maybe in 6.8 or 6.9, our wish shall be granted.

Comments (10)

Please Service My Requests.

We have moved

I had a conversation with a friend about the unscrupulous use of http request methods. There are four major ones I use and this is how I think they should be used(or how I learnt over time to use them).

POST: This should be used when sending a message to the server, especially if that message is intended to be stored on the server. Examples are creating a new user, or inserting a new record generally into any particular table in the db. Also if you are storing a file on the server, use POST.

PUT: I use this method when I am updating a record on the server. Basically for db UPDATE instructions. I also found a way to use it to post files to the server when such files already exists, for example changing a profile picture.

DELETE: I use this method when I am removing something from the server or from a db on the server. It is almost self explanatory

GET: I use this sparingly, and following w3c specs, I make sure that whenever I use GET, there is no side effect on the server or db AT ALL. I use it only for retrieval of files and records from the server.

There are four more, HEAD, OPTIONS, CONNECT and TRACE. I really don’t use these ones.

I see some codes and I feel like cursing the developer. Especially PHP Codes. They use $_REQUEST for everything, regardless of what method they use on the form. I also saw a particular project where everything was POST(This is as unacceptable as having 500 lines of code under a single button click). This I think should not be, these methods are there to put some sanity in your code, and help the maintainer, so please use them. Best Practises are the Best

Comments (3)

I Just got a MAC

We have moved

I have been trying to get one since as long as I can remember. Anyway, I got one now…and its quick, very quick to see the shortcomings of windows when using a mac, here are some: I don’t have to click a zillion times(sorry I exaggerate, maybe 6times or more) to perform the basic tasks. I dont have to click start when I really want to shutdown(lol), I have a control panel that is not confusing(even MAC beats some linux distros here), multi touch mouse pad, dashboard that actually is a dashboard, and not something that gets in your way, I don’t have to mention slick design, ease of installing softwares(although I have to pay through my nose for some of them). But its not all heaven and paradise. I have some things against my mac. No home and end keys, no pgup and pgdn keys(anyway I prefer my multitouch keypad to pdup and pgdn). Aside these, all the others are my own undoings, like it took me a while to locate the terminal(my bad), it also took me a while to be able to use iSight(in built camera)(also my bad).

But all in all, I think the MAC OS is the best OS in the world. I have been trying to write the “one OS to rule them all” blog for a while, and I think now I can write it. I see my MAC as combining the power of UNIX with great and intuitive GUI on a very good hardware.

And to crown it all, there is a netbeans for MAC. So all my codes still work. I got everything up and running in no time at all.

To mimic someone we all know “Its really a great great great experience. I hope this ecstasy will last for a long long long time.”

ciao

Comments (8)

Bing Is Not Google

We have moved

There is a popular drug in Nigeria called panadol. The manufacturers have this funny advert and the last line says “if no be panadol, he no fit be like panadol” meaning if its not panadol, it can not function like panadol.

I have read a lot of posts online about bing and truthfully most of these posts looks like microsoft sponsored to me. Bing is an awesome search engine, the best thing from microsoft in years. But to say because it has a few features that Google didn’t have makes it better than Google, please say something else. Here is my 2cents on the bing issue.

Bing’s features are OK, I used it for some time too, just to get a feel of it. It is a very good product keeping in mind that it is coming from the same stables that produced Vista. But I have to go back to google after a while. Apart from the fact that google is an habit, “if no be google, he no fit be like google”. I will show you a few examples.

goto www.bing-vs-google.com

type without the quotes “define:dashboard”, then “define:netbeans” and then “define:java”. I use this feature often, because it not only helps me with definitions but also with spellings. If you dont see any difference, lets move on to the next

type without the quotes “1cm in m”  bing wont do the conversion for you and it wont even suggest that you should type “1 cm in m” instead. Obviously the space between 1 and cm is very important for bing to work. But at least tell me so. It was when I was composing this post that a friend pointed out that i need the extra space between 1 and cm. lets go on

type without the quotes “filetype:PDF softpedia” “filetype:PDF java.sun.com”. The results speak for themselves. When I want to download something from a site, I also use this feature.

other ones I have come to use often are

info:www.java.com, weather:Lagos and lots more.

My point is, it is not about the search or the fact that I can preview sites and videos(I have firefox plugins that does that, I almost felt it is normal) or that you can show me search history or that you have a finer homepage, or that you have nifty shortcuts for doing things, it all boils down to the things you are used to doing, habit. Say what you might, I know people who still use IE6, out of habit. Bing is a very good search engine, better than most competitors and competition is good. But at this stage if anyone think bing is better than google, I also think the person should re-evaluate. I work in an IT company and we also have non-technical staff members. I asked them their opinion and 90% of them believed google is better. I asked them to continue using bing for two days and after then about 80% still prefer google. These are the same people who prefered firefox over IE6 in the first 30mins of use. If anyone think microsoft will have it smooth as it does with netscape, they should rethink. I just hope this is not another Zune project. This post http://www.roughlydrafted.com/RD/RDM.Tech.Q1.07/050A729F-9A90-41FB-8788-CEB0DF3455E9.html is a 2007 post comparing Zune and iPhone. The writer definitely knows better now. Time will tell…time will tell.

Leave a Comment

Profanitometer

We have moved

If there was ever a device like that, I would be running at full speed, say around 400 to 500 KM/h. I used the F words, B words and any other profanity you could think of. I say b..lshit without blinking an eye, My use of f..k is underrated if you say I used it like 1000times a day. I am wondering if this is a trait of programmers or I am just being naughty…..

Let me give you an example, when I am working on something cool and I got it working, I will look at myself and say I am f..king bad guy, or say I am the bada** hacker. If it aint working you will hear me saying b..ls**t over and over and over….you will also hear me saying f..k this guy or screw that nigger or stuffs like that when I see codes that pissed me off(i dont say it to the programmers face lol). When something says something or does something funny, i will say that dude is f..king crazy. I found out that I use the profanities more when I am programming, around computers or around other programmers. And my case is somewhat mild compared to some of the other programmers I converse with. One dude in one of the companies I have worked for used the word so much so that management passed a “no F word before 4pm rule!”.

Today I was directiing someone to do something for me over yahoo messenger, He said the thing will take about 40mins to complete, I expected it to take less than 15 mins and the next thing I typed was b…ls**t. The guy responded with “what is that?” and then I realised I have used the profanity word with someone I shouldnt have used it with. This is not the first time something like this is occurring.

My question is, is this a programmers’ trait or is it just me?

Comments (8)

The Tale of Two Carpenters

We have moved

Why is it a good thing to have personal frameworks and libraries, why don’t I just build a monolithic system, that does one thing and does it good. Let me tell you a story of two capenters.

Adrian the first capenter likes build things. He can build anything giving the proper amount of time and motivation.

Sean also loves building things, but he hates doing the same thing twice.

One day a company approached both Adrian and Sean to build a special kind of chair for them. They did this so that they could pick the best from both. Adrian was the first to turn in his prototype. He has it all well planned and thought out. They liked it and told him they will get back to him before long. They have to wait another two days before Sean could turn in his own prototype. They also liked it, It looked so much like that of Adrian, they have both followed the specifications well. When the time for choice came, they chose Adrian over Sean because he took less time in building his prototype.

Problems started when the have a new staff member who wouldn’t fit into the chair because he was….rather big. They need to modify the SEAT. They called in Adrian and he said no problem, he went ahead to modify the CHAIR, adding a new kind of seat. It took him as long as it took him to build the chair to modify the seat.

Over time, these modifications were becoming more and more frequent and Adrian has to build a new kind of chair almost every other week just because of a slight modification. It came to a time that the company weren’t happy and began complaining. They went on the lookout for Sean, just maybe he could help them.

They found Sean and told him their problems. He laughed and said that it wasn’t a problem at all, and then he told them why his prototype took a bit longer to produce.

Sean, unlike Adrian didn’t build a CHAIR. He built the components that make up the chair. He built the front legs, back legs, arm rests, back rests, seat etc. It took him as long as it took Adrian to complete the chair. After building the chair, he started assembling them and that was why it took him longer. But now the company suddenly saw the solution to their problem. Adrian built a chair and so each modification no matter how small will alter the chair. Sean built components therefore he will need to modify only the component parts that are affected.

I told this story to say that as a developer, I strongly believe that you try as much as possible to have a personal library. It will help you a lot in the long run. Those days when I was still naive, when I hear “library”, I don’t see it as a thing that I must build. My software are large and monolithic. A little change to one part of the software will make me pull down the whole bunch. Now I know better. Whenever I see a feature that I have used twice, either in the same project or different projects, It is going into a library. I am happier now than then.

Also when you have a large project, please and please MODULARIZE. You don’t want to know what trouble you will save yourself or the person maintaining that project in the future.

Leave a Comment

Java(TM) ME Platform 3.0 – Netbeans Platform based

There are so many cool things about the new j2me platform, but the coolest of them is that it is Netbeans Platform based. I am kinda used to the Netbeans Interface that when I saw it, I almost jumped from my seat with ecstasy(hummn that word!).

Anyway that is not all. The truth is that I am not very happy with the way netbeans generates codes for me when I am using it for j2me, I never did complain about this, but it seems the designers of this platform were reading my mind. The platform is really very stripped down.

Also, the emulators are far better than in 2.5.2(so we expected) but not on this scale. They were far far better than far far better could describe.

It also has support for javafx mobile(is that good news? you bet it is). It also has support for BD-J, LWUIT, and a whole lot more.

Setting up new emulators is also very easy, the whole netbeans platform base is a very very wise design decision.

I can also test directly on my pocket pc. This feature is also very cool.

The coolest feature however I think is the way it handles RecordStores. Most times when I am developing, and I need to store records. I find myself gooing to delete the created records after every run. This is not so with the 3.0 platform. when you run your app normally, and you shut down the emulator, it wipes all residual data left behind. To make data permanent, you will have to run via OTA(which makes a whole lot of sense).

You can call me a Netbeans fanatic, but I think most of these cool features are as a result of the decision to use the Netbeans Platform. Good things have a way of having “goodly spiral effects”.

Leave a Comment

Strict Rules

Dear All,

When in the office, please concentrate only on official assignments.

I repeat, I will be very upset with any member of staff who during office hours/uses company equipment/company resources for personal projects /assignments.

The time you spend in the office should be entirely for company tasks. I repeat, this is totally unacceptable to me and I will be extremely angry if I find this being contravened.

I see this as a sign of disrespect and dishonesty to prosper oneself against the collective good.

The company will do all it can to keep its side of the bargain in its responsibilities to you and the company expects that you will do same.

Thank you

Leave a Comment

Not necessarily necessary

When I started learning java, I was coming from a world of pascal, delphi and vb, so I believed there are a lot of things in java that are not necessary. As my experience with the language grows, I started seeing things in a different light. I will name some of the things I thought were not neccesary then, and then I will try and explain why I now think they are.

getters and setters. Why use getters and setters. I could make all my members public and just read them like that instead of using getters and setters. And for as long as I can remember this is how I do my things. Then one day, as part of a bigger API, I needed to write a user class. The illumination started when I found out that the requirements are these: The user of the API will supply the password in string and we will store the hash value. Also when he requests the password, we should reset the one in the db, generate a new one, store the hash and return the string to him.

As usual I wrote a helper class that does that. The problem is when you want to create a new user, you give the String password and call a save method. Then in the save method I convert the string to md5 and store it (and that works fine), but when you say user.getPassword(), it should return a new password hash and all that. I was momentarily trapped. That was when I remembered getters and setters. The final user class looks like this

public class User {

String password;

String username;

public User(String username, String password) {

this.setUsername(username);

this.setPassword(password);

}

.

.

public void setPassword(String password) {

this.password = md5hash(password);

}

public String getPassword() {

return newPasswordMd5Hashed();

}

}

Getters and Setters were introduced so as to overcome this kind of problem I believe. When you want to do something special at the point of accessing a variable. It is like overloading the = operator in c++.

Access Modifiers: Some days ago, I posted a joke on my facebook page. This is it.

A php programmer walked up to a java programmer and said “java is full of crap. The chief of these being what u guys call access modifiers…public, private, protected..etc. why have all that crap”. The java programmer looked up and said “lets assume for a second that I am God, and I make your wife public” End of Discussion.

The joke however is on java programmers. Thats talk for another day. I used to be like that php guy. Why all these access modifiers. All my members and methods are public, so I really dont need them(This is where I prefer scala, the default is public, unlike java where the default is private). But my User class above also taught me the need for access modifiers. The user class is actually a base class for some other classes, We have the ManagedUser, TimedUser etc. If I make the password field public, then the programmer that is using the API can as well just use the = to assign value to it. This will have very un-desirable effects. If I make it private the programmer wont, but neither will ManagedUser and TiimedUser. I need them to also be able to modify this field because we store the passwords differently for a managedUser and timedUser. I need to make the field protected.

When developing API’s that will be used by other people, access modifiers are your friend my friend.

Wrapper classes: why have int and Integer, boolean and Boolean, double and Double. Who needs wrapper classes anyway. But that is a lie, sometimes you will need them. One day you will need to write a method that takes an object as an arguement or that returns an object. primitives like int,boolean,double are not objects. You will need to have wrapper classes. What I wanted to do when this dawned on me was simple. Pass an Object to a method. This Object could either be an Object or a primitive. What do I do? Simple, use wrapper classes.

public void done(Object i) {

if(i instanceof Integer) {

.

.

.

} else if(i instance of Double) {

.

.

.

} else {

.

.

.

}

}

Abstract Classes: Now this one I didn’t get until very later in my java journey. Abstract classes, Interfaces etc. But let me explain it to you in simple terms. You will need these features if you want classes to fufil a particular contract. For example, I was writing a class Store as part of a J2ME Database Management API. Now any POJO that must be persisted must have two methods toByteArray() and fromByteArray(). If I were doing J2Se, I could have used reflections, I didnt have this luck with J2ME CLDC. So I rememebered Abstract classes and interfaces. So I make sure every persistable class must extend and abstract class I called StoreBase. The class itself contains methods toByArray() and fromByteArray() without any body definition. Any class that extends StoreBase can be persisted, but it must have definition for those methods, else your code wont even compile. EOD.

EDIT: The default access modifier for java is packaged and not private as erroneously stated above.  Thanks to Jose Ayerdis

public class User {
String password;
String username;
public User(String username, String password) {
this.setUsername(username);
this.setPassword(password);
}
.
.
.
.
public void setPassword(String password) {
this.password = md5hash(password);
}
public String getPassword() {
return newPasswordMd5Hashed();
}
}

Comments (4)

Programmers or Comedians?

I read this somewhere

There’s something weird about software development, some mystical quality, that makes all kinds of people think they know how to do it. I’ve worked at dotcom-type companies full of liberal arts majors with no software experience or training who nevertheless were convinced that they knew how to manage software teams and design user interfaces.

This is weird, because nobody thinks they know how to remove a burst appendix, or rebuild a car engine, unless they actually know how to do it, but for some reason there are all these people floating around who think they know everything there is to know about software development.

Its pathetic because you see a lot of them tout certifications as if it’s ever a yard stick to measure how good they are? I wonder if I will be glad to allow a Doctor perform a brain surgery on me just because he knows how to treat malaria, or because he just graduated from medical school. They boast and brag about things they know nothing about. My boss will say they are name droppers. Myself and my friends have a name for them, we call ‘em comedians. What else they could be? I interviewed one of them for a programming post in my company. Since he said he does Java Programming as a hobby and that he even has a mobile game he wrote in java that talks to a JSF back-end. The back-end itself relies heavily on hibernate as persistence layer(now isn’t that wonderful?). He has about three certifications..if not four. (CCNP, MCST and SCSA), I asked what IDE he is conversant with(expecting to hear Netbeans so that I could add a +1 to nigerians that use netbeans poll I am secretly compiling), his reply was “Websphere, JBoss, etc”..now isn’t that what a comedian will say?

Comments (7)

« Newer Posts · Older Posts »