Closed (fixed)
Project:
Examples for Developers
Version:
7.x-1.x-dev
Component:
Menu Example
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2011 at 13:35 UTC
Updated:
31 Aug 2011 at 13:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedThanks for pointing this out, your documentation is a big improvement. We may still want to make more changes to this example, though.
Using the words 'menu entry' might be confusing here. Calling the routing system the Menu system is a bit of a misnomer. If someone doesn't yet understand the function of the menu router, they will probably assume that this is about placing a link in the menu.
Also, there are other problems with the example as it currently is, like the fact that parts of the array are commented out. Ben Melancon and Stella have verified that it is against coding standard to commit code that is commented out. Anything that is being hashed out and is commented for that reason should actually be in patches. While many people still do commit code that is commented out, I don't think that we should demonstrate that in examples.
Comment #2
rfayI'm in favor of allowing commented-out sections in Examples. It's a teaching module, so should get some leniency. The option is putting docblocks with @code sections, which is almost exactly the same thing, but distracts from the point. When you're looking at the code, it's good to see some alternatives.
Commented-out code is just comments and can be very useful.
I'm sure the coding standard is about the situation where somebody comments out a useless block instead of deleting it. That's a bad thing, as it's distracting. However, if we use commented out code to demonstrate alternatives or make a point, that's not bad.
Comment #3
ilo commentedEdited: oh, I thought I was writting in the contextual menu entries issue, sorry.
Comment #4
pfrenssenNew patch which expands the documentation a bit more and clarifies the 'menu entry' confusion.
I agree with rfay that using commented out code should be acceptable for instructional purposes. It is different when someone is committing commented out blocks of obsolete or temporary code.
Comment #5
pfrenssenChanging status.
Comment #6
dave reidComment #7
tr commentedI re-rolled this to work with the current -dev.
Comment #8
tr commentedI re-rolled this to work with the current -dev.
Comment #10
tr commentedHmm, double post, and patch didn't get attached properly - bad URL instead. How did that happen? Let's try again.
Comment #11
rfayThanks so much!
Committed:
D7: 6ad2e27
D8: 718c44c