
perl at profvince
Nov 17, 2009, 2:42 AM
Post #11 of 12
(360 views)
Permalink
|
|
Re: [PATCH] Add ENTER_with_name and LEAVE_with_name to automaticly check matching scopes when debugging
[In reply to]
|
|
> Hi Reini, hi all, > > Reini Urban wrote: >> 2009/11/12 Vincent Pit <perl [at] profvince>: >>>> Add ENTER_with_name and LEAVE_with_name, which work identical to ENTER >>>> and >>>> LEAVE, but when LEAVE_with_name is done it is checked that it >>>> corresponds >>>> to an ENTER_with_name with the same name. >>> I kinda like the idea, but not the name. Since they're going to be >>> spread >>> all other the core, I'd rather have something sorter and prettier. >> >> ENTER_N and LEAVE_N maybe >> >> _with_name as new public opname is way too long. > > I hate getting into bike-shedding discussions (or starting them), but why? > > If there is one thing that I abhor about the perl API, it's that > everything is shortened to the extreme so that you only grasp the > meaning if you already know it all. It steepens the beginning of the > learning curve by a sizable factor if not an exponent. So what about > ENTER_NAMED or NAMED_ENTER if you want to hint at "naming"? > > At least nowadays, people around here seem to spend *a lot* more time > reading perl's code for debugging than actually typing all-new code. > > Cheers, > Steffen > > PS: > strLT: Does anyone write this regularly? I bet not. So why isn't it > string_less_than? > Newx: What the hell? It *dropped* the x! > vcmp? Yeah. > dSOMETHING meaning "declare SOMETHING"... similarly a... and p... It's > consistent, yes, but if you're new to perl and just read some core or XS > code, it'll take you a while. Same for the PL prefix. > *PUSH*, *POP* for the stack. Well, yeah, I guess you need 5 minutes to learn what they represent. I agree that can discourage some people from contributing (hint, hint). There is a lot of recurrent FUD about how the internals are full of ugly macros and that make them hard to learn. Before that, it was perforce that prevented people from contributing. I used to kept two trees of the rsynced source and diff them, and that didn't seem to prevent me from sending patches. Not that I'm nostalgic of the perforce times in any way. But the hard stuff is not learning the API, which you get through in a couple of hours, it's : - understanding how small pieces of code spread at very different places work together ; - taking into account all the different flavours of perl (depending on the arch, OS and options) and their specifics ; - knowing exactly what which instruction is meant to do at the Perl level (which requires you to have a very good knowledge of Perl and, yes, that's much harder than learning C) ; - the regexp engine and the tokenizer. I don't believe that longer^W^Wclearer names would help with this. Conventions can't replace experience and knowledge. That said, I like ENTER_N, and I like ENTER_NAMED as well. Maybe more the latter, actually. Vincent.
|