Dojo Lesson #2 -- Coding Standards

Events happening in the community are now at Drupal community events on www.drupal.org.
joshk's picture
Start: 
2007-01-12 12:00 - 14:00 Etc/GMT-8

Only local images are allowed.
The Drupal Dojo will convene again this Thursday at 8pm EST (GMT -5). We will gather in #drupal-dojo, get on a worldwide Skypecast and fire up an improved screen-sharing application to do our lesson. We will also take time to debrief the work so far, talk about what we'd like to do going forward, and answer misc questions about the group and about Drupal.

The Lesson Plan

  • Sound Check: make sure everyone can get on Skype and is in IRC
  • Debrief: talk about how we've been doing, also about moving the regular lesson time to Sunday and/or starting other times
  • Drupal Coding Standards: what they are; why they matter
  • Keeping Your Code Clean: where to put stuff; how not to kludge
  • Keeping Your Code Safe: how and why to use Drupal functions for text, links, input fields and database queries
  • Making Your Code Intelligible: the tao of commenting
  • Dojo Challenge!: review a patch for Drupal 5.0
  • Documentation: lets keep the great documentation coming!

Feel free to comment on this post with feedback. I'm especially interested in collecting links to documentation folks may want to read ahead of time, and/or we should look at improving as a result of this lesson.

See you in the Dojo!

Comments

Same time?

wim leers's picture

That's pretty awful. University has started again, so I really can't stay up from 2 am to 4 am every Thursday... That you can't move it 2 hours earlier I can understand, but wouldn't it be possible to do it in the weekend?

Just this time. I think it

webavant's picture

Just this time. I think it is changing to 2pm EST (-5 GMT) on Sundays starting this Sunday. See here: http://groups.drupal.org/node/2292#comment-6243.

Thanks!

wim leers's picture

Thanks, didn't see that reply. Good news then :)

What do we have on Sunday?

dami's picture

What do we have on Sunday? repleat lesson#2 or some new stuff?

I'm thinking new stuff

joshk's picture

While the coding standards/intro lesson is probably a good one to do more than once, I'm thinking of trying to cover some new ground on Sunday. Maybe tackle a real-world problem. I will start a thread for that event specifically soon.

http://www.chapterthreellc.com | http://www.outlandishjosh.com

request for a bit of assistance

noraa's picture

Could someone email me privately and help me with irc and skype? I don't want to take up the group's space with such an elementary request. I don't use irc or skype. I caught the screencast and, although a bit fast paced, I think I actually absorbed quite a bit. I have skype downloaded and got ircle, but couldn't get on freenode. Sorry for such a basic request. These just aren't things I've had the need to use until now. Thanks in advance.

Walt Esquivel's picture

Please see my IRC guide.

Walt Esquivel, MBA; MA; President, Wellness Corps; Captain, USMC (Veteran)
$50 Hosting Discount Helps Projects Needing Financing

Walt Esquivel, MBA; MA; President, Wellness Corps; Captain, USMC (Veteran)
$50 Hosting Discount Helps Projects Needing Financing

What are you planning on

lacinda's picture

What are you planning on using for the webcast? I've got Skype and IRC configured, but if something else needs to be installed I'd rather go ahead and get it taken care of.

P.S. Sunday afternoon (CST) is about the only time during the week I can't make it.

Doh!

joshk's picture

Sorry about sunday. Ultimately this is a decision about my timing. Ideally there will still be a lot of value in the documentation, and I'm happy to try and answer questions in the IRC channel if you can catch me there.

For the screencast, there should be a java-based web-page. Otherwise I'll try to get Webavant and/or Bindu to post some instructions, but we'll be using a technology called VNC to do this. I'm new to it too, so can't provide real expertise.

http://www.chapterthreellc.com | http://www.outlandishjosh.com

Instructions for joining the Drupal Dojo screencasts

webavant's picture

We have some new weapons in our screencast arsenal, namely VNC and a new web interface. We are potentially making this our regular platform for conducting these screencasts depending on the success of these next meetings.

Instructions For Joining

At the scheduled time of the meeting go to our Browser-Based Screencast Interface which will allow you to see when the next Skypecast is, join the IRC chat and make it easy for you to listen in, and even request to talk. Here is a diagram depicting the basic layout of the BBSI:

Only local images are allowed.

The only software that is required at this time is Skype which is free can be downloaded here: http://www.skype.com/go/download/

If you are familiar with VNC software, feel free to connect to webavant.com:5999 to join in.

More on Skypecasts - For Presenters/Coordinators

The BBSI (through flagrant abuse of and unwieldly usage of frames, java and javascript to an extent never before seen in screencasting) gets the upcoming Skypecasts by querying skype.com for any public upcoming or in-progress skypecast sessions containing the keyword 'drupaldojo'. When creating a Skypecast, be sure to select 'public', (not 'hidden'), and add 'drupaldojo' to the keywords field, otherwise, we may have some confused BBSI users.

great, thanks!

lacinda's picture

great, thanks!

Woo!

joshk's picture

This is very nice. A great start for lasting documentation for people who want to join in.

http://www.chapterthreellc.com | http://www.outlandishjosh.com

Is module_invoke only for "hooks"?

pwolanin's picture

I just addressed this question in the Drupal forum: Is module_invoke only for "hooks"?
http://drupal.org/node/108326

But it seems like this might be an important point to briefly cover (and you can see if you agree with my answer).

Invoke

joshk's picture

module_invoke is a best-practice way to try and call functions between modules. It's not strictly necessary -- especially for core modules like node and user -- but it will prevent fatal errors if, for instance, the module you're trying to call isn't present.

http://www.chapterthreellc.com | http://www.outlandishjosh.com

In other words

joshk's picture

It's not just for hooks. It's for any cross-module function call.

Hooks are sort of the reverse: you name your function right (e.g. mymodule_nodeapi) and it gets invoked automagically at the right time by Drupal core.

http://www.chapterthreellc.com | http://www.outlandishjosh.com

lesson requests

lapur's picture

what a great lesson! thank you very much josh. thank you webavant for the video feed.

lesson requests / ideas:
1) cck vs writing a custom node. pros and cons. right now I'm making a node with 60 fields. issues include easy of making a mysql query, performance, theming, and upgrading.
2) theming cck. is it hard? I've heard it's hard. how to use contemplate is not obvious to me.
3) theming great, non-drupal sites. i like participate.net. a walk-through of that would be great.

thank you!