xkcd reference
I'm not really writing any Python, but I've been having a similar feeling lately about an old nemesis: Java.
There's been some Android talk around the office lately, and while I did do an Android port of one of our games, it wasn't the best experience. That's not Java's fault, it's the fault of the original programmers, who apparently thought that C++ was the only language they - and everybody else here - would ever need. People who aren't well-versed in all the languages that you might use in-house shouldn't write libraries, or at least they shouldn't design them. But I digress.
As I mentioned, there has been talk. We have partners (who can't be named) that are interested in publishing on Android, so I've been doing some light R&D. No porting, no real direction, just checking the lie of the land. I have to say, I'm rather enjoying it. I still have plenty of legitimate concerns - they're legitimate in my head at least - but I'd forgotten how many wonderful high-level constructs are pretty much built right into the language.
Need threads? Have your class extend Thread. Most concurrency issues can be addressed with synchronized blocks, no need for mutexes. Ah, you say, but I don't want to have to create a whole bunch of threads all the time, that's expensive. That's ok, Java has ThreadPoolExecutor. You want fries with those worker threads?
We use a lot of JSON round here - XML is so last decade - and it turns out there's a parser built in. Tick that box. Oh, and we use http as a transport for that, and of course that's been present for years, thanks to Apache. Redirects are handled automatically, and all the compression/encryption functions are also in there, and they "just work". If you just need to show the user a web page, they've got a webkit and you can just slap a browser window right there on your view.
All the usual hardware geegaws are exposed for you - USB, BlueTooth, Wifi, accelerometer, audio. And you're not left just sitting there having to figure those out, there's high-level classes to assist you - gestures, audio fx, sip, telephony, the list goes on.
I've also discovered all sorts of nifty things that have been in Java practically from the start, but was too green (or too stubborn) to use. Container classes out the ying-yang. Object serialization. Reflection - are you kidding me? I still struggle with the I/O stream hierarchy pretty much every session (what do I need here? a BufferedArrayInputSequenceFileStreamReader? what does that even mean?), but the docs are almost always helpful, and eventually I figure out the right thing.
I guess the bottom line is that the honeymoon period for me and programming is over, and I'm finding myself seduced by the higher level concepts that come with Java, and not with C. It might be all the PHP I've been writing for the last year and a half, but the appeal of the low level isn't what it used to be.
No comments:
Post a Comment