MySQL

The world's most popular open source database

Contact a MySQL Representative


  • MySQL.com
  • Developer Zone
  • Partners & Solutions
  • Customer Login
  • DevZone
  • Downloads
  • Documentation
  • Articles
  • Forums
  • Bugs
  • Forge
  • Blogs
 
  • Pages

    • About me
    • Bio
    • Press Release: “Kaj Arnö Appointed MySQL VP of Community Relations”
  • Archives

    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
  • Categories

    • Architecture of Participation (55)
    • Connectors (12)
    • Documentation (4)
    • Events (50)
    • Falcon (5)
    • GPL (9)
    • GUI (3)
    • Licensing (12)
    • MySQL (219)
    • MySQL Cluster (5)
    • MySQL Proxy (4)
    • MySQL Server (32)
    • MySQL Users Conferences (27)
    • MySQL Workbench (5)
    • Photography (11)
    • PHP (9)
    • Release Policy (20)
    • Ruby on Rails (5)
    • Running (6)
    • Summer of Code (8)
    • Sun (53)
    • Sun visits (24)
    • Travel (22)
    • Uncategorized (1)
    • Use cases (12)
    • Virtual company (37)



Observations by Kaj Arnö @Sun
« Ubuntu and MySQL: Getting closer?
The Why and How To of Localising Presentations beyond English »

NetBeans as IDE for developing MySQL itself

Since meeting yesterday with Vladimir Voskresensky, a Sun colleague from St Petersburg, I have a new favourite answer to the request “so tell me an example of technical advantages resulting from Sun’s acquisition of MySQL“:

Using NetBeans as an IDE (Integrated Development Environment) for coding and learning MySQL.

Now, that’s a simple answer, and that’s because it’s a simple and beautiful thought. But let’s start from the beginning.

In my days as a coder, I enjoyed the command line. I’ve used various coding editors, and I’ve disliked the hassle of learning new IDEs, who sometimes are more of a straightjacket than a productivity enabler. So call me conservative if you will, but I’ve written my PHP stuff directly in an editor.

Those who write the C and C++ code of MySQL are likely even more conservative than I am, and for a good reason: They’ve set up an environment that they’re happy with and used to. They are about as likely to change their development environment away from the vim/emacs/gdb/gcc stack as football fans change their favourite football teams.

So you can imagine that Vladimir had a bit of an uphill battle when he wanted to demo the C / C++ extensions to NetBeans.

But then Vladimir started to describe how the NetBeans team had used MySQL as a test case even before MySQL became a candidate for “eat your own dog food” through Sun’s acquisition of MySQL. It’s a real-world complex piece of software, and if an IDE can handle MySQL, it can probably handle most applications.

And the NetBeans team was able to successfully support MySQL:

  • MySQL can be directly imported as a NetBeans project
  • NetBeans can show dependencies between MySQL routine calls
  • NetBeans can show all occurences of a C variable in MySQL’s source code, in a scope-sensitive way (i.e. not a simple grep)
  • NetBeans shows all occurences, across the code base, of a particular class, function, field, macro etc.
  • NetBeans can rename any identifier in-place, such as “a” to something more meaningful (see demo)
  • NetBeans integrates debugging, even of MySQL
  • NetBeans provides easy navigation of code

Now this was enough even for a sceptic like me to become eager. During his demo, Vladimir used the Discovery Wizard to import MySQL and was then quickly able to dispel my deeply rooted skepticism against “unnecessary straightjacket GUIs that prevent real work”. I got a sting in my heart, longing back to do some Real Work, i.e. coding (of which I’ve done much too little this century).

My conclusion is that

  • NetBeans is a great way to learn the MySQL source code
  • learning the MySQL source code is simplified both for our community and for our own engineers
  • usage is so simple and provides so many advantages that it’s worthy of a try

So I didn’t leave the meeting before Vladimir had promised me three things:

  • to write a MySQL Forge Wiki article with pointers to all resources necessary to open MySQL as a NetBeans project
  • to write a MySQL Dev Zone article, expanding on the Wiki article, on how to productively use NetBeans when learning and developing the MySQL code base (from downloading NetBeans over importing MySQL to debugging MySQL, including the key productivity-enhancing benefits of NetBeans)
  • to try his best to come to the MySQL Developer Meeting in Riga in September, to demo NetBeans to our engineers

In return, I promised Vladimir

  • to introduce Vladimir to key MySQL engineers that may evaluate the IDE
  • to set up a MySQL University slot on development MySQL with NetBeans
  • to encourage MySQLers (employees and community) to provide the NetBeans time with feedback that may improve upon, say, the debugging properties

In short, stay tuned for some practical tips on how to work on the MySQL code base from the NetBeans integrated development environment.

I showed a draft of my blog entry to a small group of developers from the MySQL Engineering Team and here are some points I found interesting in their feedback:

  • “I was an emacs hacker once, but since then I got my behind kicked by a VB-developer, a dreamweaver clicker, and a drag-n-drop flash code designer so I opened my eyes to a bigger world. Now I use NetBeans.”
  • “There are some small shortcomings, like attaching debug process, but it works very well in most cases.”
  • “I tried the NetBeans C/C++ package. I liked that I don’t need to download all the Java bloat just to use C/C++. Something I used to miss with Eclipse - just packaged for the C/C++ developer. Bravo!”
  • “Please allow me the luxury of obeying to my habits and staying away from IDEs (being a 10+ years exclusive vi/gcc/gdb command line user this is a lot of inertia that I don’t like to lose right now).”
  • “NetBeans has a neat little re-factoring goodie: change the name of a variable in one place and NetBeans can change it in other places for you.”
  • “My colleague seems to enjoy the ease of extending NetBeans by plug-ins. He has written a plug-in which integrates PHP test runs and presents the results as HTML during a weekend. Can you mention http://blogs.sun.com/netbeansphp/ ?”
  • “The only feature which I don’t like - which is a killer feature for me as I’m a typical “MSIU” (most stupid imaginable user) - is the automatic close and reload of modified files. Accidently remove a file outside of NetBeans, go back to NetBeans and *damn* NetBeans has closed the file. Anyway, this has been reported to the responsible dev already.”
  • “Class browsing and debugging worked well for C/C++. And yes, performance was very much acceptable.”

Links:

  • NetBeans C/C++ Support: http://cnd.netbeans.org/
  • NetBeans IDE 6.1 Features: C/C++ Development: http://www.netbeans.org/features/cpp/
  • Find Usages and Rename in NetBeans (3 minute demo): http://wiki.netbeans.org/wiki/attach/CndRefactoring/Refactoring.htm
  • NetBeans for PHP: http://blogs.sun.com/netbeansphp/
  • NetBeans C/C++ mailing list: users@cnd.netbeans.org — registration and subscription: http://cnd.netbeans.org/servlets/ProjectMailingListList

This entry was posted on Wednesday, June 18th, 2008 at 17:25 and is filed under Architecture of Participation, MySQL, Sun visits. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Responses to “NetBeans as IDE for developing MySQL itself”

  1. Bill Newton Says:
    June 18th, 2008 at 18:53

    Net beans is ok for locally changing code. My major problem with it is its inability to play nice with VIM style folding {{{ code to be foldable }}}. Its missing some polish and ease of use for the edge cases like editing remote files, and use of source code control integration. (some other java based OSS ide, that will go nameless works out of the box with remote repositories on windows).

  2. LenZ Says:
    June 19th, 2008 at 7:49

    Hi Kaj,

    very nice blog article, thanks for the summary and for sharing your impressions!

    Yesterday, I attended and spoke in front of a crowd of ~30 people from the Hamburg Java User Group (http://www.jughh.org/). Talking to some individuals later over drinks also covered NetBeans a few times - here’s some feedback from this audience:

    - Eclipse and IntelliJ IDEA were more popular
    among this audience, many had not looked at
    NetBeans lately
    - The ones that had agreed that NetBeans
    “feels” faster to work with than other
    popular Java IDEs. And they were surprised
    about the nice-looking and polished GUI -
    obviously something that Sun has not been
    known for before :)
    - NetBeans is the best choice for developing
    Groovy/Grails applications, the plugins for
    the other IDEs are inferior in functionality
    - The possibility of directly connecting to a
    MySQL Server and working on tables with the
    table editor (with SQL syntax highlighting)
    or via the GUI was highly praised

    Positive comments from other developers (at different occasions) included mentioning the great support for PHP as well as Ruby/Rails.

    I’m a die-hard VIM user myself, but if I ever have a chance to get back to some serious coding, it seems as if I should take a closer look at NetBeans myself :)

    Bye,
    LenZ

  3. Nacer ADAMOU Says:
    July 25th, 2008 at 9:32

    Very interesting article!
    I am waiting for resources about how to import mysql as a netbeans project.

Leave a Reply

Observations by Kaj Arnö @Sun is proudly powered by WordPress MU running on Blogs.mysql.com.
Entries (RSS) and Comments (RSS).