Getting ready for an alpha release: WeCSS/Wess improvements

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Getting ready for an alpha release: WeCSS/Wess improvements
« Reply #90, on December 24th, 2012, 11:32 AM »
wetem is definitely finished -- I haven't changed it in a while, it's working and I'm certainly not going to change the object's structure at this point... ;)

The code isn't just for me to read, that's true, but what are the odds that someone is gonna read it, and then screw everything up because they're not aware that this or that method has a public visibility...? Can you give me one real life example of 'wetem' or 'we' ruining somebody's life with a missing keyword...?

I just feel that this issue isn't worth 2 pages of discussion... :whistle:

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Getting ready for an alpha release: WeCSS/Wess improvements
« Reply #92, on December 24th, 2012, 01:27 PM »
But that's the point... Isn't it? I'm trying to have consistent (i.e. harmonized all throughout) code.
Anyway, I don't know what you want exactly... When you say that you're not touching wetem because you're not sure it's ready, but you touch we immediately after my first couple of commits, I'm not sure whether you actually had something in mind or it's just something you thought of when reading my code and you tried to justify yourself after that by giving a (wrong) example....

Fact is, you don't have to justify yourself, you're human as I am, we have our little idiosyncracies, what matters is to accept them and/or have others accept them. (It feels like watching every other episode of Friends or HIMYM...)
This is where we're wasting our time. As I said earlier, we're unlikely to budge much on this particular issue, so we have to determine, not who's right, but who's the more annoyed by the other's preference. If it kills you not to see a 'public' keyword, I'll gladly change my habit. If it only slightly bothers you, then maybe you'll gladly accept my own preference.

There's really no need to fight over this.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Getting ready for an alpha release: WeCSS/Wess improvements
« Reply #93, on December 24th, 2012, 01:40 PM »
That's the point, I DO feel like I have to justify myself.

I changed this one because I happened to be going through the file straight after commit and it was a few minutes work to figure out. wetem is a much bigger thing and I thought it was still being updated - I tend to mentally think of Class-CSS and wetem as being one entity even if they're actually not because it's all interrelated stuff that I didn't touch in code terms, pretty much at any point of their development.

It doesn't kill me not to see it - because I would have been jumping up and down by now over wetem - but we either need to do that for everything or nothing, and right now that's not where we are - and THAT's what's bugging me. The DB classes for example all have their scope declared explicitly, wedit has pretty much everything declared as public though I'm not sure it needs to be that way (nor am I sure it should be that way)

Ideally I'd prefer to see explicit declared scope because that's what's more correct in the grand scheme of things than a 'micro-optimisation' that probably does actually make it slower, not faster in the long run. (No-one's sure if removing 7 bytes per function declaration in a class will make it faster to parse and the difference is going to be so small it's almost impossible to actually benchmark.) However with the changes in PHP 5.4 to class definitions, it would not surprise me if it were actually faster to have that declared explicitly.

Anthony`

  • Posts: 53
Re: Getting ready for an alpha release: WeCSS/Wess improvements
« Reply #94, on December 24th, 2012, 05:35 PM »
To be honest I think having scope defined for fields in a class (especially in PHP) where it can be pretty forgetful for someone coming from Java would be good for consistency and readability, but could also remind forgetful people (like me :whistle:) like me who forget PHP seems to do it backwards. -_- Plus, it isn't a big deal just to place scope is it?

Yay for defined scope!!!!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Getting ready for an alpha release: WeCSS/Wess improvements
« Reply #95, on December 24th, 2012, 07:04 PM »
So I'm looking at r1810 and I see there's a move of the instance to the getInstance function.

This is now less efficient in PHP 5.4, and I'm not even sure why it's been done, especially as it *deprotects* the singleton status of the object. There is a *reason* the instance is declared as a protected variable. (In PHP 5.4, the JIT compiler is faster when the properties of a class are predeclared, it doesn't have to maintain a hashmap the same way.)

There is absolutely no reason for the instance variable to be exposed outside of the class.
Posted: December 24th, 2012, 06:49 PM

EDIT: I just noticed some of the PREG changes as mentioned. Now I might as well bookmark the preg_replace function in the manual for debugging purposes, because I'm never going to remember the ordering structure for *complex* cases that get processed into loops.
Posted: December 24th, 2012, 06:51 PM

Come to think of it, why don't we strip all the comments left in the source while we're at it? It'd be faster to parse, right?

(Yes, it is faster to parse. But I still remember the fact that I had to create a flow chart to document a 600 line piece of code a few years ago to figure out how any of it worked after I removed all the comments.)
Posted: December 24th, 2012, 06:53 PM

Oh, and dropping the latest SVN into my test site, even clearing the cache, it's still not working properly - the menu dropdowns have no background to them, there's no gradient in the background and other miscellaneous issues that generally result in the setup correctly handling different browsers.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Getting ready for an alpha release: WeCSS/Wess improvements
« Reply #96, on December 24th, 2012, 07:32 PM »
I don't know what you're talking about, Pete... I removed the protected static and moved it to the getInstance function. As a static, again. It's protected since it's only accessible from that function. Anyway... Merry Christmas -_-

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Getting ready for an alpha release: WeCSS/Wess improvements
« Reply #97, on December 24th, 2012, 07:48 PM »
I'm running on a lot of frustration right now, I'll admit.[1] It's possible I misinterpreted the code, however the way this is working, I don't think you'll find it's quite as protected as you think, and I suspect a profiler will suggest it is less efficient than you hoped.
 1. An argument over coding standards, plus spending half the day debugging the installer just to be able to test my own changes.

Happy Axeman

  • Posts: 1
Re: Getting ready for an alpha release: WeCSS/Wess improvements
« Reply #98, on December 25th, 2012, 03:21 AM »
Ive been reading all your stuff since you began this fork. Ive been using smf, and yabb before that... smf is boring me at the mo. its stagnant, install a few mods and it breaks. lol
I could say i'm a genius but am not, i smoke too much so i enjoy reading stuff i dont understand what earth is going on. lol i love breaking things and spending hours looking for the errors, only to find it was something really stupid like a misplaced ' lol

anyways, as soon as you guys release your Wedge i think i'll be dropping SMF.

your work so far is awesome, so keep it up and don't rush anything, things take as long as they take.

all the best... oh yeah.

Happy Christmas Everybody.

Nao

  • Dadman with a boy
  • Posts: 16,082