best coding techniques

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    best coding techniques

    Ok. I know these are skills you gain with experience because I can see my code is more organised and cleaner than it was a year ago when I started.
    I however see better code everyday and wish to get better.
    Is there some kind of document with guidelines? For those of us who are self taught, I think this would be a great asset.
    There is only so much you can learn from reading code.
    Thanks.
    Perfection comes at a cost



    I accept liberty!

    #2
    try ebooks. There is lotsa ebooks online

    Comment


      #3
      Originally posted by frostymarvelous View Post
      Ok. I know these are skills you gain with experience because I can see my code is more organised and cleaner than it was a year ago when I started.
      I however see better code everyday and wish to get better.
      Is there some kind of document with guidelines? For those of us who are self taught, I think this would be a great asset.
      There is only so much you can learn from reading code.
      Thanks.
      check link in my signature...
      you might find some usefull ebook...
      It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
      ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
      ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
      キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

      Comment


        #4
        Thanks. Lemme check.

        Khan. I know. What I need is a title or something. There's a lot of junk out there.
        Perfection comes at a cost



        I accept liberty!

        Comment


          #5
          To write cleaner codes i use tabs for indentation not spaces.
          I do
          if( ! $arg === TRUE)
          {
          {TAB HERE}echo $arg;
          }

          makes it easy to find missing closing braces. I use caps for php constants like:
          AND, NULL, FALSE, TRUE, OR etc. I also make sure that i do stuff like:

          function ego($ego)
          {
          {tab here}return isset($ego);
          }

          not

          function ego($ego)
          {
          {tab here}return isset($ego) ? true : false;
          }

          Comment


            #6
            That's not what I actually mean. Though that's seriously advisable as well as commenting.

            To get an idea of what I mean, take a look at yourls, sphider or php search. There's this level of organisation I can't seem to muster. Yourls is cool, I code like that now but the others including CF image hosting codefuture.co.uk/projects/imagehost/ is just extreme.
            Perfection comes at a cost



            I accept liberty!

            Comment


              #7
              ?? I still dont get you

              Comment


                #8
                Originally posted by CreativityKills View Post
                ?? I still dont get you
                Take a Look at any of the scripts I posted above. When you look at them, look at the organisation.
                The folder structure. The way they use functions. Generally, the way they create includes.
                I'm sure its some kind of fallback from c++ or more advanced coding language experience.
                The thing is, php just does not encourage good programming skills. Its like html. Almost anything will parse.
                Perfection comes at a cost



                I accept liberty!

                Comment

                Working...
                X