What
 · Technology
 · · Coding
 · · · Java

Silly Java Strings · Be­ing a hyper-pedantic note about turn­ing bytes in­to Ja­va strings and a small fix for a small­er and almost-purely-aesthetic but ubiq­ui­tous prob­lem. [Up­date: Heav­i­ly re­vised with a bet­ter so­lu­tion.] ...
[13 comments]  
Puzzling IDE Evidence · Eclipse’s Ian Sk­er­rett re­ports that their mar­ket share is up to 65% and grow­ing, and that NetBeans sank in the last year, based on a plausible-looking sur­vey from BZ Re­search (pub­lish­ers of SD Times and Eclipse Re­view). David Ber­lind is think­ing about me buy­ing him din­ner next year. But wait: Ro­man Strobl ri­postes, show­ing the num­bers of unique in­stances of NetBeans that are used enough to be call­ing in­to the up­date cen­ter look­ing for patch­es; and it shows quite a dif­fer­ent pic­ture. First, this is a gen­uine­ly in­ter­est­ing sta­tis­ti­cal anoma­ly. I don’t think for a sec­ond that ei­ther Ian or Ro­man is ly­ing; there are some good sug­ges­tions as to what might be go­ing on in both Ian’s and Roman’s com­ments. Se­cond, I love this com­pet­i­tive spir­it; when en­gi­neers try to top each oth­er, cus­tomers win.
 
NetBeans RFEs · What hap­pened was, I got coder’s block; fac­ing an icky part of my Si­grid/Zep­pelin side-project, I pro­cras­ti­nat­ed for weeks be­cause all of a sud­den ev­ery­thing else be­came more in­ter­est­ing. Wel­l, I’m sup­posed to talk about it at Ja­va One and I’ve refac­tored large parts of it to the point where it doesn’t work any more. So I’ve in­creas­ing­ly been spend­ing my time slav­ing over a hot NetBeans 5.0. There is ab­so­lute­ly no bet­ter way to find out the truth about soft­ware than ac­tu­al­ly us­ing it to get re­al work done. Note: I’m do­ing all-POJO low-level in­fras­truc­ture, so I don’t know the first thing about JSF’s and Lay­outs and Web Ser­vices and all that stuff. Hav­ing said that, for what I’m do­ing, NB5.0 is fuck­ing good soft­ware. Among oth­er things, it’s re­al­ly re­al­ly fast on my Pow­erBook, and speed is a fea­ture (although to get the most out of it you need a big­ger screen). Yes, the Ul­tra 20 is faster on com­piles, but I’m hav­ing trou­ble get­ting it on VPN so it can talk to CVS, and for in­ter­ac­tive on-screen work, the dif­fer­ence isn’t sig­nif­i­can­t. Any­how, I’m keep­ing a run­ning RFE list; for those not in the soft­ware biz, that stands for Re­quest For En­hance­men­t; they arise when a cus­tomer says “Your stupid soft­ware is bro­ken, it should do X” and some hard-ass man­ag­er with his eye on the ship date says “That’s not a bug, it’s an RFE.” If I were a Good NetBeans Ci­ti­zen I would go find the right web forms and sub­mit bugs and RFEs and so on, and maybe I will. But right now I’m in a hur­ry and (mua­ha­ha­ha) I’m a blog­ger! So I’ll just use this post as a place to track ’em. The rest of this is on­ly of in­ter­est to IDE in­ter­face geeks and NetBeans pha­nat­ic­s ...
 
Nexenta/NetBeans/OS X Notes · I’m run­ning NetBeans 5 on my Ul­tra 20, us­ing Nex­en­ta GNU/So­laris as the OS. This buys a lot of per­for­mance, but I on­ly want to have one screen/key­board, so I’m rout­ing the UI through my Mac via X11. I don’t know how com­mon a sce­nario this is go­ing to be, but ear­ly in­di­ca­tions are it’s a damn pro­duc­tive work­ing en­vi­ron­men­t. I’m dis­cov­er­ing some things, so I’ll post them here as I go along in case oth­er peo­ple run across some of the same is­sues. [Up­date: Keymap­ping pro­gress, whines, and bugs] ...
 
NetBeans 5.0 · It’s hit the street. I use it, I like it. Hm­m, look­ing at the list of new stuff, I think that “I use it” state­ment is po­ten­tial­ly mis­lead­ing. I’m a POJO kind of guy, I prob­a­bly on­ly use a quar­ter of the fea­tures. So I guess I can say for sure that I like 25% of it. In par­tic­u­lar, I can say that each of these point re­leas­es gets a lit­tle sweet­er for us Mac­in­toshi­an­s.
 
IDE Bet · I’m hap­py to an­nounce that some­time in ear­ly 2007, David Ber­lind will be buy­ing me a nice din­ner. To­day, David wrote a piece not­ing that Lat­tix (in­ter­est­ing out­fit, by the way, check out the de­mo) is join­ing Eclipse, and con­clud­ing “Is it time for NetBeans to fi­nal­ly throw in the towel?” Mis­guid­ed of him, I thought. So I’ve pro­posed a bet: we’ll have a nice din­ner to­geth­er first time in ’07 that we’re in the same city. If, at that time, David still thinks that throw­ing in the NetBeans tow­el is a good idea, I’ll buy din­ner. Other­wise he buys. For­tu­nate­ly for David, my tastes in food and wine are fair­ly plebian.
 
NetBeans Tip · I tried out Joshua Marinacci’s re­cent Net­beans on Mac Tip (d­if­fer­ent GC set­ting) and it worked like a char­m. I sus­pect that this ought to be the de­fault set­ting for NetBeans on most sys­tem­s. I talked to a NetBeans in­sid­er in Prague and he mum­bled about hard-to-reproduce weird­ness with this set­ting on pre­vi­ous NetBeans & Ja­va re­leas­es, but I haven’t seen a sin­gle hic­cup. It turns out that on the AMD64 sys­tem­s, lots of peo­ple are run­ning more or less ev­ery­thing Ja­va in -server mod­e. Hm­m­m.
 
NetBeans Progress · I just shift­ed to the Be­ta 2, which is nice be­cause I’d been run­ning the nightlies to get around an ir­ri­tat­ing lit­tle bug, and that’s kind of liv­ing dan­ger­ous­ly. Here­with a progress re­port, a prac­ti­cal warn­ing about a CVS gotcha, and a pre­dictable gripe. If you’re in­ter­est­ed in this stuff I’ve writ­ten about it lots. [Up­date: Dave John­son of­fers some slightly-tougher love.] ...
 
NetBeans CVS · The NetBeans guys have been do­ing a lot of chest-thumping about how great the CVS sup­port is in the be­ta. I’d nev­er tried it, but I want­ed to check in a bunch of code to­day. I’ve been do­ing command-line check-in from my Mac to my servers for a long time and it’s Just Worked. On­ly I hadn’t done any CVSing for a cou­ple of months and fur­ther­more I need­ed to cre­ate a whole new top-level pro­jec­t. Here’s a con­fes­sion: I’ve nev­er ac­tu­al­ly set up or ad­min­is­tered a CVS, some­one else has al­ready done that and I’m ba­si­cal­ly just a sta­tus/d­if­f/up­date/­com­mit script kid­die. But how hard could it be? After a half-hour I was get­ting ir­ri­tat­ed be­cause I just couldn’t fig­ure out the (doubt­less ob­vi­ous) in­can­ta­tion to get my code in. So I went back to the NetBeans be­ta and said “import this project” and it asked a cou­ple of sen­si­ble ques­tions and then it all Just Worked. Then I made some mi­nor changes and did some check-ins to make sure it wasn’t just smoke & mir­rors. I’m al­ways a lit­tle ner­vous when soft­ware au­to­mates away some­thing that I’ll prob­a­bly have to know how to do some­day (“pay no at­ten­tion to the cvs -d be­hind the curtain”), but so far it’s re­al­ly smooth.
 
NetBeans 5 Beta · Late on Tues­day the 27th, the NetBeans guys I was talk­ing to in Prague had to break for a go/no-go meet­ing on the Be­ta. I said “Mind if I come along? I’ll just listen.” Of course when they went around an­nounc­ing the peo­ple at the ta­ble and on the phone (NetBeans is very dis­tribut­ed) some­one piped up “Tim Bray’s here and he’s gonna blog ev­ery word.” I won’t, but I do have some en­ter­tain­ing sto­ries about the vis­it and the launch ...
 
NetBeans 5 Beta · Yes­ter­day I was in fly-on-the-wall meet­ing in Prague when they de­cid­ed to ship the 5.0 Be­ta; to­day I’m sit­ting in pina, an In­ter­net café in Kop­er, Slove­nia where the WiFi is free as long as you drink, and just heard that the but­ton has been pushed. I don’t have time now to tell my in­ter­est­ing NetBeans sto­ries; I’ll post them here, but in the mean­time, go check out that be­ta.
 
In or Out? · I have pre­vi­ous­ly ques­tioned the what seem like weird method names in Java’s newish Pro­cessBuilder API. It turns out that its not-newish-at-all close per­son­al friend Pro­cess is lit­tle strange too: it has getOut­putStream and getIn­putStream which re­spec­tive­ly get you pipes to the process’ stan­dard in­put and out­put. Da­ta comes out of the Pro­cess and you want an In­putStream, so it has to be getIn­putStream. But how can getOut­put get you the in­put while getEr­ror gets you the er­ror? OK, call me anal, I can take it. But I’m writ­ing a class right now kin­da like Pro­cess, and I sim­ply ab­so­lute­ly can’t bring my­self to call the in­put the out­put and vice ver­sa. So I have getTaskIn­put, getTaskOut­put, and getTaskEr­ror, which pro­duce out­put, in­put, and in­put streams re­spec­tive­ly. We all have to deal with the con­fus­ing na­ture of re­al­i­ty in our own ways.
 
NetBeans 5 · I’ve been run­ning the NetBeans 5.0 pre-beta for a week or two now, and I thought I’d post some real-time notes for what I turn up. Sum­ma­ry: some re­al­ly neat stuff, few­er bugs than you’d think, one ma­jor dis­ap­point­men­t. [Up­date: Alt-P is gone, good.] ...
 
Happy Ending · I was pret­ty up­set by El­liotte Rusty Harold’s flame the oth­er day—not up­set at El­liot­te, but at the le­gal barbed-wire some­one had set up in front of NetBean­s. I, among oth­er­s, rat­tled some cages, and then to­day this cau­tion­ary tale showed up on Tim Boudreau’s blog. As I read it, I got mad­der and mad­der and mad­der, be­cause it seemed like Tim was on the wrong side. I’ve worked with some of the lawyers at Sun and been very im­pressed, so I as­sumed that this is­sue was just an over­sight to be cor­rect­ed; but it sound­ed like Tim was say­ing “if you hold your head side­ways and squin­t, you can see that black re­al­ly is white”. I was get­ting ready to do a lit­tle flam­ing of my own, then I got to the end of Tim’s piece, and it turns out they’re go­ing to do the right thing. So whether black is (le­gal­ly) white or not, no­body else is go­ing to have to turn their head side­ways and squin­t.
 
NetBeans Notes · Item: For those of you who mi­grat­ed from Emac­s, you can eas­i­ly teach NetBeans control-F/B/N/P/U/D: go to Tools - Op­tions - Edi­tor Set­tings - Glob­al Key Bind­ings. Huge time-saver, and this should be the de­fault on OS X, since ba­si­cal­ly ev­ery oth­er text con­trol has those bind­ings wired in. Item: I up­grad­ed all at once to OS X 1.4, and Ja­va 1.5, and NB 4.1 (from a re­lease can­di­date), and a lot of JXTA li­braries, and things are slow­ing down. I don’t like this; in par­tic­u­lar I hit control-space for au­to­com­plete or F9 for com­pile and it some­times has to think for a sec­ond first, which is nut­s. [Up­date: Fixed it! I had stupid­ly put all the sup­port li­braries that JXTA needs to run in­to the compile-time list, so they were go­ing on the class­path. Take ’em all out and it’s back to near­ly in­stan­t.] Item: Pro­ject Coy­ote is com­ing along nice­ly, and it’s in­creas­ing­ly ob­vi­ous that dy­nam­ic lan­guages on the JVM are go­ing to be huge. Item: NetBeans Day at Ja­va One looks like it’ll be se­ri­ous fun. Item: (This is not NB-specific.) When I go grab a new API, it’s just way too much work to tell the IDE about it and get the jars and Javadocs in place. There ought to be a stan­dard way to pack­age a Ja­va API so that you can point your IDE at some URI and it Al­l. Just. Hap­pen­s. Item: Here’s a nice fea­ture, does any IDE have it? When I say
Zig­garut z = new Zig­garut(brick­s, stones);
then the IDE should fig­ure out that that’s a com.­tex­tu­al­i­ty.3d.Zig­garut and in­sert the ap­pro­pri­ate im­port state­ments for me, it’s a to­tal waste of time for me to go pok­ing around try­ing to re­mem­ber where that was. [Oop­s: NetBeans has “Fix imports”, Eclipse is pro-active about sug­gest­ing it, and the IDEA cult as­sured me (as usu­al) that they have some­thing even bet­ter.]

 
How To Make NetBeans Better · I had a rev­e­la­tion to­day: while I some­times work with a big screen, I nor­mal­ly leave NetBeans at the de­fault size for my lap­top screen. I try hard to keep meth­ods smal­l, so it’d nev­er oc­curred to me to hit the lit­tle green “maximize” but­ton. To­day, one of my (JXTA-wrangling) meth­ods kept grow­ing and grow­ing, and with­out think­ing I threw 2.3 mil­lion pix­els at the prob­lem. Holy cow... I’ve been cod­ing with one arm tied be­hind my back. Devel­op­ers ev­ery­where: get more pix­el­s. You need them, whether you know it or not.
 
NetBeans 4.1 · Now on­line here. First im­pres­sions in­clud­ing com­plaints, and a blogging-policy co­nun­drum ...
 
Project Coyote · Its goal is dy­nam­ic lan­guage sup­port in NetBeans, and it’s open for busi­ness over at Java.net. Check it out ...
 
NB4.0++ · Last Wed­nes­day, NetBeans 4.0 was re­leased, and I have a lit­tle add-on an­nounce­ment too. I’ve writ­ten be­fore about NetBeans here, here, here, and here: it’s fast, it’s slick, it’s Ant-based, it does what I need. The on­ly thing they’re ex­cit­ed about in 4.0 that I haven’t al­ready talked up is the fact that J2ME/MIDP and Tom­cat are built in; in fac­t, the NetBeans guys like to point out that you can do most things out of the box with­out hav­ing to hunt down and in­stall plug-ins. In bad news, I have a sig­nif­i­cant gripe with NetBean­s. In good news, we’re do­ing some­thing about it ...
 
Dynamic Java · It’s pret­ty clear that dy­nam­ic lan­guages are a hot area, maybe the hottest, in the world of soft­ware de­vel­op­men­t. We need to do more to make them eas­i­ly us­able by peo­ple in the Ja­va ecosys­tem. So on Tues­day we held a sum­mit here at Sun, with a few of our in­ter­nal Ja­va lead­er­s, and on the dynamic-languages side, Lar­ry Wall and Dan Su­gal­s­ki (Perl and Par­rot), Gui­do van Ros­sum, Sa­muele Pe­droni and Sean McGrath (Python), and James Stra­chan (Groovy). It was an ed­u­ca­tion­al day for us; here­with some take-aways and pic­tures ...
 
NB4 RC1 · Which in English means “NetBeans 4.0 Re­lease Can­di­date 1”. I’d been dis­tract­ed from work on the Zep­pelin project for a cou­ple of months but have upped tools again and the tool is NB4RC1. The news is most­ly good ...
 
IDEs and their Projects · I just fin­ished mov­ing my project Zep­pelin de­vel­op­ment over from NetBeans 3.6 to the 4.0 be­ta. It’s re­al­ly very nice now that I’ve got it go­ing. The prob­lems were all in the Pro­jects sub­sys­tem, which in my ex­pe­ri­ence is of­ten the Achilles’ heel of IDEs ...
 
NetBeans Profiler Yee-hah! · This will be (blush) my first un­qual­i­fied over-the-top fan­nish rave about a piece of Sun tech­nol­o­gy. Those who are not Ja­va geek­s, and those who don’t wor­ry about ap­pli­ca­tion per­for­mance, and those who are em­bar­rassed by un­abashed boos­t­er­ism can all move right along, noth­ing to see here. Wel­l, there’s al­so a fun­ny Emac­s/Gosling foot­note [... which I up­dat­ed since many peo­ple wrote me that I had mis­at­tribut­ed Emac­s] ...
 
GC Bible · Via Moazam Ra­ja, a point­er to the truth, the whole truth, and noth­ing but the truth on Ja­va garbage col­lec­tion. This will be in­ter­est­ing to on­ly 1% of even the hardest-core geek­s, but for those peo­ple it will be re­al in­ter­est­ing. My cur­rent skunkworks is called Pro­ject Zep­pelin, and I just know that I’m go­ing to need to know this stuff. Moazam has more goodies—his own, noth­ing you can find at docs.sun.com—here.
 
Java Ho! · Wel­l, I think Genx is pret­ty well put to bed. (Need to gen­er­ate XML? Need dig­i­tal sig­na­tures? You need Genx.) So, in be­tween end­less phone/chat about WS-Uncluttering and Jython pack­ag­ing and IETF pro­cess, I man­aged to start sketch­ing out some next-project ideas to­day. And it’s go­ing to be Java, I’ve been in the C-language mines for the past few years and that’s OK, but I work for Sun now and I ain’t go­ing near So­laris in­ter­nal­s, so Ja­va Roolz OK ’round here, you hear? Wow, it’s grown since the last time I was in the neigh­bor­hood. Hey, I just load­ed Ustr in­to NetBeans and it Just Worked, even got JUnit to run all the test­s. This “object-oriented” stuff, it’ll catch on, just watch.
 
author · Dad · software · colophon · rights
Random image, linked to its containing fragment

By .

I am an employee
of Amazon.com, but
the opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.