Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7688439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:55:15+00:00 2026-05-31T19:55:15+00:00

I always ask this to myself, and I think it’s time to hear some

  • 0

I always ask this to myself, and I think it’s time to hear some opinions, what should I put in the comments of my methods that represent certain actions?

I should explain what? Comment on what?

Currently I do not comment on anything because I do not know what to put.

Edit:

You are not understanding what I asked, probably because I have not explained well, I want to know what to put in the comments of methods that represent an action (action of a Controller). Example (in PHP):

<?php
class UserController  {

    /**
     * What to put here?
     */
    public function editAction() {

    }

}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:55:17+00:00Added an answer on May 31, 2026 at 7:55 pm

    IMHO, the comment over controller’s should contain two things:

    1. How do you get to this action: which request method (POST, GET, other) and what’s the URL.
    2. Very brief summary of what it does (and not “how”).

    The thing is, you should not need to write a paragraph of details, because you function name should already state what it does (which in Controller actions is somewhat limited by convention, thus the second point). And the containing code should be short enough for easy skipping though and verbose enough to explain “how” part.

    There is actually a video [51:20] related to the subject. Though, i think UncleBob’s rule about 3..5 lines is a bit too harsh. There is a lot of preparations in controllers action, but ~4 lines, which do the actual work, should be enough.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I always want to ask this question: Is this validate <a><li></li></a> Or should always
one question I always ask myself is how is it possible that javascript has
You always read that for-in loops should check o.hasOwnProperty(k) to skip over Object.prototype. Well,
If x exists, then print x exists. I ask this because I always get
I'm revisiting and re-implementing the code that caused me to ask this question about
I feel like a moron having to ask this, but I have always evaded
I am not sure that this is the right place to ask this, but
The question I always wanted to ask and was afraid to, actually - what
I always read that one reason to chose a RESTful architecture is (among others)
I always thought that you could use OR in a LIKE statment to query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.