Weedpacket wrote:In this situation, incidentally, throwing an exception would be more valuable to the developer; then along with your choice of error message they'll have file name, line number, and a stack trace that shows what was being called where at the time. That should help pin down where the wonkiness happened.
I agree. However, like I said before. It's really not a significant feature. Basically, I have a security class with an optional feature that uses javascript to hash username+password+salt and not send the password in the clear. I wrote this feature for clients that wanted a password protected site with minimal security need (no credit cards, etc.) but wanted to keep the password secure in case of a man in the middle (I have an algorithm to help prevent session hijacking.) Not a completely bullet-proof solution (mostly because the packets are not encrypted that follow), but as close as I could get without SSL. Anyways, back to that javascript...
When I first wrote it, I just statically linked the javascript libraries. Later, I thought, "hey, I should dynamically link these scripts, etc." So I wrote a method that just spits out the static html to load the javascript. In the meantime, a developer using it told me that my class was broke. That was some months ago. Then recently I fell victim to my own bad design and struggled for about 15 minutes until I realized I hadn't loaded the javascripts. Now for my point...
Older login scripts are fine because they are statically linked (html loads javascript libraries.) Just because my method hasn't been called, doesn't mean it's broke. I don't want an error breaking those login pages for various other clients (yeah I'm lazy...I could track them all down.) So now a warning pops up when the login form method gets called without calling the javascript method (again the methods are separate because I initially did not include the javascript as part of the object output.) Instructions state that if the javascript references are already there, just set such-and-such property to true. This is wonky, but the form remains functioning as before.
I guess I should stop being lazy, track down the older scripts using this class and pull out the static linking. Then I can just include the javascript loading in the login form method (pending the optional property that turns it on is set.)
Thanks for all your help and suggestions.