Martin Atkins (mart) wrote in fotobilder,
Martin Atkins
mart
fotobilder

Things that should probably change in S2

Over the time I've been working with S2, I've noticed a few things which should probably be changed. Here's a list of ones I remember right now.

  • Variable/member names should not be allowed to start with underscores. This prevents the namespace conflicts with the perl backend's (and probably other future backends) $_ctx (context) variable and $thingy->{'_type'} (object type) hash element along with other stuff added in the future.
  • An isnull operator would be very handy for representing "empty" objects. In LJ's class library in particular, there are some things which are often there but in some cases are left blank because they are not applicable in one small case. Thankfully there aren't actually any of these on FotoBilder yet. I propose isnull $.whatever mapping to $this->{'whatever'}->{'_isnull'} which can then be set by the backend which forms the initial data structure to flag empty stuff more cleanly so that code can just do if (isnull $somelink.image) rather than checking on members of it as my code does now.
  • The S2 compiled and source data is stored in BLOB fields. While I suppose that technically the compiled data could one day be binary (compiled C code, perhaps) the source is always going to be text. Why do I care? Mainly because my GUI interface for fiddling with my DB in realtime won't let me edit BLOB fields because they're binary. ;)
  • Update @ 17:09 GMT: It's possible to create an infinite loop by messing with the array in a foreach loop. I thought I submitted a patch for this before, but since the current code doesn't seem to have it I guess I didn't ever submit it. The patch involved using grep( { 1; }, @{$whatever} ) to create a copy of the array. (Thanks to youngoat for reminding me of this half an hour after I overwrote my compiler sources with the ones from danga CVS! It was youngoat who alerted me to this originally.)

I've noticed other things in the past, but I've forgotten them now. Hopefully they'll come back to me as I'm writing the initial stuff for FotoBilder and I'll add them here.

Subscribe

  • 302: lj_dev

    In the interests of consolidating all FotoBilder development-related discussion, we're going to be closing down this community. The same…

  • Development stalled?

    Is the development of Fotobilder held? Stalled? I am asking because there is no activity on the community and there is no link to the Fotobilder…

  • (no subject)

    Does FotoBilder works with Apache2? I installed all the required modules on my debian sarge, and when I restart my apache server, it dies horribly…

  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic
  • 0 comments