> One of the big selling points about Python is the fact that > refactorings are very cheap. And I don't buy the argument that it > would be easier to structure your code before you have even begun > writing it. Quite the contrary.
Well, I had a pretty good idea that my project would contain a lot of controllers with a lot of functionality and putting all of that into a single controllers.py would be a bad idea. I'm very familiar with KISS - it's a big part of my programming philosophy. But it also applies to implementing simple methods to handle complexity. To my mind I've simplified the handling of my complex project. I've Kept It Simple by separating out concerns into manageble units. I still fail to see how creating a controllers directory suddenly makes things 'complex'. Never mind. Thankfully Kevin has augmented quickstart to allow initial creation of single or multi controller projects along with automated migration. Justin > > From: "BJörn Lindqvist" <[EMAIL PROTECTED]> > Date: 2006/03/24 Fri PM 03:52:21 GMT > To: [email protected] > Subject: [TurboGears] Re: bike shed #2: controllers.py vs. controllers > > > > > I see that you have already gotten much advice, let me share my setup > > > which is slightly different. I have been using it to develop a > > > javascript web application for handing job applications. There is only > > > one controllers.py which contain: > > > > Well, I've worked in large teams where bunching several classes into a > > single source file like that would result in a mob lynching. However > > they were C++/Java dev environments and I've been assured that this sort > > of thing is a little more relaxed in Python land. > > > > If your app was to grow and you start adding a few dozen more > > controllers with a lot more functionality per controller then I'd guess > > you'd get a better idea of why separating your controllers might be a > > good idea. You'd find it much easier to locate objects/methods and it > > That may be true. If I sometime in the future realise that I all of a > sudden need hundreds (or THOUSANDS) of controllers, then yes, my > little controllers.py file won't work. Luckily for me that hasn't > happened yet but I'm sure it will any day now... :) > > More seriously, the KISS rule is applicable - Keep It Simple Stupid. > If an app doesn't need more than one file for storing controllers, > then it shouldn't have more than one file. If you later discover that > you won't be able to manage all controllers in one file, then split em > up. But there is no point in wasting time and effort making your app > more complex if you absolutely don't have to. KISS > > > Chances are that you'll get a good idea when your project is becoming > > uncomfortable to handle. Again, my experience is in enivronments where > > these patterns are well recognised and working practices are put into > > place early on to avoid expensive refactorings later. As usual, YMMV. > > One of the big selling points about Python is the fact that > refactorings are very cheap. And I don't buy the argument that it > would be easier to structure your code before you have even begun > writing it. Quite the contrary. > > -- > mvh Björn > > > ----------------------------------------- Email sent from www.ntlworld.com Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

