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 » Sat Sep 06, 2003 5:27 am

As you have noticed, there is a functional issue with modifying your bowman .= line, as it is no more active there (this is the very important thing to consider). There, you will install a mod you won't at hand, and making a silent issue (no warnings, nothing at all, just the insertion at the wrong place). For an exemple, consider a numeric var, a mod adding \"* 10000\", and the value written in the database. I let you imagine the result to the database because of this functional issue (and also the job to track it back, and fix the data if it is able - probably not BTW if the issue is discovered to late) which shouldn't exist at all (and won't with a manual installation).

Now consider what I was standing in the quote of functions.php : this is a very concrete example : you have to add the auth check in the jumpbox function, but not at the start of the function (code requirement). You will so add later in the code the same line. A mod, which can be ie an extension, an upgrade, anything else, will come on it, adding or modifying something to this line. In order to find it, you have no other choice to extend the find, which supposed you know what is before (which is quite far to be sure), and the prec lines will be also different from the line commented (which is also far from sure).

In first case, you add a silent functional issue that wouldn't exist if you installed the mod by hand, in the second case, you go against the requirement of having minimal unique fragment to search artificialy.

Third thing : a tool doesn't have to interfer with the code resulting : if the code has to result in a particular state, because the author just find it convenient for his purpose, I really don't see any reason to deny him to do it that way : it is just a very good way to proceed to comment modifications performed, and a good comment has to be very precise, so will at least include part of the original code (stating accurancy).
The aim of the tool is to follow a receipe : as long as the receipe is well enough written to give the best chance to install the mod even on modified lines (I assume this is the definition of EMC), I see any reason the tool has to influence the final state of the code, what you are suggesting.

Forth, you have to consider a script can be in any state before applying a mod, including a bunch of comments set by the webmaster (prooving he is just fair and works well, concerned by upgrades and tracability). From there, you have to choose if the tool requires an exclusive use or not, meaning it can't be reliable elsewhere than on fresh phpBB and can't handle further manual modifications (no fixes, no enhancements, no sligh modifications), which I think is not the aim searched.


As a conclusion, I can't see what could be the problem with checking a line is commented out and not considering it for modifications until the find specifies this particular line (so adding the commentary tag to), but I see many reasons - and not slight ones - to not consider this line as a valuable one for the modifications until it is clearly specified (what I, you, and quite everybody will do at hand btw).

User avatar
-=ET=-
Registered User
Posts: 211
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: 04: FINDing your Way Around

Post by -=ET=- » Sat Sep 06, 2003 5:53 am

[quote=\"Ptirhiik\"]In first case, you add a silent functional issue that wouldn't exist if you installed the mod by hand, in the second case, you go against the requirement of having minimal unique fragment to search artificialy.
[/quote]
I'm not convinced as in the first case LIP forget that you ask to start the FINDs at the beginning of the lines, and you forget that this kind of comments should not be allowed (so no one respect all the conditions of the other to let it work) ; and in the second case the issue has nothing to do with comments. This case may occurs out of the comment context and is not due to comments.

------------

But...
OK, after being ''insultive'' once again :roll: I'll try now to help and clarify this never-ending debate by doing some science fiction.
It will be double or quits, but I take the risk...

First of all, all (yes I said ALL!) I will say is just MY opinion, my imagination and nothing else! :roll:

-------------

#1 The fact is (IMO, remember!), that Ptirhiik wants to be able to transform code lines in comments in it's how-to.
I've no real opinion about the real utility of this but that's not the problem, the fact is that it's its right to want to be able to do this.

#2 Then, another fact is that Ptirhiik is very attached to manual installations, and then (I think, IMO, etc. :roll: ) a good part of what LIP called insistence, is due to Ptirhiik's wish to be able to add this kind of comments in its how-to because it's his only way to add them in manual installation.
We often suggest him that EM will probably do the same automatically (for the uninstallation feature) but the fact is that this will not solve it's wish for manual installation (he never talked about that but I that's my personal deduction - IMO, etc. :roll: )

#3 But!
Another fact is (IMO, etc.) that it's IMPOSSIBLE to force the FIND command to find strings necessarily starting from the beginning of the lines.
Nuttzy has clearly demonstrate this many times and I think (IMO, etc.) that this will not change. It's really impossible without prevent EM from being able to do his job and install more than 1 MOD.

#4 So, if we all agree about this statement, what are the possible workarounds/compromises to let EM do his job and let Ptirhiik manage his how-to as he wants for manual installations?

I think there are 2 possibilities:
- Nuttzy's suggest: ''inserting just a couple characters to let EM know'' these comments.
Problem: Ptirhiik seems not satisfied by it (''a find shouldn't achieve on an explicit commented line, as long as the find statement itself doesn't include the comment tag ( // ) ... etc.'').
- ok so another possibility (and this is my suggest to help Ptirhiik - that has never been suggest here I think) may be: proceed the FINDs as they should be (as it is currently done), but test if the string to find does not start by a couple of slashes and the beginning of the line found does; in order to skip it.

Ok it's a bit more complex to program for Nuttzy (test the 2 first characters) but the FIND will be proceed correctly to let EM find lines by unique strings (and not whole lines, or necessarily beginning of lines), Ptirhiik will be able to put all the comments he wants in his how-to, EM will be able to skip this kind of comments, and EM will still be able to find voluntary comments :D

So?
What do you think about that?

P.S.: I hope I will be judged as constructive this time, as this is one of the rare proposals of this topic and not only one more simple justification
Eternal newbie

Ptirhiik
Registered User
Posts: 144
Joined: Sun Apr 06, 2003 12:29 pm

Re: 04: FINDing your Way Around

Post by Ptirhiik » Sat Sep 06, 2003 6:03 am

a find shouldn't achieve on an explicit commented line, as long as the find statement itself doesn't include the comment tag ( // )
proceed the FINDs as they should be (as it is currently done), but test if the string to find does not start by a couple of slashes and the beginning of the line found does; in order to skip it.
Don't you feel you are just repeating what I'm saying ? :lol: And it is not a matter of what I want or not, it is just a matter of an issue I identify, that's all. It is not relative to the way I wrote my mods, nor the way I add comments to the source : it is much more generic (or I will have stop this discussion far more before).

An you mislead yourself too on the insistence on keeping the mods installable at hand. It is just a thing that is very important : a user has not to be tied to a tool, he has to keep the choice to use it or not, as it will. Some will always prefer proceeding at hand, some will only use easymod, some - which I am - will use it when the gain is real (ratio knowledge of the board/facilities). As modifying at hand is always doable, a mod can remain hand-installable. If mods were patches and not mods, this would be different : there they aren't.

User avatar
-=ET=-
Registered User
Posts: 211
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: 04: FINDing your Way Around

Post by -=ET=- » Sat Sep 06, 2003 6:29 am

Code: Select all

Don't you feel you are just repeating what I'm saying ? lol
Absolutely not!

Sorry Ptirhiik but I'll be as contemptuous as you since some posts: think 2mn instead of laughing please :roll:

You ask to find from the start of a line to any character.
I suggest to find any sub string, find the line, and have a look at it's first 2 caracters.
That's completely different!

Asking to start your string to find at the beginning of the line...

Code: Select all

# 
#-----[ FIND ]------------------------------------------------ 
# 
				<td valign=\"top\" nowrap=\"nowrap\">{postrow.QUOTE_IMG}...
...is not as perform a FIND on any unique substring of this line...

Code: Select all

# 
#-----[ FIND ]------------------------------------------------ 
# 
{postrow.IP_IMG}
...and verify after if the line find start or not by //...

Code: Select all

//				<td valign=\"top\"...
I think that's easy to understand :roll:

Code: Select all

And it is not a matter of what I want or not, it is just a matter of an issue I identify, that's all.
The problem is that at the present time, no one is convinced by that.
There is no real issue in what you said. You just want comments that can cause issues, that different!

Code: Select all

An you mislead yourself too on the insistence on keeping the mods installable at hand. It is just a thing that is very important  a user has not to be tied to a tool, he has to keep the choice to use it or not, as it will. Some will always prefer proceeding at hand, some will only use easymod, some - which I am - will use it when the gain is real (ratio knowledge of the board/facilities). As modifying at hand is always doable, a mod can remain hand-installable. If mods were patches and not mods, this would be different  there they aren't.
No one said that it's not important where have you read that?
EMC MODs can already perfectly be installed by hand and no one ask to remove that.

Simply the fact is that EM will perform the code line comments you want!
So what is your need now if it's not to be able to add them even for manual installation?

--------

That's always a pleasure to try to find a wordaround for you Ptirhiik, thanks :roll:
Eternal newbie

Ptirhiik
Registered User
Posts: 144
Joined: Sun Apr 06, 2003 12:29 pm

Re: 04: FINDing your Way Around

Post by Ptirhiik » Sat Sep 06, 2003 7:08 am

You doesn't seem to notice than till this post I proposed other solutions in order to minimize the risks linked to the issue of real unique fragment not usable for search. So yes, you are just repeating what I was saying there. As it seems you didn't understood it (no judgement), I should advice you to reread all since this point, it will perhaps make more sense to you ;).

(note this also : I am perfectly sure to have with a manual installation what I want as result after a mod. At this time, because of the comment issue, I'm not with easymod, although I should : I have already experienced this, and have to modified some codes, as easymod is under developpement and what we are debating there wasn't on the today list. Of course doing code modifications in order to make easymod able to install a mod is not acceptable as a rule : it was just an exceptional way to proceed in order to promote the tool.
Second notice : a // on a tpl is not a good way to write it (running issue) : it should be written <!-- instead. As tpl comments work quite the same way than /* */, I didn't get there intentionaly in the debate : the only way to solve this issue needs some extra requirements that I won't deal there : relative to template standardization)

LifeIsPain
Registered User
Posts: 5
Joined: Wed Jun 18, 2003 3:47 pm

Re: 04: FINDing your Way Around

Post by LifeIsPain » Sat Sep 06, 2003 7:14 am

Ptirhiik: I am pretty sure I understand mostly what you want, but I am saying I do not think this will work. I am not opposed to using (for instance) //OL instead of just // (OL is for original line) as much as I am opposed to simply saying that // should be ignored or not ignored. Functionally, we are looking for unique sections of the line, and if there are two instances of $foobar, regardless if one has a // in front, they are not unique

But I have not seen in your argument any convincing reason why even a //OL should be used (other than the author wanted to use it). We are looking for a functional model (which I know you do know) and as far as functional, I see the extreme benefits of ignoring if there is a // at the start or not, and I do not see nearly as many problems with this.

Ptirhiik
Registered User
Posts: 144
Joined: Sun Apr 06, 2003 12:29 pm

Re: 04: FINDing your Way Around

Post by Ptirhiik » Sat Sep 06, 2003 8:04 am

Really, I don't see any benefits finding on a commented line when the find is not explicitaly note as comment : can you give me samples ? The only thing that can result from there is a functional comflict between mods (take a look on my explanation, particulary thinking of a mod which will add * 1000 to a fied).

Adding //OL is not something convenient for existing sources, as it isn't already present. I'm not sure it will be a gain neither to add it // is enough convinient to recognize commented lines, why willing to add extra tag to this in the source ?

Also on a fresh phpBB, your $foobar will be unique, and a mod modifying it perfectly suiting the requirement to be EMC. A user decides to add comments (a slight modification ie), and keep the original code (what I will advice BTW) in order to track back his modification. Result although the comment is absolutly not considered while running, although at manul modding you won't consider it, easymod will issue silently on it. Don't you think there is a problem there ? The conclusion is you deny a user to ever do any modification at hand, and, by extension, easymod can't be used in a reliable way on board that have been modified in other way than using easymod. Also you interfer with the resulting code, denying to add comments to them.

User avatar
-=ET=-
Registered User
Posts: 211
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: 04: FINDing your Way Around

Post by -=ET=- » Sat Sep 06, 2003 12:06 pm

[quote=\"Ptirhiik\"]Second notice a // on a tpl is not a good way to write it [/quote]
lol! Yes you're absolutely right :lol:
I made my answer a bit too fast and try to search a good example of unique substring forgetting that we can't use // in .tpl file.

Sorry about this mistake but I maintain my arguing, I've read your post and your suggest, I'm still not convinced, I don' repeat what you said as you always ask to find a substring starting from the beginning of the line (and not proceeding 2 finds in fact), and that's why I suggest anything else.

I hope it's still authorized to suggest something new :roll:

P.S.: Believe me, I suggest that only to help you to have what you want because IMO (but that's just my opinion) there is no need for this kind of comments, even after having read 7 pages of your explanations!
And I think I'm not the only trying to find a compromise for but instead of being really convinced :roll:

User avatar
-=ET=-
Registered User
Posts: 211
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: 04: FINDing your Way Around

Post by -=ET=- » Sat Sep 06, 2003 12:16 pm

Argggggggggggg there's always this stupid functionnality here that prevent authors to correct their posts after 1 or 2mn :evil:

Sorry about some mistakes in my English but I can't correct them here :(
That's really a stupid feature for me :roll:
Eternal newbie

Ptirhiik
Registered User
Posts: 144
Joined: Sun Apr 06, 2003 12:29 pm

Re: 04: FINDing your Way Around

Post by Ptirhiik » Sat Sep 06, 2003 1:34 pm

I reduce this till the posts linked the need to be specific on search to a result commented (although I'm still thinking having two commands to perform the same thing doesn't make sense), which would be in enough cases quite reliable (although it isn't in all cases). That's why I adviced you to re-read all the posts after those linked in order to recover the sense of my posting.

Now to know if there is any need to keep prec code commented in a source (in a cumulative way : mods after mods), just install - let's say - near 10 mods on a 2.0.4 board, some manual, some automatic, some both (assuming it is very rare to have a board fully moded with an automated tool, even only one installed with automated tool), and upgrade it to 2.0.6, without the mod templates (which is also a normal way to proceed on an existing board). When you will have done this, come back and tell me if having the original code won't have been of some help, and won't have been safer :). The bad thing is willing to do this also on template will require to modify template.php in order to remove comments on fly, which is not the purpose of a mod (except the one dedicated to).

Locked