ThemeShaper Forums » Thematic

[closed]

How to keep source code clean

(5 posts)
  • Started 10 years ago by janis
  • Latest reply from xxxevilgrinxxx
  • This topic is not a support question
  1. janis
    Member

    hi I'm a newbie with php and thematic. I’m a bit of a neat freak with my code. Apologies if this is kind of a stupid question.

    I just wondering what is the best way to keep what I see when I "view source" neat a tidy. I am getting random indents all over the place that I just can't explain. Nothing is breaking, it just looks like a dogs breakfast.

    I know most people won't have the time to fuss over the view source, but I am curious.

    Just wonder how others might be dealing with this.

    thanks for your ideas

    Posted 10 years ago #
  2. I'm a real neat freak for code too. One error can have me stop whatever else I'm doing to fix it, LOL!

    I write up everything in NoteTab Pro ( a text editor) before I post them on the blog, as it's easier to see it all at a glance before posting.

    Posted 10 years ago #
  3. janis
    Member

    thax for the idea about using notetab pro.

    How about when you are editing your php with filters and add_actions? How do you get it to play nice with the original thematic code?

    j

    Posted 10 years ago #
  4. I use Notepad++ when in Windows and SciTE when in Ubuntu. both have context highlighting which is super helpful. i'm not sure you have much control over how it looks when you "view source" so i wouldn't worry about it looking like dog's breakfast there. i also try to comment each function i write so that if i have to go back in a year i will know what the heck it is supposed to do.

    i'm not sure what you are asking about getting your filters and additions to play nice. if you've defined them correctly in your functions.php then they just do.

    Posted 10 years ago #
  5. filters and actions I add to functions.php, also using notetab (or any text editor). I believe that you have to be very careful about which editor you use with php, as some editors like to change some of the symbols, if that's what you mean by playing nice?

    I couldn't agree more with the poster above on commenting your functions (or even your css). There's nothing worse than forgetting why you changed something or what it's supposed to do.

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.