The easy syntax going to kill me..literally !

Discussion in 'PHP' started by xkaser101, Aug 21, 2011.

  1. #1
    ;),
    So after spending 2 days head banging and raging at my Code for not working I just figured I forgot to add the 'session_start();' Thing lol. :eek:

    Happened to me before but it was a ';' that i forgot to add.

    Am I the only one who ever had stupid errors like this ?

    I never had problems like this that I could not figure right away when I was learning C++ knowing that PHP has a cleaner and easier to read syntax

    I think it is cursed :p
     
    xkaser101, Aug 21, 2011 IP
  2. iBank ™

    iBank ™ Peon

    Messages:
    63
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Use an editor w/ syntax highlighting.
     
    iBank ™, Aug 21, 2011 IP
  3. ssmm987

    ssmm987 Member

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    3
    Trophy Points:
    43
    #3
    Of course I make this kind of errors from time to time, but the errors php throws contain mostly more than enough information to find the error in no-time.
     
    ssmm987, Aug 21, 2011 IP
  4. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #4
    sometimes it is easy to get carried away and forget to add the semi colon. I find that occassionally I do the same, but the IDE I use makes it easier to notice these things, especially when I forget curly braces...
     
    Grit., Aug 21, 2011 IP
  5. rajmv

    rajmv Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yea, one of the reasons i like codelobster ide so much is because it gives colored warnings for things like this..

    But adding the ; is something you'll get used to ;-P
     
    rajmv, Aug 21, 2011 IP
  6. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #6
    Try it after you start developing cataracts. Can't tell a , from a ., a : from a ;, etc. Maybe if I get +3 magnifiers and paste my nose to the monitor.

    But I regularly make the kinds of errors you made, and I've been cutting PHP for over 5 years (and code in general for almost 40).

    If you're not using FirePHP, start. At least you can see what PHP thinks you're saying, and turn all the debugging off easily once the page works. It won't make you type more accurately (I'd pay good money for that add-on), but it makes debugging a lot easier.
     
    Rukbat, Aug 22, 2011 IP