I’m not sure if I can help with the mind part, but I can definitely add some perspective on the line numbers. Quickly, let’s define just what the ‘gutter’ is in the world of programming and database GUIs. I found a good definition on Quantum Whale, a .NET component developer, and I’m going to quote them:
Gutter:
The gutter area can be used to display bookmarks, line numbers and outline sections.
The gutter is the area to the left of the text, the purpose of which is to display miscellaneous indicators for the corresponding lines of text. Among these indicators are bookmark indicators, line wrapping indicators, line styles icons, and line numbers. All the images displayed in the gutter are contained in the gutter image list.
Notice the VERY last thing mentioned in that description. A place to display ‘line numbers.’
Now here is the question of the day –
Should your IDE show these by DEFAULT?
I’ll save you the suspense and tell you that many of the IDEs out there DO NOT, and that includes SQL Developer. There are probably a few reasons, and I can make up more, but it probably comes down to this:
- JDeveloper doesn’t
- Keep the coding area as clean as possible
One of those reasons is a technical reason, and end users could care less about those. The other is more of a personal choice / philosophical decision. When you make these types of decisions, you opt for something with minimal impact to the user base, and aim to ‘do no harm.’ Did we make the right decision here? For many of you, yes we did. For many others of you, no we did not.
In our defense I could publicly mention several other database IDEs that have the exact same behavior. But, I would also argue with myself that those people are no better off and that we should strive to be the best. Yes, I do tend to argue with myself quite a bit.
One of my Twitter friends asked me if SQL Developer was an IDE or was it Notepad. Ouch, being compared to Notepad. Although I will admit to Notepad being my default HTML editor and I have no problems not having line numbers there.
I get his point though, serious coders are working on programs with many thousands of lines of code. They need little helpers to get them through the day.
Lets take a quick look at the following picture:
So the error message is on line 11. This is where the Oracle parser gets upset that it’s not finding that COMMA that it expects. If it were complaining about line 24,327 it might be a pain to get to that line number, right?
Except.
Ctrl+G will open the ‘Go to line number’ dialog for easy jumping.
It’s a click-click to get the line numbers on. I suppose you could argue that folks might not know where to click. Right-mouse-click in the gutter space.
If you are in the PL/SQL Editor, you can actually click on the error message in the ‘Compiler Log’ panel and it will take you to the indicated line number for that error message.
Maybe I am too close?
What I see as intuitive, you see as a trick?
If you think we’re doing it wrong, please add your vote in the form of a comment to this blog post. You can also up-vote this request in the Exchange, although it needs re-worded.
Maybe we need a SQL Developer++? Notepad++ after all DOES show line numbers in their gutter by default ๐
16 Comments
I know how to toggle the line numbers on and off , and have decided that I always want the line numbers to show.
Is there a way to have the line numbers show by default when you open a new worksheet?
Hello Jeff,
There is a good news.. After discovering the use of some features in SQL developer I have give some demo to my project team….& tomorrow I am going to deliver a session on SQL dev use… Basically my project is shifting from toad to sql dev.. thanks for your help…Jeff..
Will look for your help in future.. ๐
Good luck on your presentation, and of course let us know if there’s anything we can do to help you and your colleagues!
Hi Jeff,
The formatter issue got solved. Actually when I was exported my profile I was saved in diff name, thats gen the confusion. It works in same way you suggest.
I will send you the .XML file by tomorrow..coz am not able to access my personal mail from office…sorry ๐
Hi Jeff,
I have tried in the same way. But after import when I open the SQL Formatter -> Oracle formatting tab from preference, then my new imported profile name is not displaying. I have tried it version 3.0.
Also for version 3.1 EA2, when I run any proc then the execution script is not appearing in the execution popup box. But it is coming for version 3.0. Do i need to do any additional set up for 3.1??
Need your help..
Can you send me your XML file? [email protected]
For executing procedures, the dialog is empty, or the dialog isn’t showing at all? If empty, have you tried hitting the ‘Reset’ button? This will re-generate the anon block script for executing your PL/SQL code.
Hi Jeff I have set my customized code profile settings. Now I want to export this from my machine and share it with my friend. Please tell mw how I can do this.
I have tried with the export import option.. but after importing the .xml in my friends machine am not able to see the profile in drop down list.
I just tried the same thing, and it seemed to work for me. So let me detail my steps, and we can go from there.
Can you confirm you followed nearly the same steps, save for sending your XML file to your friend’s machine?
My personal preference is to have the line numbers enabled by default. They don’t bother me at all ๐
Well, as it is handy most of the time, I wouldn’t be bothered when they’re there all the time.
Usualy a right click on the screen will open a popup menu that has “show line numbers” or “options”, so it isn’t that hard to find.
But to be honest, it doesn’t really matter whether the IDE show line numbers by default or not. As long as it is possible to show them, otherwise I would look for another IDE.
Yeah, that’s 2 different points.
When installing an IDE, the first thing I do is look for the option “show line numbers”.
Even when logging runtime errors(using DBMS_UTILITY.FORMAT_ERROR_BACKTRACE), it’s handy to to have line numbers or use CTRL+g.
So, save 5 seconds of a developers time and show these line numbers in the gutter by default.
Do you think you would have the same perspective if you did not code PL/SQL and only wrote SQL statements for ad hoc biz cases and reports? Just curious…
I don’t discount your 5 seconds. It’s probably closer to 120 if you have to fall back on a Google query to figure out how to accomplish the task.
I primarily write SQL for ad hoc queries and I wished that line numbers were on by default. I had discovered the “go to line” feature but I hadn’t discovered how to turn on the line numbers because I never saw an option in the menu and I hadn’t thought that it might be hidden in a context menu.
It’s also a preference in Tools > Preferences.