Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Matthew Flaschen
On 10/07/2013 11:40 PM, Erik Bernhardson wrote: Status class: A review of the code within this class tells me that its primary use case(its single responsibility if you will) is to assist the caller in generating user facing error messages about an operation that can fail. If null/false is an a

Re: [Wikitech-l] ogv.js - JavaScript video decoding proof of concept

2013-10-07 Thread Matthew Flaschen
On 10/07/2013 12:01 PM, Brion Vibber wrote: Is anyone interested in helping out or picking up the project to move it towards proper playback? If not, it'll be one of my weekend "fun" projects I occasionally tinker with off the clock. :) I don't have cycles to help at the moment, but that's real

Re: [Wikitech-l] RFC: Simplify Thumbnail Cache

2013-10-07 Thread Matthew Flaschen
On 10/07/2013 04:52 PM, Bryan Davis wrote: I have just posted a new draft RFC on changing the thumbnail storage and caching pipeline for Wikimedia projects [0]. I added a link from the earlier RFC about thumbnail sizes (https://www.mediawiki.org/wiki/Requests_for_comment/Standardized_thumbnail

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Tim Starling
On 08/10/13 14:40, Erik Bernhardson wrote: > A reviewer should be able to > know if the error conditions are properly handled by looking at the new > code, not by looking up all the function calls to see what they can > possibly return. This is why the recommended pattern for Status objects is to

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Erik Bernhardson
On Mon, Oct 7, 2013 at 2:56 PM, Brion Vibber wrote: > > "We already have three major error-reporting patterns: return null/false, > throw exceptions, and return a Status object. Can you justify the idea of > adding a fourth with strong benefits compared to the existing three?" > > -- brion Exce

Re: [Wikitech-l] Tidy - help needed

2013-10-07 Thread Daniel Friesen
Yes, this is somewhat similar to what I had to deal with when adding . Take a look at includes/parser/Tidy.php, specifically the MWTidyWrapper class. You'll find that in the end tidy couldn't play nice at all. And to support the mw:editsection placeholder I had to explicitly add a new wrapper clas

[Wikitech-l] Tidy - help needed

2013-10-07 Thread Max Semenik
Hi, I would appreciate your help with wrestling Tidy into submision: I have a revision, https://gerrit.wikimedia.org/r/#/c/80578/ which allows to disable TOC in ParserOutput. Because now only a marker instead of full TOC passes through Tidy, it gets sometimes wrapped in tags. I tried various stuff

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Tim Starling
On 08/10/13 06:45, Brion Vibber wrote: > Out of curiosity, what's an actual example of code where the execution flow > of exceptions is significantly more surprising than the execution flow of a > billion manual checks to avoid "Fatal error: Call to a member function > foo() on a non-object"? > >

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Brion Vibber
On Mon, Oct 7, 2013 at 2:45 PM, Erik Bernhardson wrote: > I started replying, but there are just way too many different opinions to > reply to you all. IF the accepted method of handling errors in mediawiki is > to throw an exception and cancel page render we will simply do that > instead. > I t

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Erik Bernhardson
I started replying, but there are just way too many different opinions to reply to you all. IF the accepted method of handling errors in mediawiki is to throw an exception and cancel page render we will simply do that instead. On Mon, Oct 7, 2013 at 2:09 PM, Brion Vibber wrote: > So I took a qu

[Wikitech-l] New! mw.Title reborn

2013-10-07 Thread Krinkle
Hey all, Last Friday, the mw.Title rewrite landed in master. Here's a brief summary of the changes. TL:DR; * New static constructor mw.Title.newFromText (returns mw.Title or null). * New internal title parser (uses wgLegalTitleChars and mirrors most of Title::secureAndSplit). * Bugs like [[.co

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Brion Vibber
So I took a quick look at https://github.com/schmittjoh/php-option -- it appears to be a wrapper object around queries that can throw an exception for you if the wrapped value is null (exactly like just using exceptions in the first place), or can check for nullness and replace it with an alternate

[Wikitech-l] RFC: Simplify Thumbnail Cache

2013-10-07 Thread Bryan Davis
I have just posted a new draft RFC on changing the thumbnail storage and caching pipeline for Wikimedia projects [0]. This RFC was started as part of the Multimedia tech debt project. Aaron, Faidon and I would like to move discussion forward on the issue of the thumbnail caching layer in general a

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Nikolas Everett
On Mon, Oct 7, 2013 at 3:45 PM, Brion Vibber wrote: > I've heard the vague claim that exceptions are confusing for years, but for > the life of me I've never seen exception-handling code that looked more > complex or confusing than code riddled with checks for magic return values. When I'm writin

[Wikitech-l] Fwd: [WikimediaMobile] Mobile frontend upcoming changes

2013-10-07 Thread Yuvi Panda
Might be of interest! -- Forwarded message -- From: Jon Robson Date: Tue, Oct 8, 2013 at 12:06 AM Subject: [WikimediaMobile] Mobile team upcoming changes To: Operations Engineers , mobile-l The MobileFrontend extension will see 2 changes within the next 3 weeks that will result

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Max Semenik
On 07.10.2013, 23:45 Brion wrote: > Out of curiosity, what's an actual example of code where the execution flow > of exceptions is significantly more surprising than the execution flow of a > billion manual checks to avoid "Fatal error: Call to a member function > foo() on a non-object"? > I've h

[Wikitech-l] Call for participation: Wikis devroom at FOSDEM

2013-10-07 Thread Quim Gil
Spread the news! https://lists.fosdem.org/pipermail/wikis-devroom/2013-October/00.html Wikis devroom - FOSDEM, Brussels, 1 & 2 February 2014 CALL FOR PARTICIPATION IN SHORT We accept proposals for wiki related submissions. The formats accepted are 25min sessions or 5min lighting sessions.

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Derric Atzrott
>Out of curiosity, what's an actual example of code where the execution flow >of exceptions is significantly more surprising than the execution flow of a >billion manual checks to avoid "Fatal error: Call to a member function >foo() on a non-object"? > >I've heard the vague claim that exceptions ar

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Brion Vibber
Out of curiosity, what's an actual example of code where the execution flow of exceptions is significantly more surprising than the execution flow of a billion manual checks to avoid "Fatal error: Call to a member function foo() on a non-object"? I've heard the vague claim that exceptions are conf

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Tyler Romeo
On Mon, Oct 7, 2013 at 3:17 PM, Jeroen De Dauw wrote: > The Status object is many ways is a fancy error code. It causes the same > issues as returning error codes. It differs with the proposal in that the > Status object deals with error cases, while the proposal does not. > The real question is

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Nikolas Everett
On Mon, Oct 7, 2013 at 3:12 PM, Jeroen De Dauw wrote: > Hey, > > We use lots of libraries that happen to use composer. We just don't >> use composer to deploy them. >> > > Oh? Lots? Is there a list somewhere? Are most of those libraries forked? > Are a good portion of them semi-assimilated into co

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Chad
On Mon, Oct 7, 2013 at 12:12 PM, Jeroen De Dauw wrote: > Hey, > > We use lots of libraries that happen to use composer. We just don't > > use composer to deploy them. > > > > Oh? Lots? Is there a list somewhere? Are most of those libraries forked? > Are a good portion of them semi-assimilated into

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Jeroen De Dauw
Hey, > What are the actual issues with Status, and how is this proposal different? The Status object is many ways is a fancy error code. It causes the same issues as returning error codes. It differs with the proposal in that the Status object deals with error cases, while the proposal does not.

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Jeroen De Dauw
Hey, We use lots of libraries that happen to use composer. We just don't > use composer to deploy them. > Oh? Lots? Is there a list somewhere? Are most of those libraries forked? Are a good portion of them semi-assimilated into core? I hope the answer to the later two is "no". Cheers -- Jeroen

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Brad Jorsch (Anomie)
On Mon, Oct 7, 2013 at 2:20 PM, Erik Bernhardson wrote: > Are there any concerns with the Flow project moving > forward and utilizing this as our primary error handling mechanism rather > than returning false/null? http://xkcd.com/927/ In other words, the best solution to the problem "we have th

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Chad
On Mon, Oct 7, 2013 at 11:46 AM, Jeroen De Dauw wrote: > * Is a WMF team really going to use a third-party library distributed via > Composer? :) > We use lots of libraries that happen to use composer. We just don't use composer to deploy them. -Chad _

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Jeroen De Dauw
Hey, Returning error codes and null force then handler to deal the error case. Often this is for no good reason, and often the handler cannot decide how to deal with such an error, and is forced to simply pass it on. In such cases, it is just silly to have in-band error handling. This is what exce

Re: [Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Tyler Romeo
On Mon, Oct 7, 2013 at 2:20 PM, Erik Bernhardson wrote: > Are there any concerns with the Flow project moving > forward and utilizing this as our primary error handling mechanism rather > than returning false/null? > What's wrong with just using the Status class itself? And depending on the answ

[Wikitech-l] Exceptions, return false/null, and other error handling possibilities.

2013-10-07 Thread Erik Bernhardson
Within mediawiki there is a split between returning false/null and throwing exceptions. There is also the Status class used by the wikitext parser(the Status class is somewhat closely tied to the parser reducing reusability though). essentially there are 3 kinds of error handling used within media

Re: [Wikitech-l] Escaping for field and index names

2013-10-07 Thread Tyler Romeo
On Mon, Oct 7, 2013 at 12:31 PM, Brad Jorsch (Anomie) wrote: > DatabaseMysqlBase::addIdentifierQuotes, on the other hand, doesn't > escape correctly; it uses the same function for quoting strings and > identifiers, despite the different quote marks. So it will change 'foo > " bar' into '`foo \" b

Re: [Wikitech-l] Performance variation in LUA scripts?

2013-10-07 Thread Brad Jorsch (Anomie)
When I tried it just now, I didn't see such variation in the Lua version. The wikitext version was actually giving me more variation. On Mon, Oct 7, 2013 at 12:44 PM, Strainu wrote: > I'm trying to port a template from wikitext to lua. The template [1] > is quite simple, but it gets repeated hund

[Wikitech-l] GSoC 2013 summary: Incremental dumps

2013-10-07 Thread Petr Onderka
Hi, during the summer I've worked on making dumps of page and revision information for Wikimedia wikis incremental [1]. This includes both server (faster updating of dumps) and client (download only changes since last dump) sides. The project was successful, though there remain some issues that h

[Wikitech-l] Performance variation in LUA scripts?

2013-10-07 Thread Strainu
I'm trying to port a template from wikitext to lua. The template [1] is quite simple, but it gets repeated hundreds of times in some pages. Getting the logic to work was not complicated (the modified version is at [2]), but I'm seeing huge performance variation in the lua version: parsing [3] takes

Re: [Wikitech-l] Escaping for field and index names

2013-10-07 Thread Brad Jorsch (Anomie)
On Mon, Oct 7, 2013 at 12:05 PM, Chris Steipp wrote: > If you are writing an enhancement to this, you should wrap them in ` and > escape ` characters in the name. DatabaseBase::addIdentifierQuotes wraps, > but doesn't escape. Backquotes are a MySQLism. The SQL standard uses double-quotes, which M

Re: [Wikitech-l] Escaping for field and index names

2013-10-07 Thread Chris Steipp
On Mon, Oct 7, 2013 at 8:54 AM, Jeroen De Dauw wrote: > Hey, > > When constructing an SQL string, how should the following things be > escaped, if at all? > > * Field names * Index names > > It looks like when doing a select using the Database MW thing, the field > names provided do not get escap

[Wikitech-l] ogv.js - JavaScript video decoding proof of concept

2013-10-07 Thread Brion Vibber
TL;DR SUMMARY: check out this short, silent, black & white video: https://brionv.com/misc/ogv.js/demo/ -- anybody interested in a side project on in-browser audio/video decoding fallback? One of my pet peeves is that we don't have audio/video playback on many systems, including default Windows an

Re: [Wikitech-l] Escaping for field and index names

2013-10-07 Thread Tyler Romeo
On Oct 7, 2013 11:55 AM, "Jeroen De Dauw" wrote: > > Hey, > > When constructing an SQL string, how should the following things be > escaped, if at all? > > * Field names > * Index names > > It looks like when doing a select using the Database MW thing, the field > names provided do not get escaped

[Wikitech-l] Escaping for field and index names

2013-10-07 Thread Jeroen De Dauw
Hey, When constructing an SQL string, how should the following things be escaped, if at all? * Field names * Index names It looks like when doing a select using the Database MW thing, the field names provided do not get escaped at all. Cheers -- Jeroen De Dauw http://www.bn2vs.com Don't panic.