The Artima Developer Community
Sponsored Link

Java Buzz Forum
re: Stupid Scanner tricks...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Bernard Choi

Posts: 74
Nickname: bchoi
Registered: Jun, 2003

Bernard Choi is online
re: Stupid Scanner tricks... Posted: Dec 9, 2004 2:21 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Bernard Choi.
Original Post: re: Stupid Scanner tricks...
Feed Title: Bernard Choi
Feed URL: http://bchoi.livejournal.com/data/rss
Feed Description: Bernard Choi - LiveJournal.com
Latest Java Buzz Posts
Latest Java Buzz Posts by Bernard Choi
Latest Posts From Bernard Choi

Advertisement
http://weblogs.java.net/blog/pat/archive/2004/10/stupid_scanner_1.html

I was reading the above blog and a little shiver went up my spine. It's been raining the whole day, and that could have been the chill of the night air, but I doubt it.

I like to read code when it's simple and easy to understand, if I can understand the intent of the author without too much deciphering. I'd like to consider the consumer of my code to be the next programmer, rather than the computer.

If I saw

String text = new Scanner( new File("poem.txt") ).useDelimiter("\\A").next();

for the first time, I'd be trying to figure out what the intent is. It just didn't feel right to use a "Scanner" when the intent is not to scan. What's wrong with putting those 4 lines into a common util library ?

Anyway, I'm blogging it here so that if I do see it, I'd spend less time trying to decipher it.

Read: re: Stupid Scanner tricks...

Topic: An appeal: Java Developers lets make peace… Previous Topic   Next Topic Topic: Inverting the Inversion of Control

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use