Welcome to Geeklog, Anonymous Saturday, April 20 2024 @ 12:30 am EDT

Geeklog Forums

On Methodology


Status: offline

gHack

Forum User
Junior
Registered: 12/20/02
Posts: 15
Location:Boulder, CO
I have a couple of questions about methodology. First of all, I have a way of learning about a piece of software, taking it apart, learning all its functions and putting it back together. Geeklog has been very good at teaching me some new techniques, but I'd like to see if there's a more efficient way to go about this than I am. More below. Secondly, could someone point me to a body of documentation or literature on best practices in coding -- particularly I am interested in the style used in the geeklog code, i.e. four-space tabs for readability and consistency, how to comment functions and describe parameters, separation of functions, modularization, etc... is there a name for this methodology, or have various singular methods been adopted by agreement among the core GL developers? Interested in expanding my knowledge.Okay, back to the first question. When I take apart a piece of software, The first thing I do is to locate the core modules and print them out. This saves my eyes from staring at the screen and also allows me to mark up the pages with a pen, making notes and cross-references for myself. In this case I started with lib-common.php, index.php and config.php, and later ended up printing out template.class.php, url.class.php, staticpages/index.php, english.php, and article.php. What I do is to print out two pages of code on one side of each page, in small (readable for me) type, leaving margins and the back of the page for notes. I make sure that the line numbers are printed as well. I take these pages and put them into a three-ring binder, marking each section with tabs for easy reference. A few weeks back, I was laid up and forced to stay in bed, so I went over all of the sections of code with a red pen, highlighting function names and marking where functions began and ended, highlighting various pieces of comments and visually referencing them to the relevant parts of the code, and marking line numbers and filenames next to function calls so that I can immediately flip to a function as I'm following through the code. My three-ring binder has become indispensible as I work on my various geeklog projects. If I hack one of the main files, I mark it in my notebook so I can easily keep track. Does anyone else use a method like this or have a more efficient way to keep track of code? I imagine someone is going to tell me that there's a tool that can do all of this for you, but I suppose the reason I haven't gone looking for one is that I really like to take my eyes off the screen once in a while, especially when reading. But if there were something out there that could improve my speed in this area, I'd use it. Thanks in advance, and Have a Pleasant Day. Chris
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
Location:Urbandale, Iowa
Well, in large part we adhere to PEAR coding standards.

As far as seperation of modules, etc, that is more of a design decision we made. GL 1.3.x is very much procedural so dividing it up into lib-.php let's us group related functions together. In GL 2 we are taking an object-oriented stance so much of our design is a result of our OO experience and using portions of UML.

As for your pocess for organizing and learning code, use what works for you. I personally don't use any paper trails. I instead rely on my IDE (e.g. Komodo or PHPEclipse) in conjunction with CVS and a CVS web interface like Chora (see our CVS here.

---
The reason people blame things on previous generations is that there's only one other choice.


The reason people blame things on previous generations is that there's only one other choice.
 Quote

Status: offline

gHack

Forum User
Junior
Registered: 12/20/02
Posts: 15
Location:Boulder, CO
cheerful
Thanks Tony, I thought this post got deleted a while back.

This is going to keep me busy reading for a while. Hopefully I will emerge from it with my process redefined.

Cheers
 Quote

All times are EDT. The time is now 12:30 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content