Thanks, t0m. The discussion on irc helped me clarify some things and figured out which way I wanted to pursue things. Comments inline.

On 06/18/2010 05:15 AM, Tomas Doran wrote:

On 17 Jun 2010, at 20:22, Sir Robert Burbridge wrote:
My questions are:
* Would this kind of functionality be better done in Catalyst::Helper::(Model|View|Contoller):: or somewhere else?

No, you want to put it in about the right place.
Ok, great.
Currently the skeleton code generation only generates app templates and basic Model/View/Controller classes, as nobody has made the code generation flexible enough to generate other things.

Patches to do so would be welcome, however it generally really is just a couple of lines of code, so the effort to work on it hasn't scratched anyone's itch really.
I'm going to mull over the skeleton code generation matter and see if it makes sense for me to work on that. If so, I'm happy to pass back some patches.
Your talk of 'help enforce the practice of' makes me think that you're trying to solve a political / development organisation problem with code - which is rarely the right solution. I personally think you'd be better writing documentation / providing training to your team about why to do things a certain way, and/or instituting a code quality assurance process (such as code review).

One of the interesting things about some of the stuff I'm working on is that there's an influence from both the Ruby and PHP cultures. I have had to work on several php projects and it is the ugliest stuff I've ever had the displeasure to work with (maybe it was just those projects...). Ruby culture is pretty weird; they act like new money, with lots of ferraris and beach houses, but not a lot of substance (in fairness, that might be the rails culture, I'm not sure). Either way, RoR feels like a california investment banker in a convertable.

In my experience, the PHP culture just plugs stuff in randomly until something works, then seals it up and builds on top of it. No real consultation of documentation, etc. RoR culture seems to need vods and helpers like crazy. Getting them to adopt Catalyst probably requires some "meeting them halfway" (in my projects, anyway).
Both of these approaches are more likely to succeed in stopping people from generating shitty code than mandating a recipe with which you build applications by rote.
I'm actually OK with them generating bad code as long as it's well contained. I'm not trying to optimize for great code now, I'm trying to aim for the best use of time *over the next couple of years*. By creating generating stubs, I can help us create clean bundles of messy code that are relatively easy to straighten out as time goes on and we all get better at the craft (refactoring a terrible sub that has standardized input/output is way better than refactoring a module that has no discernable API!).
Cheers
t0m

Thanks,
-Sir






_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to