Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 5 12345 LastLast
Results 1 to 10 of 46
  1. #1
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default Your view on coding "preference"

    Hi guys.

    I'm making this thread in response to the huge mass of people responding when confronted with bad coding practices, or bad ways of doing something, who respond with "it's my preference".

    It's becoming an excuse which is really invalid.

    I mean theres some situations where it doesn't matter, but most of the time, it is bad.

    For instance I've seen some people doing $_GET["my_property"], when you should use $_GET['my_property']. Even if you explain it to them, they just say it's "preference".

    Another big one, is using parenthesis in language constructs, this is a real big one. Many people say it's down to "preference" once again, but on the PHP website they explain that it does slow code down. Then you'll have people retort with "only on a big website". And that's usually where it comes to a head, as there isn't much of an argument against that, of which I can see. Although I believe regardless of traffic size, it still matters.

    So what are your views on this?

    Charlie.

    Thread Closed by MattGarner (Forum Moderator): Thread closed due to arguments.
    Last edited by xxMATTGxx; 24-09-2008 at 04:48 PM.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  2. #2
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    *Removed*

    Edited by Flisker (Forum Moderator): Please do not be rude to members
    Last edited by Flisker; 24-09-2008 at 04:12 PM.
    Back for a while.

  3. #3
    Join Date
    Nov 2005
    Location
    Edinburgh
    Posts
    11,690
    Tokens
    0
    Habbo
    Pyroka

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    Another big one, is using parenthesis in language constructs, this is a real big one. Many people say it's down to "preference" once again, but on the PHP website they explain that it does slow code down. Then you'll have people retort with "only on a big website". And that's usually where it comes to a head, as there isn't much of an argument against that, of which I can see. Although I believe regardless of traffic size, it still matters.
    I think Excellent, you need to *Removed* look at what he's saying there.

    Edited by Flisker (Forum Moderator): Please do not be rude to other members
    Last edited by Flisker; 24-09-2008 at 04:17 PM.

  4. #4
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Pyroka View Post
    I think Excellent, you need to *Removed* look at what he's saying there.
    No Pyroka, if you knew the slightest bit about PHP I may actually give you kudos there but you don't. People have their methods of doing things, people may like using print instead of echo? Just because it is a few MS slower doesn't mean nothing on a tiny script does it?
    Last edited by Flisker; 24-09-2008 at 04:18 PM.
    Back for a while.

  5. #5
    Join Date
    Nov 2005
    Location
    Edinburgh
    Posts
    11,690
    Tokens
    0
    Habbo
    Pyroka

    Latest Awards:

    Default

    Quote Originally Posted by Excellent2 View Post
    No Pyroka, if you knew the slightest bit about PHP I may actually give you kudos there but you don't. People have their methods of doing things, people may like using print instead of echo? Just because it is a few MS slower doesn't mean nothing on a tiny script does it?
    miliseconds turn into seconds, and if you're doing errors on a mass scale then yes it does sort of slow down a system. I know enough about PHP to know the difference between " & ', but I didn't know one processes slower than the other. I guess you have one of those 'omg i know everything lol so ****' sorts of attitudes...

    Well, from what I can tell anyway, you seem to know that I don't know anything about PHP. *rolls eyes*

  6. #6
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Excellent2 View Post
    No Pyroka, if you knew the slightest bit about PHP I may actually give you kudos there but you don't. People have their methods of doing things, people may like using print instead of echo? Just because it is a few MS slower doesn't mean nothing on a tiny script does it?
    Your point is completely invalid, as print is different to echo in many ways. Look it up if you want. :rolleyes:

    I actually talked about some peoples methods are valid, but the majority, there is a faster way to do something, which you should use.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  7. #7
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Pyroka View Post
    miliseconds turn into seconds, and if you're doing errors on a mass scale then yes it does sort of slow down a system. I know enough about PHP to know the difference between " & ', but I didn't know one processes slower than the other. I guess you have one of those 'omg i know everything lol so ****' sorts of attitudes...

    Well, from what I can tell anyway, you seem to know that I don't know anything about PHP. *rolls eyes*
    Did you take a second to read what I put? I said SMALL scripts. If you're coding a big script then of course echo would be the best method to use. No, I just happen to know that you come into this section from your beloved spam and try act like you know how it works.

    Quote Originally Posted by Hypertext View Post
    Your point is completely invalid, as print is different to echo in many ways. Look it up if you want. :rolleyes:

    I actually talked about some peoples methods are valid, but the majority, there is a faster way to do something, which you should use.
    Print uses the same basic functions, but I guess you're going to come back saying "print can't return loads of expressions unlike echo"
    Last edited by Excellent2; 23-09-2008 at 10:27 PM.
    Back for a while.

  8. #8
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Excellent2 View Post
    Did you take a second to read what I put? I said SMALL scripts. If you're coding a big script then of course echo would be the best method to use. No, I just happen to know that you come into this section from your beloved spam and try act like you know how it works.

    Print uses the same basic functions, but I guess you're going to come back saying "print can't return loads of expressions unlike echo"
    Read what I said in my "small scripts" thing, regardless, theres no point of using it, if only for aesthetics.

    For starters, echo can use commas to consecutively output things, and there are a lot of others which you can read on at php.net.
    Last edited by Hypertext; 23-09-2008 at 10:34 PM.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  9. #9
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    There is a fine line between preference and just plain doing it wrong.

    For example, $variable['wat'] against $variable["wat"] is a preference. If you choose to use single quotes, then yes, that's more efficient. But it doesn't make using speech marks (") wrong.

    Though on the other hand, some things people code on this forum are inefficient and sort of stupid, like when someone echoed a message and then used exit(). That's not a preference, that's an example of just coding badly
    Last edited by Invent; 23-09-2008 at 10:36 PM.

  10. #10
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    Read what I said in my "small scripts" thing, regardless, theres no point of using it, if only for aesthetics.

    For starters, echo can use commas to consecutively output things, and there are a lot of others which you can read on at php.net.
    Print isn't really a function as it doesn't require parenthesis to work, you should know that charlie:rolleyes:
    Back for a while.

Page 1 of 5 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •