Wedge

Public area => Off-topic => The Pub => Other software => Topic started by: colby67 on November 17th, 2013, 12:05 AM

Title: SMF reaction to 'unused, useless globals'
Post by: colby67 on November 17th, 2013, 12:05 AM
Hm, I see the SMF devs is ignoring(http://www.simplemachines.org/community/index.php?topic=514469.0) the whole thing..thats just strange. It is logical to use only what you need, right? Declaring a whole bunch just for nothing cannot be applauded in any case...I am bit amazed that personal feelings take precedence instead of just common sense there.

:edit: by Nao: Split from http://wedge.org/pub/off/8300/a-short-script-to-remove-unused-useless-globals-in-php/
Title: Re : SMF reaction to 'unused, useless globals'
Post by: Auk on November 17th, 2013, 06:43 AM
At least Nao is not ignoring. I wonder if mybb cares.

The result: mybb 1.6.11
total: 224

Which is currently my choice of what forum software I would use. Think these variables exists for hackish modular purposes or something?
Title: Re : SMF reaction to 'unused, useless globals'
Post by: Nao on November 17th, 2013, 08:48 AM
Bloc, I don't have access to that topic, even as a friend.

So, I'm guessing they are indeed talking about me in more private sections? Nice. And Arantor was complaining that I had made a fair topic about him in a board that he would still be able to acccess if he hadn't removed himself from it.
Sorry for the OT.
Title: Re : SMF reaction to 'unused, useless globals'
Post by: TE on November 17th, 2013, 06:24 PM
Quote
Well, I'm sure you already did 90% of the work through NetBeans, didn't you? ;)
I decided against using NetBeans for that generally, because of the many false positives, such as "undeclared variable" when doing preg_match_all($regex, $string, $my_new_variable)... Yeah, NetBeans, I'm not going to initialize a variable just because you can't fathom that PHP would actually initialize the variable this way, hmm...
yep, I found most via Netbeans but Spuds, Eman and I spend hundreds of hours for cleaning, documenting and improving the code.. It's not only Netbeans' benefit ;)
Title: Re : SMF reaction to 'unused, useless globals'
Post by: TE on November 18th, 2013, 08:26 AM
Quote from Nao on November 17th, 2013, 08:48 AM
Bloc, I don't have access to that topic, even as a friend.

So, I'm guessing they are indeed talking about me in more private sections? Nice. And Arantor was complaining that I had made a fair topic about him in a board that he would still be able to acccess if he hadn't removed himself from it.
Sorry for the OT.
Yeah, you know.. there are good friends and bad friends :lol: That's why I've finally quit and deleted my old account.
Title: Re : SMF reaction to 'unused, useless globals'
Post by: colby67 on November 18th, 2013, 01:55 PM
Its a bit of bashing in that topic yes, sad to say. I think its open for SMF helper group, which I am in..but not sure, maybe I am granted special access or something.

Title: Re : SMF reaction to 'unused, useless globals'
Post by: Aaron on November 18th, 2013, 02:27 PM
Quote from Nao on November 16th, 2013, 11:11 PM
I can't believe SMF's has always been so 'dirty', in comparison...
Well, at the time, the main rationale behind having all those unused globals was having them there for mod authors to use, so they wouldn't have to modify the global-line as well — which, in most cases, would cause conflicts.

Now that we're all moving towards hook-based mods, it's certainly time to clean it all up, indeed.
Title: Re : SMF reaction to 'unused, useless globals'
Post by: live627 on November 18th, 2013, 07:14 PM
Quote from Bloc on November 18th, 2013, 01:55 PM
Its a bit of bashing in that topic yes, sad to say. I think its open for SMF helper group, which I am in..but not sure, maybe I am granted special access or something.
I'm in that group and cannot access that topic.
Title: Re : SMF reaction to 'unused, useless globals'
Post by: Drunken Clam on November 18th, 2013, 08:01 PM
Quote from live627 on November 18th, 2013, 07:14 PM
Quote from Bloc on November 18th, 2013, 01:55 PM
Its a bit of bashing in that topic yes, sad to say. I think its open for SMF helper group, which I am in..but not sure, maybe I am granted special access or something.
I'm in that group and cannot access that topic.
Me too :ph34r:
Title: Re : SMF reaction to 'unused, useless globals'
Post by: colby67 on November 18th, 2013, 08:03 PM
K, then I got some special access then. Until someone reads this topic heh  :D
Title: Re : SMF reaction to 'unused, useless globals'
Post by: Nao on November 18th, 2013, 08:06 PM
I guess so.
Title: Re : SMF reaction to 'unused, useless globals'
Post by: Nao on November 18th, 2013, 08:07 PM
Quote from Aaron on November 18th, 2013, 02:27 PM
Well, at the time, the main rationale behind having all those unused globals was having them there for mod authors to use, so they wouldn't have to modify the global-line as well — which, in most cases, would cause conflicts.
Yes, I remember that; I was told about that by Norv, IIRC, when I did commits to the SMF base in 2010.
Quote from Aaron on November 18th, 2013, 02:27 PM
Now that we're all moving towards hook-based mods, it's certainly time to clean it all up, indeed.
Yup.
Although, again, it's not a BIG deal... Personally, I'm currently onto other more important issues, globals themselves can wait until I have nothing left to fix. ;)
Title: Re : SMF reaction to 'unused, useless globals'
Post by: Nao on November 18th, 2013, 08:11 PM
Quote from TE on November 17th, 2013, 06:24 PM
yep, I found most via Netbeans but Spuds, Eman and I spend hundreds of hours for cleaning, documenting and improving the code.. It's not only Netbeans' benefit ;)
I so would love to have them (in addition to you :P) contribute to Wedge, if only for details like these; this is the kind of offer I could never refuse. ;)

Well, it's too bad that Wedge and Elk aren't directly interoperable; I mean, I can't exactly cherry-pick a commit from Elk, etc. Or even from SMF. As such, I really very rarely check out either changelog, and will usually miss any bugfixes.
BTW, I don't know if you read my Wedge changelogs, I suppose you do, but in case you don't, sometimes I'll document bugs that are also in Elk and SMF; or just in SMF, in which case it doesn't concern you. Just search new rev pages for 'smf', and it should narrow them down.
Title: Re : SMF reaction to 'unused, useless globals'
Post by: emanuele on November 18th, 2013, 10:58 PM
Quote from Nao on November 17th, 2013, 08:48 AM
Bloc, I don't have access to that topic, even as a friend.
I suspect it is the Development (private) board, right Block?

Until a while ago that board was open to friends as well, apparently now[1] the board has been closed down[2].
 1. I suspect after someone discovered the terrible truth I was able to access it[1]
 1. I don't have a friends badge by choice, but I'm SM member, so I asked for permission to write in the boards I'm supposed to be able to write, and along with that came for some funny reason due to the (in)famous permissions mess the access to Dev-private, not that I asked for it, not that I wanted it, but apparently it was "in the pack"... Yes, I admit I lurked from time to time! I'm so sorry! :cry:)
 2. I can just assume in order to avoid that a competitor would be able to read the development secrets...sorry guys, I may have spoiled you the fun... :(
Title: Re : SMF reaction to 'unused, useless globals'
Post by: emanuele on November 18th, 2013, 11:02 PM
Quote from Nao on November 18th, 2013, 08:11 PM
Well, it's too bad that Wedge and Elk aren't directly interoperable; I mean, I can't exactly cherry-pick a commit from Elk, etc. Or even from SMF. As such, I really very rarely check out either changelog, and will usually miss any bugfixes.
The three are already enough distant (code-style wise) that is almost impossible to cherry-pick anything from anything.
I stopped a while ago cherry-picking things back to SMF because it was just a plain re-write.
Quote from Nao on November 18th, 2013, 08:11 PM
BTW, I don't know if you read my Wedge changelogs, I suppose you do, but in case you don't, sometimes I'll document bugs that are also in Elk and SMF; or just in SMF, in which case it doesn't concern you. Just search new rev pages for 'smf', and it should narrow them down.
I still have the bookmark somewhere with the last page I read, though it's a while I don't have much time to keep up with everything... lol
Title: Re: SMF reaction to 'unused, useless globals'
Post by: Nao on November 18th, 2013, 11:14 PM
Quote from emanuele on November 18th, 2013, 10:58 PM
Until a while ago that board was open to friends as well, apparently now
It had been for years. I had access to it even for the whole time I was post-banned at sm.org... And until recently, was still the case. Basically, I think they removed access for Friends after I picked up a topic where Arantor was criticizing me, and thought he was safe in a 'private' area. After I debunked his lies (still in private!), I guess the SMF team figured that they didn't want to piss Arantor off, and decided to kick me (and all Friends) out of that board.

I haven't checked, but I don't see any other plausible explanation.

So, now Pete can safely lash out at me, when he used to always agree that if we were to lash out at someone, it should be *in a place where they could defend themselves*. Because neither he nor I appreciated being the object of criticism behind our backs.

I guess his 'morals' and 'intellectual honesty', of which he used to be so proud, are solvable in vinegar. ::)
Quote from emanuele on November 18th, 2013, 10:58 PM
the board has been closed down[1].
 1. I can just assume in order to avoid that a competitor would be able to read the development secrets...sorry guys, I may have spoiled you the fun... :(
Well, fact is, I don't read that board, so it doesn't change anything for me. Simply, as it was part of my 'readable boards', it would come up in search results when I did a search on recent posts mentioning 'wedge' or 'nao', as I do from time to time. (Now that I've made it clear what my search keywords were, I've also noticed Pete started to avoid using them, presumably to make it harder for me to find posts where he lashes out at me. Fine by me, that's less time to waste on futile flame wars.)
Posted: November 18th, 2013, 11:12 PM

Split into its own topic. It has little to do with optimizing code, at this point, more like optimizing relationships, or the lack thereof. ;)
Title: Re: SMF reaction to 'unused, useless globals'
Post by: runic on December 10th, 2013, 02:55 AM
if its Dev (private) you shouldnt have access unless you are listed as Dev Consultant, I could tell you more if I got the exact board though I cant see permission changing that much since I left.
Title: Re: SMF reaction to 'unused, useless globals'
Post by: Nao on December 10th, 2013, 01:01 PM
I don't really care at this point.
Seriously... If the SMF team had wanted to be 'nice' to me, they would have done at least a few of these, in any order:
- ensured my access to any boards wasn't changed AFTER Pete rejoined them,
- offered me to join as well (I would have said no, but it would have been a show of good faith, and at no cost to them),
- told Pete that since he's part of the SMF team, anything bad he's saying about Wedge is in contradiction with the frigging SMF Team Member Agreement,
- and generally, done anything to show me they didn't see me as the miserable bastard they like to think of me.

Come to think of it, I don't know why I keep Aeva Media online over there. Dunno why they'd deserve a quality gallery mod which took years of work to complete. :-/

Or maybe it's simply because I don't care at all about SMF, in the end. What Pete does with their outdated software, as long as it doesn't involve taking my code and innovations to their codebase (because, WTF!), I really couldn't care less about.
Title: Re: SMF reaction to 'unused, useless globals'
Post by: emanuele on January 8th, 2014, 10:39 PM
https://github.com/SimpleMachines/SMF2.1/pull/1151
https://github.com/SimpleMachines/SMF2.1/pull/1157
It took a bit of time. :P
Title: Re: SMF reaction to 'unused, useless globals'
Post by: Nao on January 8th, 2014, 11:26 PM
Yeah... But of course, he'd never admit that it was thanks to the very script he dismissed as silly, would he now...? :whistle:
There's still tons (hundreds?) of unneeded globals left, though. A huge difference compared to the 3 left in Elk (not counting the ones in install.php), and the zero in Wedge[1].
 1. One, actually... I committed an unneeded global today. Lulz. I'll fix that in the next commit.
Title: Re: SMF reaction to 'unused, useless globals'
Post by: live627 on January 16th, 2014, 11:06 PM
Quote from emanuele on January 8th, 2014, 10:39 PM
https://github.com/SimpleMachines/SMF2.1/pull/1151
https://github.com/SimpleMachines/SMF2.1/pull/1157
It took a bit of time. :P
Maybe he did it all manually..
Title: Re: SMF reaction to 'unused, useless globals'
Post by: Nao on January 16th, 2014, 11:25 PM
Fixing manually, yes, that's what I did on many on my files too.
But *finding* them manually? No way... Nobody's a psychic. So, the only tools at his disposals were: (1) any IDE that has that feature (e.g. Eclipse or NetBeans, one of these two, can't remember, provides small icons next to lines with unneeded globals), (2) fix-globals.php...

Hey John, I thought you were gone back to SMF forever. Or maybe you really are? Two months without a post... :^^;:
Title: Re: SMF reaction to 'unused, useless globals'
Post by: emanuele on January 17th, 2014, 10:39 AM
Quote from Nao on January 16th, 2014, 11:25 PM
But *finding* them manually? No way... Nobody's a psychic. So, the only tools at his disposals were: (1) any IDE that has that feature (e.g. Eclipse or NetBeans, one of these two, can't remember, provides small icons next to lines with unneeded globals), (2) fix-globals.php...
Technically you *can* find and fix anything manually, IDE and fix-globals are a way to automate the task.

For example, I'm currently scanning the whole code looking for input or selects without a label:
https://github.com/emanuele45/Dialogo/tree/labels
and I'm doing it manually... 1572 input tags.
There are two drawbacks with that method:
1) it takes a shitload of time,
2) every time you start something like that on an SMF-like codebase you end up rewriting small or large parts of the code you encounter (in that branch I already did it twice and I almost just started LOL).

That said, automation FTW!! :D
Title: Re: SMF reaction to 'unused, useless globals'
Post by: Nao on January 17th, 2014, 10:44 AM
Quote from emanuele on January 17th, 2014, 10:39 AM
Technically you *can* find and fix anything manually, IDE and fix-globals are a way to automate the task.
Something like 1500 unneeded globals..? I don't think so. ;)
Quote from emanuele on January 17th, 2014, 10:39 AM
For example, I'm currently scanning the whole code looking for input or selects without a label:
https://github.com/emanuele45/Dialogo/tree/labels
and I'm doing it manually... 1572 input tags.
There are two drawbacks with that method:
1) it takes a shitload of time,
Which is why I wrote the script in the first place. I figured it'd be faster than even going through my files with Netbeans or something. (It was.)
Quote from emanuele on January 17th, 2014, 10:39 AM
2) every time you start something like that on an SMF-like codebase you end up rewriting small or large parts of the code you encounter (in that branch I already did it twice and I almost just started LOL).
Yeah, it's one of my 'minor' character issues, too... :P
I did that for the calendar plugin, for instance. Was fixing some CSS, ended up rewriting something else.