What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Browse For File

Browse For File
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Browse For File
quote:
Originally posted by Amec
quote:
Originally posted by CookieRevised

js code:
with (OpenFileName) {

Every time you use a with statement, a teddy bear cries.

http://www.yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/
Yeah, well, you're 5 years to late....

Although I agree for 50%, it is mostly also a matter of schematics. There is essentially nothing wrong with using with() if you know what the code will do. In the code snippet it is also used for the exact purpose that with() statement was invented and there are enough readDWORD() statements to justify the use of with() imo.

May I also quote that very same page you linked to:
quote:
If you can’t read a program and be confident that you know what it is going to do, you can’t have confidence that it is going to work correctly. For this reason, the with statement should be avoided.
I can read the program and I am 100% confident in knowing what it is going to do and that it is going to work correctly.

Lastly, it is not my code:
quote:
Originally posted by CookieRevised
So here is my variation, based upon Matti's variation of Choli's snippet. It is of course different, but not that different to be completely 'new'. As such, I've also tried to keep most of the structure and variable names used in the previous variations.
Note that there are also other parts in the code which could be made shorter/smarter/cleaner/etc. But that was not the purpose of showing or updating that code.

This post was edited on 04-14-2011 at 07:53 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
04-14-2011 07:40 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Browse For File - by Volv on 06-24-2006 at 02:04 AM
RE: Browse For File - by matty on 06-24-2006 at 02:19 AM
RE: Browse For File - by Volv on 06-24-2006 at 05:16 AM
RE: Browse For File - by Choli on 06-24-2006 at 09:32 AM
RE: Browse For File - by CookieRevised on 04-11-2011 at 07:46 AM
RE: RE: Browse For File - by Amec on 04-14-2011 at 06:54 PM
RE: Browse For File - by Choli on 04-11-2011 at 06:41 PM
RE: Browse For File - by CookieRevised on 04-11-2011 at 08:13 PM
RE: Browse For File - by matty on 04-14-2011 at 07:06 PM
RE: Browse For File - by CookieRevised on 04-14-2011 at 07:40 PM
RE: RE: Browse For File - by Amec on 04-14-2011 at 07:53 PM
RE: Browse For File - by CookieRevised on 04-14-2011 at 07:58 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On