04: FINDing your Way Around

This is a temporary forum setup for the purpose of discussing the EMC standards
Locked
Ptirhiik
Registered User
Posts: 144
Joined: Sun Apr 06, 2003 12:29 pm

Re: 04: FINDing your Way Around

Post by Ptirhiik »

Not sure at all : prec page I gave you valuable examples issuing to a silent wrong installation, and the last example I quote fit perfectly what you are proposing there. I agree the last one is ridiculous, but at least it is perfectly convenient with the requirements you suggest. Now if the concrete examples don't convince you there is an important silent issue with this designing, especialy on template files, you are right, there is nothing to discuss there : a mod written absolutly correct, and doing unique find on lines as it is required won't be installable with easymod (not mentioning EMC or not) because the tool won't follow what is written in the receipe, without any really solid reasons given there : the ones you quoted don't appears in mod (modifying the begining of a line is very rare - I have actually no example in mind - where repeated fragments throught the code occurs much more often, beginning of the line being very often the only way to distinguish one from another).

My main worry then is to be sure that "FIND" requirement won't be forced to become the mod team phpBB one, as it would involved longer finds (many lines in this case) than the minimal required (one line), and still can completly screw the board in some case, as even with searching on a precise block, you will not sure easymod will pick the only one present in the script, because some can be present commented too.

Note also performing the real FIND won't never prevent a mod to be installed even if some lines are duplicated, one with comment, the other without : the mod will just be installed at the place it is supposed to be, on the uncommented lines, what won't be able to do easymod in this case.
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: 04: FINDing your Way Around

Post by Nuttzy99 »

I really want to ignore this topic now, but you do deserve an explanation. You've been very good about working with me on other things and you deserve a straight answer.
Ptirhiik wrote:Now if the concrete examples don't convince you there is an important silent issue with this designing, especialy on template files, you are right, there is nothing to discuss there
Your "concrete" examples are more like swiss cheese and are easily solved. The difficulties you are running into with the is_auth line are being artifically created by yourself. I've already told you that commented lines are you add in your MODs are a no-no, but I'm willing to work out a compromise so that EM will know when to skip such lines if you are hellbent on using them. The code around the is_auth line appears like this...

Code: Select all

global $template, $userdata, $lang, $db, $nav_links, $phpEx;

//	$is_auth = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);

	$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
...the desired effect should then be like this...

Code: Select all

global $template, $userdata, $lang, $db, $nav_links, $phpEx;

	$is_auth = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);

	$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
...simply remove the // and be done with it. EM will automatically add a comment saying what has transpired. If you really really really want to have your own comments though then we can work something out so that EM will know to skip comments with a special kind of marking.

Now on to the next "concrete" example...

Code: Select all

#---[ FIND ]----------
<tr><td class="row1">
...exactly what the heck is unique about this? Absolutely nothing. The FIND block needs to include more lines in this case. This is ridicuously easy to solve :roll: You said something about an issue "especially on TPL files". What was the issue? I'm serious, if you pointed one out I've missed it and you will need to restate it.
a mod written absolutly correct, and doing unique find on lines as it is required won't be installable with easymod (not mentioning EMC or not) because the tool won't follow what is written in the receipe, without any really solid reasons given there
Denied. I've solved every problem you've thrown at me so far. If I've not done so please restate them.

the ones you quoted don't appears in mod (modifying the begining of a line is very rare - I have actually no example in mind -
Are you just being stubborn here? You've never had to modify an IF statement? Is it unthinkable to think that people may need to do this fairly regularly?
where repeated fragments throught the code occurs much more often, beginning of the line being very often the only way to distinguish one from another).
This is where you go really wrong. If the fragment is repeated throughout the code then USE MORE LINES TO DESCRIBE YOUR FIND BLOCK. What is the issue??? The TPL example you quote was utterly ridiculous.
My main worry then is to be sure that "FIND" requirement won't be forced to become the mod team phpBB one, as it would involved longer finds (many lines in this case) than the minimal required (one line), and still can completly screw the board in some case, as even with searching on a precise block, you will not sure easymod will pick the only one present in the script, because some can be present commented too.
Totally untrue. If this is happening then you are not achieving minimal uniqueness.
Note also performing the real FIND won't never prevent a mod to be installed even if some lines are duplicated, one with comment, the other without : the mod will just be installed at the place it is supposed to be, on the uncommented lines, what won't be able to do easymod in this case.
Again, if the Author is using minimal uniqueness then EM will NEVER (do I need to underline, bold, italic, change font size and color of this?) install to the wrong spot. However your method will reduce the chances of FINDs running succesfully. Also even your own method will indeed insert code into the wrong spot if the desired code is proceeded by your "muted" lines using /* */ Unless you want me to start tracking these too. It just crazy. Just don't leave comments like that as there is no reason for it.

Listen, if you want to workout a method so your crazy commenting method of commenting out hundreds of lines of code still works then I think this is easily doable ;)

-Nuttzy :cool:
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: 04: FINDing your Way Around

Post by Nuttzy99 »

I think this discussion has been very helpful. I should use the info here to make a little FAQ. The same thing is probably going to happen when I present it the MOD Team or to phpbbhacks.com so the more that the people I trust the most (like Ptirhiik) question things, the more comfortable I'll feel dealing with strangers ;)

Thanks again for the discussion. Even though we disagree, I do understand that you are only trying to do what you think is best for the community.

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site
Ptirhiik
Registered User
Posts: 144
Joined: Sun Apr 06, 2003 12:29 pm

Re: 04: FINDing your Way Around

Post by Ptirhiik »

Of course I'm dealing for the whole communauty, not only preaching for my chapel :).

But yes, I can't agree : for example, still on the auth, you are supposing the is_auth line (which is originaly in the phpBB code commented) only requires to be uncommented, then I point in the example the auth getting was surrounded by other lines, and so wouldn't take place as it's original spot. I see no problems with this, they are many place in phpBB where the code can be optimize by respoting some lines.
Also, processing the find as you proposed to do deny the ability to add any comments, even if it is not simply a muted line, in the script. There it is no more a matter of how redacting a mod script, but what an author should set in code or not : the tool walks on the code code garden, which it is not supposed to do, or you have to extend the EMC norm to a programing norm (and I'm not talking about poor programming there).

The main point is the issue regarding the find itself (writing in a close way is not a big deal) : propose a way to find an unique line, without including more line to find than today, and then I will listen very closely : you have set the rule only minimal find should be require, there you are suggesting to add more lines to a find that today is enough to be recognize as unique. The gain is quite null, as even for an if, the change usually don't take place at the start (BTW, I don't know a lot of if modified by mods, more often an else is added, or a new if takes place before or after).

To answer to your question about the uniqueness : the line itself is unique : considering the start of the line, you won't find it anywhere else.

My point is, you are one side willing to reduce the size of a find statement (what can be usefull), but other side, you are asking to increase it. The improvement of dealing with a floating find doesn't concern a lot of issue (really, there are only a few mods that modify the begin of a line), but much more which deals with lines with content that can be found elsewhere in the file, including comments, table and form declaration in tpls, and so.
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: 04: FINDing your Way Around

Post by Nuttzy99 »

This is not going to get us anywhere with our current approach. I didn't understand or I disagree with just about everything you are saying. We both communicate in code well. Why don't you begin by posting some code snipits that show your point of FIND in TPL's failing. This happening is something I sincerely doubt. If you can convince me of this then you can probably convince me of more.

Let the code do the talking ;) Let's see some FINDs with my method failing in TPL's. Be sure to present enough info so I can see exactly what lines you are talking about in the TPL so I can replicate it myself and also share with you how I would write a MOD for it.

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site
Ptirhiik
Registered User
Posts: 144
Joined: Sun Apr 06, 2003 12:29 pm

Re: 04: FINDing your Way Around

Post by Ptirhiik »

Well, I have already set an example on php files, with the $is_auth commented originaly in phpBB : I can dig through the tpls too if you want, but it will be exactly the same thing.
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: 04: FINDing your Way Around

Post by Nuttzy99 »

Humor me ;)

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site
Ptirhiik
Registered User
Posts: 144
Joined: Sun Apr 06, 2003 12:29 pm

Re: 04: FINDing your Way Around

Post by Ptirhiik »

You can ie search in overall_header (first file opened, first issue found) :

Code: Select all

#---[ FIND ]------
<table width="100%"
it is unique considering the start of the statement, multiple while considering it as a fragment.
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: 04: FINDing your Way Around

Post by Nuttzy99 »

And I am saying this is totally unacceptable. People have to use common sense. Do I really need to say that we are looking for the "minimum uniqueness that is not asinine"!?!?! We are looking for REASONABLE fragments. Please tell me you are not seriously thinking that I would be recommending someone use something like that. Please tell me you have a serious example.

What I consider unique in a TPL file are the template variable names. You can usually work one of these into your FIND block. Certianly you can at least add more to the FIND than the ridiculous fragment you are using.

If you are telling me that EM is fundamentally flawed then you are going to need a heck of a lot more compelling case than this! I have to go to bed now. Take a couple hours if you need to come up with a good example and not a ridiculous one.

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: 04: FINDing your Way Around

Post by Nuttzy99 »

I also suggest you read the Other Hint section of this document. It addresses some of the ridiculous things you are doing. Primarily it says to use text that is not likely to be modified by other MODs. This also appears in "the least you need to know section". But please, common sense does apply.

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site
Locked