Tuesday, June 21, 2011

Java

No, not the coffee.

But seriously, what surfer would make that association before associating "Java" with the programming language?

I think I had a break when finding a book ("Head First") that explained the basics of Java but written for... well, me, it seemed. It wasn't "this is programming and this is a computer" nor was it "this is a superflux caputization megamax twix ultra mk 2 interface". It was "you're not stupid, this is how Java works". I'll plow on, but yesterday I wrote my first snipped of working code on an Eee PC and ran it.

Java uses a main(). When was the last time I didn't work with an fully event based language? Like early 2000. How I have missed having the simple control of a main function that dispatches everything and that lets me decide the order in which to do everything. Not events, floating fuzzily in space until fired.

For me, that extra level of control feels delicious. It's hard to have a clear picture of everything and the problem a program is solving when huge parts of the execution of the program just lingers in some black unknown space. That's a little how fully event based stuff feels like. I like to say "yes, you have a message for me, good, stand over there until I'm ready for it" instead of "you have a message for me, I'll take care of that maybe now or maybe after I've done that other thing or maybe in the middle I don't know".

It's probably not that confusing for those that like it but that's the jist of it for me. And I really don't have anything against events but I prefer to use my own callbacks and stuff as much as possible. It just feels less uncontrolled, more structured. For example, take Unity, where there's a "core" somewhere hidden and everything runs through events. It works well but... I don't know, it feels flimsy.

Well, this was just a start. I'm glad though that I've seemed to pass my traditional first "learn new language barrier". I never know when or how to pass it usually.