Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
phpstuff

Wanted To Share Debugging Technique - (You May Already Be Doing This)

Recommended Posts

As far as bugs go, It seems on every script the main issues I have had on the first book and up to Ch 12 on this book are usually mismatched/missing/too many brackets and parenthesis:

 

(   )

{  }

[  ]

 

 

One thing that I have just started doing that I probably should have started doing a while ago is using Command-F to perform a search of the code.  Once you pull up the find window, you can count the  symbols - for example count the parethesis that opens to the right.  Say that count is 7.  Next search for all the parenthesis that open to the left.  If that count is equal to 7 then you have matching parenthesis within your code, if it is not, then you need to make them match.  Repeat the process for the primary types of symbols found in your code.  This has saved me some time and I'm guessing a lot of people do this, but I just figured this out.

Share this post


Link to post
Share on other sites

Cool thank you...yes I need to probably learn how to use my text editor better but all my time is taken up trying to cram PHP into my head! ;)  Once I get through this book that is on the to do list.

Share this post


Link to post
Share on other sites

I use TextMate personally, although I'm kind of switching to Sublime Text. I love TextMate, but an IDE will make it easier for you (once you learn the IDE).

Share this post


Link to post
Share on other sites

Textmate has gained much "hype" recently due to experienced developers Using it alongside the command line in YouTube learning videos. What it boils down to is efficiency, and most would gain from using an IDE in that regard.

 

NetBeans checks my code, generates Class skeletons, runs my tests, generates my Apis, formats my code, push code to github, uploads to my server Using FTP and has my favorite shortcuts for code generation. It also has built in support for all languages I program in. Textmate can't beat that.

 

IDEs are not for everyone though. I would at least recommend you giving one a try. You can easily change back later on, and the possible gain is huge.

Share this post


Link to post
Share on other sites

Actually, TextMate HAD hype. It lost a lot of luster thanks to:

- taking forever to release version 2

- open sourcing the project (which one could interpret as abandoning it)

- Sublime Text 2

 

There are a ton of arguments when it comes to text editors vs. IDEs, but the fact is that contemporary text editors can do everything that NetBeans does. I don't know that TextMate was ever that flexible, although with its plug-in architecture, it could be, but ST is extremely flexible and powerful. 

 

The fact of the matter is that whatever kind of tool you choose, if it's powerful, it will make your life much easier in the long run, but will be an extra hurdle to learn in the short run. If it's not powerful, it'll be easier to start using, but less efficient over the long haul.

Share this post


Link to post
Share on other sites

Very cool - thanks guys.  I'll spend some time investigating all of this further - I'm sure using the proper tool to get the job done makes you that more efficient and I'm willing to put in the time to learn.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...