Code faster and smarter PHP with IDEs Like Netbeans
Upcoming SlideShare
Loading in...5
×
 

Code faster and smarter PHP with IDEs Like Netbeans

on

  • 8,259 views

[Presented at WordCamp Montreal <a>View session description</a>] ...

[Presented at WordCamp Montreal <a>View session description</a>]
Simple text editors are fast and easy to use, but they don’t understand the code you’re writing. This talk explains how Integrated Development Environments (IDEs) like NetBeans or Eclipse (both are Free Software and cross-platform), can handle the tedious parts of programming to let you focus on getting things done with your code. Stop having to memorize function arguments and type out PHPDoc by hand! If you haven’t tried working with an IDE, or even if you have and got scared, this talk will walk you through the why and the how of saving time and headaches by committing to one. I’ll also cover using PHPXref, a simple alternative to IDEs that offers a lot of the same utility without changing any of your code workflow.

This talk is targeted at people coding PHP. Though IDEs are also useful for HTML, CSS and Javascript authors, their value is relative to how serious your coding is. If you’re planning to attend consider installing NetBeans beforehand so you can follow along.

Statistics

Views

Total Views
8,259
Views on SlideShare
8,258
Embed Views
1

Actions

Likes
3
Downloads
39
Comments
0

1 Embed 1

https://si0.twimg.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Code faster and smarter PHP with IDEs Like Netbeans Code faster and smarter PHP with IDEs Like Netbeans Presentation Transcript

  • CODE FASTER ANDSMARTER PHP WITH IDES LIKE NETBEANS Jeremy Clarke • http://jeremyclarke.org Download these slides: http://slideshare.net/jeremyclarke
  • WHO IS JEREMY CLARKE?• Communications Studies at Concordia University.• HTML+CSS since 2003• Montreal WordPress Community/ WordCamp organizer.
  • IDES: OVERVIEW• Basic code editors• IDEs as a concept• NetBeans and IDE features• IDEs and WordPress development• IDE issues and justifications• PHPXref
  • BASIC CODE EDITORS Tabs• Texteditor with Syntax extra tools. highlighting• Lightweight and Line simple. Numbers• Often many features, but always some missing. Complex Find/Replace* Sublime Text 2 (pseudo-IDE) http://sublimetext.com/dev
  • 3 PRINCIPLES OF IDES• Handle everything • The IDE should be the only application you need, all tools are built-in and integrated together.• Understand the code • Codeis parsed and modelled by the IDE so it can help you make decisions and correct your mistakes.• Extreme customizability • By programmers, for programmers. Every aspect is optional.
  • NETBEANS OVERVIEW• Written by Sun in and for use with Java.• Open Source/Free Software.• Similar to competitors Eclipse, Komodo, PHPStorm, Aptana etc.• Has hundreds of features, not all implemented perfectly*. http://netbeans.org/ *Projects, tabs, split-window, multiple-window, navigator, bookmarks, code folding, macros, snippets, debugging, breakpoints, database access, SVN integration, syntax coloring (configurable), PHP error detection, code hints, code completion, PHPDocgeneration, inline PHPDoc display, quick-open file, find usages of function/variable, go to function, go to line, PHPUnit testing, IDE log, rename function/variable, configurable keyboard shortcuts, synonymous keyboard shortcuts. Infinitely more, I don’t even pretend to know them all.
  • PROJECT-ORIENTED• IDEs open projects instead of single files.• A project includes all files used for a single site.• The whole project is parsed together, the IDE understands how the functions and variables interact.• All forms of search and auto-complete apply to the entire project.• This includes all of core WordPress, plugins and themes.
  • SYNTAX INTELLIGENCE• Configurable syntax color themes. Matching variables Syntax error highlighted• Visualhints for brackets and control structure pairs (if/endif;)• Highlightother uses of variable and functions• PHP/HTML/CSS syntax error checking.
  • CODE COMPLETION• Guesses object, function Possible functions/arguments and variable names as you type. PHPDoc of selection• Like spellcheck for code. Saves time and avoids errors.• Setsup arguments to be quickly filled in.• Exposes documentation as you code!
  • PHPDOC INTEGRATION• PHPDoc is default documentation for PHP, used by core WP.• Reading (autocomplete) AND writing PHPDoc is built into NetBeans.• Automatically generate PHPDoc for new functions. Automatically- Filled-in function generated PHPDoc documentation
  • SOURCE NAVIGATION• Navigator pane shows full list of functions in current file.• Go to symbol: Jump to a function/ class, guesses as you type.• Go to file: Open any file in the project, guesses as you type.• Go to declaration: Select a function and a keyboard shortcut jumps you to it’s definition in the source, opening a new file if necessary.
  • DEEP SEARCH Find in Project Find UsagesSearch entire project for any List every time a functionstring, results sorted by file. or variable is used.
  • SUBVERSION INTEGRATION• Changed/added/removed lines highlighted as you edit.• View visual diff of changes to files.• Update, commit and revert files without leaving the app.Note: SVN interface is awkward. Use keyboard shortcuts.
  • CUSTOMIZATION• All keyboard shortcuts are editable.• Tweakcolor schemes and install new ones (e.g. Solarized).• Enable/disable syntax checking, hints, autocompletion etc.• Create custom templates and macros (e.g. ending semicolon).• Settings import/export for backing Download my color scheme: up and sharing color schemes, simianuprising.com/netbeans-color-scheme macros, and keyboard shortcuts.
  • SIMPLIFY WINDOW LAYOUT• Default view is cluttered, Close all panes you don’t immediately need.• Re-enable panes if/when you learn how to use them, most features are better used as keyboard shortcuts. BAD GOOD
  • WORDPRESS AND IDES• Entire WordPress codebase (core, plugins, themes) is parsed by IDE, not just your code.• Easiest way to dive into core/plugin code and figure out how it works.• Autocompletemeans not having to memorize every strange, legacy WP/PHP function and it’s argument order.• PHPDoc of core WP means all of WordPress has an integrated manual as you type.
  • IDE ISSUES• Slower to boot up and requires a powerful CPU+RAM.• Simpler text editors offer most features without extra weight.• Many unwanted/unnecessary features clutter up the interface.• More complicated software means steeper learning curve.
  • IDE JUSTIFICATIONS• Professional photo, video and even accounting software is system-intensive. Programming can similarly benefit from giving your CPU a workout.• Unwanted features can be disabled or hidden to simplify UI. Core intelligence hides until needed.• Programming is complicated and hard. We should expect a learning curve on software that actually thinks for us.
  • APPENDIX 0: PHPXREF• Perl script generates HTML that summarizes any PHP codebase.• http://phpxref.sourceforge.net/• Links for all variables and functions showing where they are defined and used.• Generateyour own, or use one of * http://phpxref.ftwr.co.uk/wordpress many WordPress Xref ’s hosted online*.• Next best thing to a real IDE.
  • QUESTIONS?
  • CODE FASTER ANDSMARTER PHP WITH IDES LIKE NETBEANSJeremy Clarke • http://jeremyclarke.org Creative Commons Share Alike http://creativecommons.org/licenses/by-sa/3.0/ Download these slides: http://slideshare.net/jeremyclarke