Coder Social home page Coder Social logo

Remove excess `@since` about subtitles HOT 5 CLOSED

wecobble avatar wecobble commented on July 17, 2024
Remove excess `@since`

from subtitles.

Comments (5)

philiparthurmoore avatar philiparthurmoore commented on July 17, 2024

I'll give the @since a look. In general I use them when developing in the future will be easier for me. Rather than look through old commit logs, it's easier to read when something happened inline.

As a sidenote, I think there's way too much inline documentation.

I've addressed this in the code. :)

 * A note to plugin developers and theme makers: you may be wondering why I've taken
 * the time to document code that to seasoned vets seems obvious, for example explaining
 * that functions inside of classes are called methods. The reason I've done this is primarily
 * because there was a time when looking at the following code would have made absolutely no
 * sense to me. At that time, I would have loved for there to have been robust inline documentation
 * explaining to me what was happening. Consider the following documentation a gift to newbies and
 * also a gift to my future self, who will undoubtedly look back on some of what I've written here
 * with confusion and chagrin.

That documentation is for me more than anyone else. Happy to take the "more documentation because I'm selfish and need reminders of why I did something" route over the "way too much information" route.

from subtitles.

rmccue avatar rmccue commented on July 17, 2024

That documentation is for me more than anyone else. Happy to take the "more documentation because I'm selfish and need reminders of why I did something" route over the "way too much information" route.

The existing documentation actually makes this unusable for me, as I can't tell what's happening in the code - it's hard at times to even find what code's executing. For example:

/**
 * Put together the final title and subtitle set
 *
 * @since 1.0.0
 */
$title = $title . ' ' . $subtitle;

It's immediately obvious to those reading the code that you're combining title and subtitle with a space, the documentation here is completely superfluous.

I'm not against inline documentation, but there's certainly the ability to go overboard here.

Rather than look through old commit logs, it's easier to read when something happened inline.

That's exactly what git blame (and svn blame, etc) is designed for, and it gives you a much richer history.

from subtitles.

philiparthurmoore avatar philiparthurmoore commented on July 17, 2024

This is as much for beginners as it is for advanced developers, like you. I totally get what you're saying but I doubt I'll remove those notes. They're more helpful to me than they are harmful.

from subtitles.

rmccue avatar rmccue commented on July 17, 2024

FWIW, here's what the main class looks like stripped down to 391 lines. IMO, it still has liberal amounts of documentation, but is much more readable.

I understand if you don't want to remove the documentation, but keep in mind that inline docs are much like whitespace in designs: the right amount is great, but too much will make it unreadable.

from subtitles.

philiparthurmoore avatar philiparthurmoore commented on July 17, 2024

Cheers.

from subtitles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.