Recommend a good free text editor?

Discussion in 'Java' started by Atreju, Dec 12, 2007.

  1. Atreju

    Atreju Guest

    Hi all,

    Following up from a previous post, I just started using Sams Teach
    Yourself Java 6 in 21 days. So far it seems very nice, very similar to
    my old VB book of the same series.

    However, the text editor it comes with is buggy (for example, doesn't
    colorize syntax until file is saved) and doesn't really do what I
    need, and I'm wondering if anyone knows of any java-aware freeware
    editors that do what i need:

    For example, I had compile errors a few times because I failed to
    capitalize the word "String" and simliarly I named a method
    "showAttributes" but when I called it in an application I accidentally
    capitalized ShowAttributes and it did not recognize any time I used it
    like that, until I changed them to lowercase the way it is written in
    the method declaration.

    Having been using VB for so long, I'm spoiled in that, let's say I
    name a variable strMyStringVariableWithAWeirdName
    I could type ANYWHERE in my project strmystringvariablewithaweirdname
    and it would automatically recognize it as having been declared as a
    variable, and it applied the appropriate capitalizations. This
    "awareness" as it is referred to is extraordiarily useful for me, and
    especially since I'm only just learning... I understand that in the
    scope of a whole IDE it can have the power to recognize everything
    built therein, but even just having not capitalized "String" in my
    main, for example, caused me a problem:
    I wrote
    public static void main(string[] arguments) {

    and it left the word string un-capitalized. Given that's a variable
    type that's part of the java language, I would think at least I could
    get an editor that would correct that. It wouldn't compile until I
    found that error.

    Yes, yes, I know I've been spoiled, but I often, in my freeware hunts,
    see a gazillion "editors" on the internet that feature all kinds of
    these abilities for various languages.

    I need the easiest and most reliable one in terms of taking care of
    holding my hand like this. I want something free. I've been browsing
    sourceforge but nothing catches my eye yet, so I figured... here's a
    good place to get recommendation.

    Any recommendation is appreciated, thanks.
     
    Atreju, Dec 12, 2007
    #1
    1. Advertising

  2. Atreju

    Lew Guest

    Atreju wrote:
    > ... but even just having not capitalized "String" in my
    > main, for example, caused me a problem:
    > I wrote
    > public static void main(string[] arguments) {
    >
    > and it left the word string un-capitalized. Given that's a variable
    > type that's part of the java language, I would think at least I could
    > get an editor that would correct that. It wouldn't compile until I
    > found that error.


    Well, that editor trusted you. It is conceivable, and legal, if ill advised,
    to name a variable or a type "string", therefore it would be presumptuous of
    an editor to re-cast the spelling.

    As an example, it is quite common for people to use a construct like

    List list = ... ;

    The editor cannot "correct" something that might not be wrong.

    --
    Lew
     
    Lew, Dec 12, 2007
    #2
    1. Advertising

  3. Atreju

    voorth Guest

    On Dec 12, 6:44 am, Atreju <> wrote:

    > I need the easiest and most reliable one in terms of taking care of
    > holding my hand like this. I want something free. I've been browsing
    > sourceforge but nothing catches my eye yet, so I figured... here's a
    > good place to get recommendation.
    >
    > Any recommendation is appreciated, thanks.


    There are several good IDE's that give you that; both Eclipse <http://
    www.eclipse.org/> and NetBeans <http://www.netbeans.org/> are free and
    support auto-completion, and more (refactoring support comes to mind).

    I would recommend getting both and see which one suits you best.

    Henk
     
    voorth, Dec 12, 2007
    #3
  4. Atreju

    Guest

    Symbol names in Java are case-sensitive. VB/VB.NET they are not and
    the IDE is designed to correct a name to the way it was originally
    spelled when declared.
    That is why
    String string = new String();
    is valid. Also:
    int a1;
    int A1;
    creates two DIFFERENT variables. The IDE won't want to presume which
    one you mean, because it might get it wrong.
     
    , Dec 12, 2007
    #4
  5. Atreju wrote:
    > Hi all,
    >
    > Following up from a previous post, I just started using Sams Teach
    > Yourself Java 6 in 21 days. So far it seems very nice, very similar to
    > my old VB book of the same series.
    >
    > However, the text editor it comes with is buggy (for example, doesn't
    > colorize syntax until file is saved) and doesn't really do what I
    > need, and I'm wondering if anyone knows of any java-aware freeware
    > editors that do what i need:
    >
    > For example, I had compile errors a few times because I failed to
    > capitalize the word "String" and simliarly I named a method
    > "showAttributes" but when I called it in an application I accidentally
    > capitalized ShowAttributes and it did not recognize any time I used it
    > like that, until I changed them to lowercase the way it is written in
    > the method declaration.

    ....

    This is not an editor issue, but a programming language design issue.
    One of the key decisions in designing a programming language is whether
    to treat capitalization as significant. Is "string" the same as "String"
    or different?

    An editor for a language in which identifier case is not significant can
    treat these as equivalent, and normalize to one capitalization for display.

    In Java, "showAttributes" and "ShowAttributes" are distinct identifiers.
    An editor that automatically "corrected" one to get the other would be
    badly broken. At the most, it should offer "showAttributes" as a
    possible correction when it finds "ShowAttributes" is undefined.

    If you are used to a language in which identifier capitalization is not
    significant you may benefit from an IDE that will mark undefined
    identifiers and offer corrections. I suggest Eclipse.

    Patricia
     
    Patricia Shanahan, Dec 12, 2007
    #5
  6. Atreju

    Lew Guest

    Patricia Shanahan wrote:
    > If you are used to a language in which identifier capitalization is not
    > significant you may benefit from an IDE that will mark undefined
    > identifiers and offer corrections. I suggest Eclipse.


    NetBeans is a suitable alternative.

    --
    Lew
     
    Lew, Dec 12, 2007
    #6
  7. Atreju

    Atreju Guest

    On Wed, 12 Dec 2007 01:15:23 -0500, Lew <> wrote:

    >Atreju wrote:
    >> ... but even just having not capitalized "String" in my
    >> main, for example, caused me a problem:
    >> I wrote
    >> public static void main(string[] arguments) {
    >>
    >> and it left the word string un-capitalized. Given that's a variable
    >> type that's part of the java language, I would think at least I could
    >> get an editor that would correct that. It wouldn't compile until I
    >> found that error.

    >
    >Well, that editor trusted you. It is conceivable, and legal, if ill advised,
    >to name a variable or a type "string", therefore it would be presumptuous of
    >an editor to re-cast the spelling.
    >
    >As an example, it is quite common for people to use a construct like
    >
    > List list = ... ;
    >
    >The editor cannot "correct" something that might not be wrong.


    Ah, see for example, in VB you cannot name a variable string. There
    are lots of words you cannot use since they are reserved. I supposed
    down in the core of the language BASIC, maybe you could, but the IDE
    prevents you from using reserved words where inappropriate.

    Perhaps it is in fact an IDE I am in need of.
     
    Atreju, Dec 12, 2007
    #7
  8. Atreju

    Atreju Guest

    On Wed, 12 Dec 2007 10:23:09 -0500, Lew <> wrote:

    >Patricia Shanahan wrote:
    >> If you are used to a language in which identifier capitalization is not
    >> significant you may benefit from an IDE that will mark undefined
    >> identifiers and offer corrections. I suggest Eclipse.

    >
    >NetBeans is a suitable alternative.


    Yea the book came with Netbeans and I already installed Eclipse so
    I'll play with both. Do these do what I'm referring to?

    Despite what many have suggested, that myFunction and MyFuntioN are
    two distinct things, I cannot imagine anyone wanting to use them
    differently within any project... it makes for some serious confusion
    not to mention not very good in terms of re-usability and clarity to
    other developers looking at the code. I would think that even though
    some conventions may be legitimate, any responsible developer would
    avoid such things... I am only an amateur but one of the most
    fundamental tenets I stick to is the code should be as consistent and
    distinct and readable as possible. I realize what is being pointed out
    is that the editor should not presume anything, but an IDE I hope
    would recognize once a variable or a function has been declared and
    then henceforth correct spelling to match it. Even, perhaps, as a
    user-defined preference that it should do this.

    Thanks for the advice all - I had a sneaking suspicion that what I
    really needed was a full IDE not just an editor. I had been advised to
    keep it very very simple at first and start just with text editors,
    but I'm so used to being spoiled by an IDE that I guess maybe I should
    dive right in and just ignore anything I don't need to know yet.

    All your replies are much appreciated.

    -Dan
     
    Atreju, Dec 12, 2007
    #8
  9. Atreju

    Roedy Green Guest

    On Wed, 12 Dec 2007 00:44:36 -0500, Atreju
    <> wrote, quoted or indirectly quoted
    someone who said :

    >However, the text editor it comes with is buggy


    You might want to jump directly to an IDE. See
    http://mindprod.com/jgloss/ide.html

    If you want to stick with a text editor see
    http://mindprod.com/jgloss/editor.html
    for some possibilities.

    I suggest speed dating. Asking someone to arrange a marriage for you
    won't work, since everyone has such specific tastes in what they like
    in a editor.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Dec 12, 2007
    #9
  10. Atreju

    Roedy Green Guest

    On Wed, 12 Dec 2007 06:50:52 -0800, Patricia Shanahan <>
    wrote, quoted or indirectly quoted someone who said :

    >If you are used to a language in which identifier capitalization is not
    >significant you may benefit from an IDE that will mark undefined
    >identifiers and offer corrections.


    The other way so make Java's picky capitalisation less painful, till
    you get used to it, is to RIGIDLY follow the naming conventions, which
    include capitalisation rules. If you are sloppy, you make life 100
    times more complicated than it need be.

    See http://mindprod.com/jgloss/codingconventions.html

    I recall my early frustration. Now cap errors appear as glaring as
    spelling errors. The catch is, I have a heck of a time reading newbie
    code that violates the coding conventions. To make matters worse,
    whenever I correct newbies, some nerd will point out the coding
    conventions are not enforced by the compiler so the newbie can code
    caps and name variables any screwy way he pleases, nya nya nya.

    You will see some posters like patient sheepdogs constantly herding
    newbies who write arraylist when they mean ArrayList, trying to get
    them to understand it DOES matter.

    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Dec 12, 2007
    #10
  11. Atreju

    Lew Guest

    Lew wrote:
    >> As an example, it is quite common for people to use a construct like
    >>
    >> List list = ... ;
    >>
    >> The editor cannot "correct" something that might not be wrong.


    Atreju wrote:
    > Ah, see for example, in VB you cannot name a variable string. There
    > are lots of words you cannot use since they are reserved. I supposed
    > down in the core of the language BASIC, maybe you could, but the IDE
    > prevents you from using reserved words where inappropriate.
    >
    > Perhaps it is in fact an IDE I am in need of.


    "list" and "string" are not reserved words in Java.

    --
    Lew
     
    Lew, Dec 12, 2007
    #11
  12. Atreju

    Lew Guest

    Atreju wrote:
    > On Wed, 12 Dec 2007 10:23:09 -0500, Lew <> wrote:
    >
    >> Patricia Shanahan wrote:
    >>> If you are used to a language in which identifier capitalization is not
    >>> significant you may benefit from an IDE that will mark undefined
    >>> identifiers and offer corrections. I suggest Eclipse.

    >> NetBeans is a suitable alternative.

    >
    > Yea the book came with Netbeans and I already installed Eclipse so
    > I'll play with both. Do these do what I'm referring to?


    I'm not sure. What exactly are you referring to? Neither IDE can mark as an
    error something that is not an error.

    > Despite what many have suggested, that myFunction and MyFuntioN are
    > two distinct things, I cannot imagine anyone wanting to use them
    > differently within any project... it makes for some serious confusion


    Not the compiler's problem.

    > not to mention not very good in terms of re-usability and clarity to
    > other developers looking at the code. I would think that even though
    > some conventions may be legitimate, any responsible developer would
    > avoid such things... I am only an amateur but one of the most
    > fundamental tenets I stick to is the code should be as consistent and
    > distinct and readable as possible. I realize what is being pointed out
    > is that the editor should not presume anything, but an IDE I hope
    > would recognize once a variable or a function has been declared and
    > then henceforth correct spelling to match it. Even, perhaps, as a
    > user-defined preference that it should do this.


    Also not the IDE's job. Its job is to enforce correctness, not style, for the
    most part.

    > Thanks for the advice all - I had a sneaking suspicion that what I
    > really needed was a full IDE not just an editor. I had been advised to
    > keep it very very simple at first and start just with text editors,
    > but I'm so used to being spoiled by an IDE that I guess maybe I should
    > dive right in and just ignore anything I don't need to know yet.


    IDEs aren't going to flag as wrong what is not wrong.

    --
    Lew
     
    Lew, Dec 12, 2007
    #12
  13. Thomas Kellerer, Dec 12, 2007
    #13
  14. Atreju

    Atreju Guest

    On Wed, 12 Dec 2007 11:27:17 -0500, Lew <> wrote:

    >
    >IDEs aren't going to flag as wrong what is not wrong.


    I'll give you an example, and I know that to compare VB to Java is
    likely to make some if not most readers of this post want to reach for
    the Maalox, just hear me out.

    What I'm looking for, it is possible that it doesn't exist, and this
    could be because the java community does not want to baby down
    anything but quite frankly, anything that makes my life easier is
    good.

    Let me give you an example of the way VB's "IntelliSense" works and
    this is why I don't think it's such a horrific thing:

    First of all, suggestions popup which is very useful since you can use
    them or just ignore them:

    Let's say I start typing dim strMyString as st
    Once I start the word that follows "as" the IDE knows I'm declaring a
    variable and it starts auto-suggesting things as I type. This may not
    seem too amazingly useful to very seasoned developers, but let's say I
    have defined a Type called "CustomizedRoundButton"

    Let's say I want to declare a new one. It is a pain to type it all out
    every time I'd want to do that, and once that Type has been defined
    anywhere within the project, VB will use the intellisense as such:

    I type "Dim myButton as cus
    at this point, the intellisense is already suggesting filtered
    possibilities, and my Type will be one of the few or even only one
    available. I can then just hit enter or tab, and it fills in for me.

    Now, the aforementioned is more of a luxury than a correction feature.
    But in the example that I gave where my statement in java was:

    String strStatus;

    Let's say I had not capitalized "string"

    string strStatus;

    Would it not be sensible for the IDE to not only realize that there's
    a syntax error here (which it does! it flags it in the gutter and also
    redline's the word), but also popup with suggestions, probably the
    foremost being "String"

    It's possible what I'm really getting at here is more of a "I'd like
    to see this feature" rather than a "why doesn't this happen?"

    Just my thoughts on the matter, and I welcome comments/corrections
    etc.

    Dan

    PS - Eclipse does something similar but it takes like 5
    keystrokes/mouse-clicks to finally get to "choose" what it should
    replace with!

    However, all this having been said, I _WILL_ start diciplining myself
    to use the proper convention, it is only that I never had to due to
    VB's hand-holding. Whatever some people may say about VB, the IDE's
    intellisense and its intuitiveness is extremely useful, and aside from
    a staunch purist perspective, I can't see how anyone wouldn't want
    that kind of functionality. You can turn it off if you don't want it.

    Maybe this will be refined in future versions of java IDEs.
     
    Atreju, Dec 12, 2007
    #14
  15. Atreju wrote:
    ....
    > Despite what many have suggested, that myFunction and MyFuntioN are
    > two distinct things, I cannot imagine anyone wanting to use them
    > differently within any project... it makes for some serious confusion
    > not to mention not very good in terms of re-usability and clarity to
    > other developers looking at the code.

    ....

    You will not get comfortable in a case-significant language until you
    get used to thinking of them as distinct things. For example, I've seen
    case used to distinguish between a constructor parameter and a field
    that will remember it.

    Patricia
     
    Patricia Shanahan, Dec 12, 2007
    #15
  16. On 12.12.2007 17:03, Atreju allegedly wrote:
    > On Wed, 12 Dec 2007 10:23:09 -0500, Lew <> wrote:
    >
    > Despite what many have suggested, that myFunction and MyFuntioN are
    > two distinct things, I cannot imagine anyone wanting to use them
    > differently within any project... it makes for some serious confusion
    > not to mention not very good in terms of re-usability and clarity to
    > other developers looking at the code. I would think that even though
    > some conventions may be legitimate, any responsible developer would
    > avoid such things... I am only an amateur but one of the most
    > fundamental tenets I stick to is the code should be as consistent and
    > distinct and readable as possible.


    Java's case-sensitiveness forces you to write a given identifier every
    time in the same manner. Don't you think that improves clarity and
    readability? Note: in VB, it's your editor (a /specific/ editor) which
    enforced consistency for your identifier's spelling. Not the language.

    I have, sigh, been forced (well, kinda) to write VB.NET just recently.
    It has been pissing me off in some ways, but the single thing which made
    me really despise it was its case-INsensitivity, among other reasons
    because it restricted my choices of identifiers -- what with its load of
    keywords.

    As for you being spoiled: I'd rather use the term "ruined". With all due
    respect.

    In the course of my .NET excursion, I've had to train a few apprentices.
    The first thing I usually get irritated about is their lax handling of
    character case. My advice is this: regardless of whether the piece of
    software you're using allows you to trade an 'a' for an 'A' (a very
    wide-spread phenomenon in the Microsoft world), *ALWAYS* mind the case.

    This isn't the pathetic ranting of a pricky old geezer, for I'm not old.
    It's about the, IMO, single most important trait of a programmer:
    discipline. And discipline in programming is an all-or-nothing trade.
    Minding case and similar "small" things might yield direct benefits --
    but possibly only so much and those benefits might be got otherwise, as
    with your editor enforcing your spelling's consistency. What's most
    important with these things is the /attitude/ they help you develop (or
    rather, admittedly: impose on you). Although it is only natural for
    coertion to be percieved negatively by its object(s), in this case and
    in the end it's a Good Thing (TM), IMO.

    df.
     
    Daniele Futtorovic, Dec 12, 2007
    #16
  17. Atreju wrote:
    > However, the text editor it comes with is buggy (for example, doesn't
    > colorize syntax until file is saved) and doesn't really do what I
    > need, and I'm wondering if anyone knows of any java-aware freeware
    > editors that do what i need:


    A small suite of editors:
    * vim -- with knowledge and utilization of some helper external programs
    (like exuberant-ctags), this is a very powerful tool.
    * emacs -- I've never used it; I'm just putting it in here to straddle
    both sides of the emacs/vim editor wars
    * NetBeans \ The standard Java editors. I myself can't recommend one
    * Eclipse / of these over the other one.
    * JBuilder -- I used to use this heavily, but I have grown less fond of
    it, probably due to my increasing desire for handling the command-line
    part myself.
    * jEdit -- My editor of choice on Windows computers, this program seems
    to go through active and dead development periods. Crappy without
    installing many of the plugins: Console and ErrorList are necessary.

    --
    Beware of bugs in the above code; I have only proved it correct, not
    tried it. -- Donald E. Knuth
     
    Joshua Cranmer, Dec 12, 2007
    #17
  18. Daniele Futtorovic wrote:
    > On 12.12.2007 17:03, Atreju allegedly wrote:
    >> On Wed, 12 Dec 2007 10:23:09 -0500, Lew <> wrote:
    >>
    >> Despite what many have suggested, that myFunction and MyFuntioN are
    >> two distinct things, I cannot imagine anyone wanting to use them
    >> differently within any project... it makes for some serious confusion
    >> not to mention not very good in terms of re-usability and clarity to
    >> other developers looking at the code. I would think that even though
    >> some conventions may be legitimate, any responsible developer would
    >> avoid such things... I am only an amateur but one of the most
    >> fundamental tenets I stick to is the code should be as consistent and
    >> distinct and readable as possible.

    >
    > Java's case-sensitiveness forces you to write a given identifier every
    > time in the same manner. Don't you think that improves clarity and
    > readability? Note: in VB, it's your editor (a /specific/ editor) which
    > enforced consistency for your identifier's spelling. Not the language.


    I disagree with this. In English, capitalization of a word can change
    depending on its context, without changing the meaning. I'll capitalize
    a word in a title that I would not capitalize in the middle of a normal
    sentence. I don't think that makes English writers sloppy - it just
    means capitalization does not have much to do with word meaning in that
    language.

    I don't have a strong view about which is better for programming
    languages, case sensitive or case insensitive. Either works well.

    What matters is for the programmer to match thinking and attitude to the
    language - and that applies to a lot more than case sensitivity.

    If you are programming in a case sensitive language, it is important to
    really see "String" and "string" as different words, even though they
    would be the same word in English or in any case-insensitive programming
    language. Equally, if you are programming in a case-insensitive
    language, you need to see them as the same word.

    > This isn't the pathetic ranting of a pricky old geezer, for I'm not old.
    > It's about the, IMO, single most important trait of a programmer:
    > discipline.


    On the other hand, this really is the pathetic ranting of a pricky old
    geezeress? geezerette? she-geezer? (What is the female of "geezer"
    anyway?). IMO, the most important trait of a programmer is mental
    flexibility, including the ability to adjust thinking to fit the problem
    and programming language. It is important to be disciplined about the
    things that matter in the current context, and a waste of time and
    effort to be unnecessarily precise about things that don't matter.

    Patricia
     
    Patricia Shanahan, Dec 12, 2007
    #18
  19. Atreju

    Mark Space Guest

    Atreju wrote:

    > Let's say I start typing dim strMyString as st
    > Once I start the word that follows "as" the IDE knows I'm declaring a
    > variable and it starts auto-suggesting things as I type. This may not


    NetBeans already does this, at least to a degree. As long as you get
    the first couple of characters correct (capitalization counts), NetBeans
    will pop up a suggested list of identifiers, with the first ones being
    most likely. You can press Control-Space to force this behavior if it
    hasn't kicked in yet (maybe NetBeans thinks there are too many
    identifiers still that match).

    You can also press Control-K to match variable names that are in scope.
    This is a great why to copy parameters name from the argument list of
    a method.


    > Let's say I had not capitalized "string"
    >
    > string strStatus;
    >
    > Would it not be sensible for the IDE to not only realize that there's
    > a syntax error here (which it does! it flags it in the gutter and also
    > redline's the word), but also popup with suggestions, probably the
    > foremost being "String"


    I don't think that NetBeans will suggest that string be String here. It
    will recognize that there is (most likely) a syntax error here and put a
    red line under string, but you'll have to get the first few characters
    of String correct then hit Control-Space to get a completion.

    It's actually not too bad of an idea however. Most Java programmers
    just get used to case correctness I guess. I don't mind it. Still some
    basic "word processor spelling checker" features like spotting incorrect
    capitalization and transposed characters might not be a bad addition to
    the editor.

    Hmmm.....
     
    Mark Space, Dec 12, 2007
    #19
  20. Atreju

    Lew Guest

    Patricia Shanahan wrote:
    > Atreju wrote:
    > ....
    >> Despite what many have suggested, that myFunction and MyFuntioN are
    >> two distinct things, I cannot imagine anyone wanting to use them
    >> differently within any project... it makes for some serious confusion
    >> not to mention not very good in terms of re-usability and clarity to
    >> other developers looking at the code.

    > ....
    >
    > You will not get comfortable in a case-significant language until you
    > get used to thinking of them as distinct things. For example, I've seen
    > case used to distinguish between a constructor parameter and a field
    > that will remember it.


    Having the IDE substitute "String" for "string" is as bad as having it
    substitute "Integer" for "string".

    --
    Lew
     
    Lew, Dec 13, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Kish
    Replies:
    4
    Views:
    7,558
    Ant...
    Oct 28, 2003
  2. Stylus Studio
    Replies:
    0
    Views:
    770
    Stylus Studio
    Aug 3, 2004
  3. MS
    Replies:
    0
    Views:
    465
  4. Alont
    Replies:
    7
    Views:
    148
    Alont
    May 4, 2004
  5. Jeff Kish

    recommend freeware jsp editor

    Jeff Kish, Oct 23, 2003, in forum: Javascript
    Replies:
    3
    Views:
    166
Loading...

Share This Page