The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

I need a Java joker/wildcard by Spisefisken2001-07-04 05:05:02
  String.indexOf() by IByte2001-07-04 05:13:04
    Thanks again by Spisefisken2001-07-04 06:03:53
      What's SavitchIn? (n/t) by IByte2001-07-04 06:25:55
        Oh I forgot to mention by Spisefisken2006-11-19 12:55:59
          Still no clue, but.... by IByte2001-07-04 06:51:07
            I found the bug myself by Spisefisken2001-07-04 07:12:25
              Future of your code by DustyX2001-07-04 08:18:17
                Better yet, get back to basics by Schol-R-LEA;2 2001-07-04 09:50:19
You probably will need to refactor the whole thing, to be honest. No big deal; fortunately, its a pretty small class. Here are the things I'd want to know before I could give any advice, starting with a few general questions:

What is the purpose of this class? Is it a standalone program, or part of a larger application?

What is the best tool for the job? Ae you using the right language? The right file format? The right input format? The right algorithm?

What are the characteristics of this class? What actions can an object of this class take? What kind of data does it work on? What are its class variables and instance variables? Its class functions and instance functions? Where is it visible?

What are the objects of this class for? What are their life spans? Where are they visible?

Does this class perform a service for another class? Could it be replaced by a function in that other class?

What are the steps of the process? Which steps can be separated out? Which steps are repeated more than once, and can you abstract them into a separate function?

To get a little more specific:
What is the program used for? What is HLR, and why are you adding it to a file (I think I may be a bit confused on this part)? What is the generated file for?

Why do you have the data entry code in the class initialization, and not in a separate function?

What do the numbers you are comparing the input string against represent? Could you use a data structure (i.e., a Vector, as DustyX suggested earlier) to hold them? Could you read them into such a data structure from a file when the class initializes, (also as DustyX suggested)? Do you need the data at all, or is there a pattern to it, such that a function could used instead?

From what I can see, this might be done better written in Perl (if you know it), or using a regex camparison; are there reasons you couldn't use either of those tools?

These are just the questions that come to mind right off the top of my head. If you can answer them for us, we could probably help some more; for that matter, you probably won't need any more help anyway.

One more thing: I advise you to drop what you are doing and go buy a copy of Programming Pearls by Jon Bentley. Right now. It is all about this kind of thing, and full of valuable insights into the craft of programming.

HTH.
[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)