Re: [Gimp-developer] neue Hackordnung
gg, I agree with you, in fact I have begun to think about how a complete rewrite using C++ and gtkmm would look, including support for procedural brushes, a good undo/redo system, etc. From my point of view, C does not fit for a GUI application. Core libraries, like GEGL, makes much more sense to write in C, but for such a complex application as an image editor, C++ fits much better. I am so far only in the planning stages of this, and this is still very vaporwarish, but I also belive that sooner or later, we need to take a step forward in terms of language expressiveness. - Martin ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] neue Hackordnung
Hi, On Sun, 2006-11-26 at 15:41 +0100, [EMAIL PROTECTED] wrote: > please, make code readable with explicit variable names and named > constants. Lines like the following are very economical on file size but > very wasteful on human time for anyone who did not write the code: > > dv = du + w[i]; > > looks like it came straight of a page of math text book on matrix algebra > (and probably did). But once out of that context it becomes meaningless. Prepending a variable with d to indicate some sort of difference is well-established. While I agree that a lot of code could be improved, I don't think that delta_v is in any way better than dv. Fortunately, most of the ugly code is in the lower parts of the core. It's the old code that is going to be rewritten with GEGL sooner or later. > I recently submitted a patch were I had cleaned up the code and renamed > this bytes_pp , this oddly met with some resistance and finally got > accepted as bpp. Fine it's a great improvement, although I was a bit > dismayed that this sort of change needs debating. > Longer names make longer lines. Especially if comments are added. Another > patch I submitted recently got the comment truncated to the point were it > was misleading rather then helpful just because it went a few chars over > the manditory line limit. I asked you to correct that in your next patch. A comment can easily extend over multiple lines. With longer lines, two editor windows won't fit next to each other any longer. > I think the rigid coding guide of 80 chars should be re-evaluted. If code gets longer than 80 chars a line, something is wrong anyway. It should probably be rewritten because obviously it's too deeply nested. > If the idea gets a favourable reception I will submit a short text for > inclusion in Hackordnung advising on readability and variable naming. > Current guidelines seem mainly restricted to defining format. Not sure if adding anything there along those lines is going to help. Almost all that ugly code that you are refering to is much older than the Hackordnung anyway. The newer parts are all quite readable. Sven ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] neue Hackordnung
GG wrote: [**] I agree that it would be helpful to have more guidance for new contributors, but my own experience is that most of my trouble has come from trying to understand the high-level structure -- the overall architecture, the core objects and the principles for using them. The low-level thing that has caused me the most difficulty is signals -- knowing when one is going to be emitted and what is going to happen as a result -- because this is often not apparent from the source code. On the question of longer lines, I disagree. For comments it doesn't really matter, but I find consecutive long lines of code extremely difficult to read. Also I often work on code with multiple Emacs windows open side by side, and in that scenario even with a good modern monitor it creates difficulties if the code is wide. There is no question that it is helpful to use good variable names, and lots of the "old" code could definitely be improved in this respect. People's opinions about specifics may vary, though. I myself think "bytes" is fine if it is used consistently with always the same meaning, and "bpp" is fine, but "bytes_pp" impairs readability. I also think that, strategically speaking, it is best to focus these sorts of improvements on code that needs maintainance for other reasons, because experience shows that even something as seemingly harmless as renaming variables often causes accidental breakage. Best wishes, -- Bill __ __ __ __ Sent via the CNPRC Email system at primate.ucdavis.edu ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer