1.3. Choosing a Development Kit

Your development machine is now running all the necessary programs for programming with PHP. The next step is to decide how you're going to write your scripts. PHP scripts are text-based, so you have myriad options, ranging from the simple Notepad.exe and text-edit programs to highly specialized software development kits (SDKs) and integrated development environments (IDEs).

1.3.1. Benefiting from SDKs and IDEs

There's nothing wrong with coding in a plain text editor, but using an SDK and/or IDE for development can bring you many benefits, including:

  • Syntax highlighting: This is the ability to recognize certain words in a programming language, such as variables, control structures, and various other special text. This special text is highlighted or otherwise differentiated to make scanning your code much easier. For example, the color coding on the left makes this code less daunting to look at (see Figure 1-10).

  • Built-in function references: When you enter the name of a function, this feature displays available parameters, as well as the file that declares the function, a short description of what the function does, and a more in-depth breakdown of parameters and return values (see Figure 1-11). This feature proves invaluable when dealing with large libraries, and it can save you trips to the PHP manual to check the order of parameters or acceptable arguments for a function.

  • Auto-complete features: Common to most SDKs and IDEs, this feature adds available variables to a drop-down list, allowing you to select the intended variable from the list quickly and easily, saving you the effort of typing it out every time (see Figure 1-12). When it comes to productivity, every second counts, and this feature is a great way to contribute to saved time.

  • Code Folding: This feature lets you collapse snippets of code (see the plus and minus toggles on the left-hand side of Figure 1-13), reducing workspace clutter-free and making it easy to navigate your code. This feature proves especially helpful for reducing the confusing clutter that springs up as your scripts become increasingly complicated.

Figure 1.10. The left-hand side shows code with syntax highlighting; the right-hand side shows the same code with no syntax highlighting

Figure 1.11. Viewing a function reference in the Eclipse PDT

Figure 1.12. Taking advantage of autocomplete in the Eclipse PDT

Figure 1.13. Code folding in the Eclipse PDT

1.3.2. Choosing the Right SDK

You have many choices when it comes to choosing development tools, and it should be noted that there's no wrong answer when selecting yours. If the tool feels right, and makes sense to you, that's really all that matters.

1.3.2.1. The Eclipse Foundation and PDT

The exercises in this book rely on the popular open source Eclipse SDK and more specifically on the PHP-specific PDT IDE. PDT stands for PHP Development Tools, and this IDE provides a free IDE option for beginning developers.

The team responsible for overseeing Eclipse notes, "Eclipse is an open source community, whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle."

Essentially, this means that Eclipse is a group of people working together to create the best available tools for developers—at no cost to the developer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.104.27