PreviousNext…

Why Stack Overflow rocks

Stack Overflow is rapidly becoming my #1 code snippet resource. It is superb, and if you’ve not had reason to go there yet, do so! The whole system of voting up / down questions and answers is like a lovely non-pigeon PageRank™ for code.

For example, after a long day at my current contract, I needed a wee bit o’Java that would pad out an integer to a three-digit string value. Now, there are ways to do this with simple padding, length testing and sub-stringing, but this, I think you will agree, is much better:

String.format("%03d", someIntOrOther); // pads with length of 3

Eh? Eh? Great isn’t it! And the thing is, I just knew there was something like this out there, so rather than flail around in Google, I opted for a simple search (for “java padding”) at Stack Overflow, and collared this code in no time.

I ♥ the Stack Overflow.

(BTW, if you fancy this padding code, you can vote it up and find the whole question / discussion / bonkers rubbish answers here).

Comments

  1. one dev day, and hes a born again loon, they brain wash you there?…now looook at the screenMark Myers#
  2. though thats not gona stop me nicking that nice bit of codeMark Myers#
  3. The sister site http://serverfault.com/ is very useful too!!Rob Wills#
  4. Rob: agreed! Although I would be remiss if I didn’t issue a warning: going to that site, one runs the risk of bumping into people like The Myers.Ben Poole#
  5. As opposed to the poole who will soon be found at http://www.timesonline.co.uk/tol/comment/obituaries/Mark Myers#
  6. Ah hang on:
    Server Fault is a collaboratively edited question and answer site for system administrators and IT professionals

    (My emphasis). Reading that, I think you should be safe. Myers won’t be there.Ben Poole#
  7. true, very true, i only tend to hang out in places where the Poole can be found (trying to limit the damage he does), so try looking in such places as http://www.HamsterFiddlers.com and http://www.iDontDeserveToLive.comMark Myers#
  8. You leave Alan out of it.

    (Alan is the LDC hamster).Ben Poole#
  9. Oh, and here’s Alan:

    http://www.flickr.com/photos/benpoole/4095878560Ben Poole#
  10. /grabs popcorn

    Carry on folks!
    Pedro Quaresma#

Comments on this post are now closed.

About

I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.

";