Eclipse Finally Gets Code Folding 90
binarysearch writes "Code folding is finally in the Eclipse project! After more than two years open, Eclipse's Bug 9355 has finally been marked FIXED. Code Folding was the most-voted for bug in Eclipse, with support for J2SE 1.5 features in a close second. Check out the I20040504 Integration build for folding in the Compilation Unit Editor (Class File Editor support is in HEAD). For those who dislike the implementation, it is requested that you create a new bug, rather than reopening 9355."
Code folding is: (Score:5, Informative)
Re:Code folding is: (Score:5, Interesting)
Or what about keeping the code blocks small and concise? See Linux kernel coding style Chapter 4 [linux.no].
If you have to scroll some pages to find the corresponding closing tag, something has gone wrong.
But I've to admit, that I use code folding myself, which shows, I'm not a real programmer. But I also prefer Emacs to vi, which only confirms the fact I'm a quiche eater [wisc.edu].
Re:Code folding is: (Score:2)
Perhaps, but it's just as annoying tracing your way through a bunch of method/function calls.
Re:Code folding is: (Score:2)
Same rule applies. If you have to trace through a bunch of methods, it's time to refactor, because something has gone wrong.
Re:Code folding is: (Score:2, Troll)
No, a million other IDEs don't have it. I only know of two: VS.NET and IDEA J.
And no, Eclipse is an OSS project. It is not limited to usage by FS/OSS programmers.
And no, FS/OSS programmers demand high-standard devlopement tools too which equates to great ease of use. Why do you think we have simple, and easy to use build systems (make) and revision systems (subversion, cvs)? We also like GUI builders (Glade, QT
Re:Code folding is: (Score:3, Interesting)
Re:Code folding is: (Score:2, Informative)
Anjuta doesn't have it. I'm using it right now.
Kate, I doubt it. It's a text editor.
Vi doesn't.
Emacs, I dont know.
Re:Code folding is: (Score:2, Interesting)
Ooops. I just upgraded my old ass version.
Forgive me, senor.
Re:Code folding is: (Score:3, Informative)
Add in your
set foldmethod = marker
And, on your code, do comments like this:
void stuff(void)
{
weird_stuff();
}
use 'zc' to close the fold and 'zo' to open it. More info?
Re:Code folding is: (Score:3, Informative)
Re:Code folding is: (Score:1)
Re:Code folding is: (Score:3, Insightful)
Re:Code folding is: (Score:4, Insightful)
What sort of a response would I have been trolling for?
Re:Code folding is: (Score:2)
Re:Code folding is: (Score:2)
I'd be really surprised if EMACS didn't offer something similar.
Re:Code folding is: (Score:2)
I'd be really surprised if the idea didn't come from Emacs in the first place. outline-mode has existed in Emacs since the '80s, and before it was made to play nicely with other programming modes by default (it used to take a lot of configuration for anything other than bullet-point text like the Emacs NEWS file), someone wrote a folding-mode [csd.uu.se] (apparently in 1992) specifically for curly-brace languages (C/C++ etc).
Re:Code folding is: (Score:2)
I believe there was an Occam editor with folding support before Jamie Lokier wrote the Emacs folding mode.
Re:Code folding is: (Score:2)
Re:Code folding is: (Score:1, Informative)
Re:Code folding is: (Score:1)
Re:Code folding is: (Score:2)
Re:Code folding is: (Score:2)
Re:Code folding is: (Score:2)
Re:Code folding is: (Score:2)
P.S. I *asked* whether that was something "real" programmers would do. I guarantee you, I'm not a "real" programmer.
I think I've only ever met one or two. And they didn't write SQL queries. For cash. On the street. Eating government cheese.
code folding? (Score:5, Interesting)
i would rather term it code collapse...and which is what they call it in the main bug report. however, lots of people call it folding in the followup comments.
i guess i better get used to it being called code folding too.
so, i am happy that i can collapse 100s of lines of code into just the relevant 10-15 lines of code easily. however, i think this can create a problem of introducing silly error pass through (because you dont have the whole perspective on things). i think they have a feature to collapse all code that doesnt involve a variable "x". Anyone tested this yet?
Re:code folding? (Score:2)
Code folding is always the same... in practise it's no better than just looking over at the bottom left window, which shows all the methods and fields in your class. If anything it's a little more inconvenient because you need to keep opening things when you have to edit the insides.
Really at this point the only thing that Eclipse could do to wow me would be fixing bugs like "application performance sucks", or "there is no Qt frontend." The latter of these I've been investigating lately by prodding the r
Re:code folding? (Score:3, Informative)
Re:code folding? (Score:2)
or printing in Linux...
-1 Not Funny (Score:1)
Availability (Score:4, Interesting)
So... don't get excited -- the feature is *coded*, but you can't use it yet. That is, I haven't tried an Eclipse nightly before, but in general it's a bad idea if you're depending on the tool.
It looks like the latest integration build (a step up from a nightly) is still failing its tests [eclipse.org].
In my experience, even some of the milestone builds have been a tad flaky (I put up with it because I want the features).
Anyone involved in the project know anything about when the next milestone release is planned?
Re:Availability (Score:5, Informative)
Re:Availability (Score:1)
Re:Availability (Score:2, Informative)
They keep updating it, but they never re-list it in the history for some reason, leaving it down in the news from last May.
Here's a direct link [eclipse.org].
Re:Availability (Score:1)
Hint for Emacs Users (Score:5, Informative)
Turn on hs-minor-mode (M-x hs-minor-mode) and code blocks can be folded and unfolded with shift-middle-click (or C-c @ C-c).
Re:Hint for Emacs Users (Score:1)
Re:Hint for Emacs Users (Score:2)
Re:Hint for Emacs Users (Score:1)
first thing that I disabled in netbeans (Score:2, Insightful)
You need to see the code if you're going to write it or understand it.
Eclipse and C++ (Score:2)
Re:Eclipse and C++ (Score:3, Interesting)
So, that was about a year ago, and I've been a bit hesitant to try it again, despite the fact I really did like the Eclipse environment.
Can anyone comment on how far the CDT has come in the last 12 months? Oh and also - i
Re:Eclipse and C++ (Score:5, Informative)
Not very far, AFAIKT. I used it a couple of months ago for some JNI/C++ code I was working on, and found that although it looks a lot like the Java editor, it behaves vastly different.
No code completion, no code formatting, no refactoring.
Just a basic code editor with color syntax highlighting.
Feature requests, not bugs? (Score:4, Insightful)
Re:Feature requests, not bugs? (Score:4, Informative)
Bugzilla (Score:2, Interesting)
Therefore, when they call it "Bug 9399", they are just referring to the entry in bugzilla with that number.
Re:Feature requests, not bugs? (Score:2)
Oh boy. In the topic of J2SE, IntelliJ IDEA had (albeit experimental) support for 1.5 over half a year ago (was it longer? It might have been a whole year by now.)
I wish that the new Eclipse would have support for the Java which is emerging at the time it comes out.
People often start developing an application while the SDK or APIs they're using are in beta because by the time the app is finished, the API will be in final release. But right now there is no free IDE for editing J2SE 1.5 code (unless you
Re:Feature requests, not bugs? (Score:3, Informative)
That said, 1.5 support is coming along and development versions can be installed as a plug-in [eclipse.org] (that link will also show you the current status).
Once it's complete, I'm sure it will be included in an Eclipse point release. 3.0.2 or 3.1 or whatever.
questionable features (Score:5, Insightful)
For example, most of the .NET programmers I work with are x-VB guys and they use this alot. what ends up happening is they put all the classes in one file. Which actually leads to a tendency of coding with lots of inner classes. One of the biggest strengths of Java in my mind is it encourages programmers write smaller chunks of code that is more modular and re-usable. If you write your code in a well organized manner, you won't really need folding. Especially since the right pane in Eclipse shows you the methods and allows you to double click and jump to that point quickly.
I read the bug/feature requests and many of the arguments in my mind are personal bias. they aren't really valid. Several people complained Eclipse wasn't usable because it didn't have folding. I question that way of thinking and suggest the user is inflexible and unwilling to adapt. If it's that important, then write it yourself and submit it to eclipse. Needless whining serves no one any good. The time spent whining could be spent coding.
Re:questionable features (Score:1)
Interesting point. Maybe what should be done to support co
Re:questionable features (Score:3, Funny)
Since the desired feature was implemented, the "whining" was apparently quite effective.
Re:questionable features (Score:2)
PHP has no preprocessor "include" statement, so short of splitting your method bodies into other files using the execution time include statement which brings a performance penalty on every call to the method, you often wind up writing huge monoliothic classes full of relevant methods rather than nicely splitting them into smaller files and using a preprocessor directive to include them.
I have my editing en
Re:questionable features (Score:1)
What you really want is C-style preprocessing. The fundamental difference here is that in C the code gets compiled and therefore preprocessing makes sense. Unless PHP steps up from being interpreted files to being binary executables, what you are talking about makes no sense.
NetBeans has it in 3.6 (the stable release) (Score:2)
Also, for those saying this lead
Re:NetBeans has it in 3.6 (the stable release) (Score:2)
Using NB 3.6 with J2SE 1.5 (Score:1)
IDEA (Score:2, Informative)
Missing the point of good OO code? (Score:1)
Re:Missing the point of good OO code? (Score:2)
Otherwise, truly well written OO code would rarely even lend itself to code folding.
Nope. Just dealing with certain realities. (Score:3, Insightful)
That's what I keep saying to my coworkers. Nevertheless, we have methods over a thousand lines long, and our largest class is hovering around 25kloc (and I assure you, there's little reason for most of that code to be in the same class).
If nothing else, code folding is an effective tool for when you're forced to maintain sourc
Re:Nope. Just dealing with certain realities. (Score:1)
Or you could just run a java-to-vb cross compiler and replace your entire staff with high school students ^^-)
Code Density (Score:2, Funny)
What this does is fit a lot more code in the same number of lines (not recommended for LOC whores), meaning you see a lo
Re:Code Density (Score:1)
Please explain. You don't like the way I code? It has served me very well for many years.
You may complain about the absence of comments, but the code I posted was almost the entire function. The purpose of the code is very clear from the function title. Besides, comments just lower the code density and prevent me from seeing as much code per screen.
I realize that my style isn't necessarily good for programmers working as part of a team. I am always the sole programmer on projects I work
Re:Code Density (Score:1)
The main problem is that there are some changes that are not apparent if you were to skim the method. For example:
readMode = cModeTextAuto | fModeTwo | fModeLF; c = LF;
On a quick skimming of the method the "c = LF" state
Re:Code Density (Score:1)
It is just harder code to read than what most programmers are used to.
The main problem is that there are some changes that are not apparent if you were to skim the method. For example:
readMode = cModeTextAuto | fModeTwo | fModeLF; c = LF;
These are good points. I am used to my style, so when I go back and read my own code I pay attention to the entire line. I readily admit that this style isn't necessarily good for situations where others will re
Re:Code Density (Score:1)
In software development the "me/I/my" code doesn't work well in large development projects or anything close to trying to implement any type software engineering practices. Once you start owning the code in the sense that you don't care who else reads it, the code is already non-useful for future enhancement.
Also, there are different reason one develops programs.
Re:Code Density (Score:1)
As I've already said, I'm not interested in working with others. I'm only interested in working alone. If somebody wants to work on (or with) my code they can do so, but on my terms. This has happened several times with my clients, and after the initial steep learning curve they have successfully understood and modified my code. They h
Re:Code Density (Score:1)
Re:Code Density (Score:1)
I am aware of the arguments against goto. I could have easily wrapped the main portion of the code in a loop and then used break and continue when needed. In fact, that's what I did at first. I then decided that I liked the goto implementation more.
Secondly, your code is full of redundancies. What you are doing can be captured much more clearly by a finite state automaton with an alphabet and transition table.
Can you give a quick exam
Re:Code Density (Score:2)
My programming teacher plainly told me that the less break/continue you use, the better the code. Basically, he argued that if your code is perfectly clean, you don't need them.
At first I was a bit unsure, but after a few lessons, and now after learning functional languages, I see that sometimes clever approaches make for much cleaner code.
Re:Code Density (Score:3, Funny)
Re:Code Density (Score:1)
Really? I must learn Java properly some time. I just assumed it must have one.
Re:Code Density (Score:3, Funny)
<p>
Don't worry - Java's garbage collector will take care of that garbage...
<p>
Re:Code Density (Score:1)
I know that everybody has their own style but I work in a commercial organization that writes Enterprise software and I can tell you that this would not have passed our code reviews.
1- The formatting is too tight. Not enough white space.
2- Complete absence of comments (big boo boo)
3- Poor indenting (affects readability)
4- Multiple statements on one line (usually a bad idea)
Re:Code Density (Score:1)
I know that everybody has their own style but I work in a commercial organization that writes Enterprise software and I can tell you that this would not have passed our code reviews.
I have already stated that this style probably isn't right for most people. It works well for me and since I work alone nobody else has to see it.
1- The formatting is too tight. Not enough white space.
I like it precisely because it is tight.
2- Complete absence of comments (big boo boo)
Comments often t
Re:Code Density (Score:2)
Mac compat (Score:2)
Re:Mac compat (Score:1)