Free Code Editor Suggestion


#1

Hey, People,

Any suggestions for a code editor that

  1. Is Free
  2. Allows for simple text formatting, especially permanent (i.e., persistent, or saves the) highlighting of text
    3 ) Saves text formatting in such a way that can be opened up in other text editors or whole IDEs without fuss (namely, formatting issues)

?*

Much obliged!!

(Notepad++ is driving me crazy with its many preset choices and limited customization functionalities, but I understand that that’s due to not supporting rich text formatting so as to be compatible with other programs so I was wondering whether there was a [free] code editor that allows for simple rich text formatting type of customization [I say “simple” because all I really want is to be able to highlight text and select the color of the highlight!] without presenting problems when the file is opened up in other applications.)

[*] I don’t know why the Discourse forum system software is misformatting my text!


#2

Atom is a good open source free general purpose text-editor with good package support

point 3 is mostly down to setting the editor to use soft-tabs, this generally works better across multiple editors/IDE’s.


#3

So “Atom” satisfies all three? Sounds like a bit of a hedge there about my Point Three…I don’t care if my highlighting in Atom is only displayed as highlighting in Atom but is simply plain text in, say, Notepad++…as long as the file itself opens up fine in other software but my highlights are displayed in Atom, I’m happy!

I’ll look into this, then…thanks!


#4

not if you use hard tabs, no. But these are editor settings. Understanding the difference between hard tabs and soft tabs might also better help you understand the issue. Maybe interesting to do some reading in that matter?

haven’t used atom in a while, atom should automatically detect the file type and set highlighting accordingly, if not (very unlikely), you can do it “manually” with the command pallet.

but syntax highlight is so standard across different editors (VScode, sublime-text to name a few)


#5

Hey, thanks for the suggestion…I’m trying Atom right now but it’s even less intuitive than Notepad++!!*

So I guess I’ll have to revise my requirements:**

  1. Is Free
  2. Allows for simple text formatting, especially permanent (i.e., persistent, or saves the) highlighting of text
    3 ) Saves text formatting in such a way that can be opened up in other text editors or whole IDEs without fuss (namely, formatting issues)
  1. Is “Intuitive” (namely, to change text styling [such as the persistent highlighting I’m really looking for] is readily apparent and not buried somewhere)

Thanks for all suggestions!!

[*] Don’t readily see where I would set styles, particularly the persistent highlighting I’m after…plus it seems slow and only opens up individual files as a part of a “Project” that opens up in a different window!!

[**] Apologies again for the formatting…don’t know why Discourse is doing this!!!


#6

define persisting highlight? Can you show what you mean?

here are the most prefered editors of the stackoverflow 2017:

https://insights.stackoverflow.com/survey/2017#most-loved-dreaded-and-wanted

visual studio is a massive IDE, if you think atom is slow, don’t try Visual Studio

Some of the top 5 must suit you? It can’t be you don’t like the entire top 5


#7

I just mean that I can highlight text – as in Microsoft Word, for example, when you highlight a line of text in yellow…I added the adjective “persistent” since when googling I kept getting irrelevant stuff about changing the color of highlighted text in Notepad++ but I need the highlight to save (“persist”) when I save the file! Then I read that this common functionality isn’t available in Notepad++ so as to keep files perfectly compatible across all applications (since they’re just plain text files)…

LOL – I knew something was up when it took several hours to download!

Yeah I’ve actually got it installed on my machine but it’s too complicated for me…still, I hope to learn it one day since it’s apparently the most popular in all the world and thus something a professional programmer should know how to use (once I become one)!

BTW, thanks for your list…I will take a look!


#8

I don’t think you will find an editor which support this out of the box, and it won’t persist over multiple editors given this would have to be configured per editor. Its not a standard feature.

atom has packages which seem to do roughly what you want:

https://atom.io/packages/pigments

but yea, its not easy. But i don’t think what you want will be easy.

editors are complicated things, you need time to learn to handle them. Persist to reach your goal, otherwise you won’t get there

of course, atom allows you to build your own packages, so you could build your own. Could be a fun project


#9

Yeah, I’m SOOOOOOO surprised!!!

Like, I thought people were supposed to thoroughly comment their code??? (And yes, I know that code comments are supposed to explain “the why,” not “the how!”) And it just seemed helpful to me to be able to judiciously highlight certain parts of certain comments…

I ain’t the only one, either, as while googling I’ve found that it’s an oft-requested feature year after year!

Sigh…I know, maybe one day I’m program it myself… o_0

Thanks for all your insight, though! I don’t know why editors need to be so complicated…maybe for fun one day after learning C++ I’ll code a specifically beginner’s commonsense code editor! :smiley:


#10

i would just write a better comment. The problem is that the highlighter is only for you, unless all your colleagues (in the future, at a job) agree to this standard of installing highlighter.

why shouldn’t comments explains the how? If you have to write an intricate piece of code, a how explanation would be nice (along a why explanation). Although, you should question then what to put in the comment and what to document:

https://www.quora.com/What-is-the-difference-between-documentation-and-commenting-while-programming


#11

No, here’s what I mean: there’re so many comments that highlighting text would make really important aspects stand out – especially when I’m searching for something visually, scrolling along (keyword-search is sometimes annoying to use – especially when I don’t remember the keyword[s]!)…as a beginner, I use comments like as notes-to-self and as you might imagine from my posts here, I like to go into details! So it would be very helpful for certain text to stand out in those comments (such as alternative code, code that I’ve considered but am not using, or code from others that does the same thing which I’ve thought to include as a part of my notes because they’re interesting for some reason or other).

Now see how nicely certain text stands out in that paragraph? If only I could do that in a simple (as in “intuitive”) free code editor!

Well, it’s a feature request that many have and, frankly, expect because it just seems so common-sensical, given the standardized way of working with text that we’re all familiar with from text editors (Windows Notepad excepted) and word processors. And of course if company policy forbids idiosyncratic styling I wouldn’t use highlighted text!

I’d read that somewhere, some styling guide or maybe just a blog post…I’ve always supposed that the idea’s that code comments should be fairly short and if it’s extensive it should belong in proper documentation (as in documents – document files – and not code comments)…I guess it’s to discourage rambling commentary!


#12

Our perspective differs here, as you continue programming, notes within code become less common. The way you read and understand code changes.

i don’t see it to become common among programmers. What is many? I think the amount of people wanting this feature is a minority

but working with text is very different from working with code. Just because something is common within a certain area (text files), means it fits well in another area (programming files, .py, .html and so forth)

programmers generally prefer logic variable names, comments and documentation.

Within the documentation, i can perfectly imaging colors but also headings (so you get sections) and bold text. But its not part of the code.


#13

Oh, surely – but even then, I can imagine wanting to highlight a particular part of my comments to make it stand out.

It may be a minority but could still be “many” – and it’s arguably the case that at any given moment, the majority of code editor users (especially of a seemingly “lightweight” program as famous as Notepad++ [even I’d heard of it way before this present coding journey of mine!]) are beginners, folks who see a code editor as an extension of a traditional text editor/word processor, with all the UI/UX expectations thereof.

Well, look: all code editors allow for saving files in the simple .txt format. Why is that? Because there are use-cases where people just wanna write something that’s not code!

And it doesn’t seem like such a crazy feature request. Like I said, it’s something that’s already been asked for – for years, literally. And it surely wouldn’t require incredible refactoring of core code; whatever’s responsible for all the other colors can just have one more variable or two that takes into account background colors that persist (i.e., word processor-style text hightlighting). I mean, they have italics, for chrissake! Who needs italics in a code editor??


#14

You can use something plain-text based, say like this: ***important comment stuff***. There are ways to draw attention to blocks of text without needing it to be a specific colour.

I don’t think the statement “I am using a code editor over an IDE, therefore I am a beginner programmer” holds true. If you need to make a quick and easy change to something that doesn’t require compiling, and thus doesn’t require an IDE, a code editor like Atom will load a heck of a lot quicker than the IDE most likely will. (A text editor even faster still.)

Also, “text editor” <> “word processor”, and a code editor is much closer to the former but with the added convenience of linting and maybe some autocomplete for bracket pairs.

Yes, and that would typically be something which doesn’t require elaborate formatting - like a gitignore file or a simple README. I doubt anyone would use a code editor, or their IDE, to generate documentation which is what you’re seemingly implying here. That’s what a word processor is for…

I tend to do most stuff in Atom, which does italicise certain content based on context - for example, if I’m coding in Python and I add a comment line, that’s shown in Atom in italics.

This, however, is because my Atom theme is configured to display Python comments that way. This relies on comments being a defined aspect of the language, that you can detect reliably and repeatedly, in order to apply the style. In this sense, to accomplish what you’re after, you’d need to extend the language (i.e. introduce a new feature) to include a notion of what we could call a “super comment” that can be appropriately styled in the editor…

I suspect that the reason the functionality you desire is not commonly implmented is because code editors, and by extension IDEs, exist to allow people to create and edit code. Code has to obey the rules of the language otherwise it doesn’t work. A word processor, or more accurately the content you put into a document created with a word processor, is not bound by any such requirements.


#15

It doesn’t really jump out at me, simply putting asterisks around some text, since everything’s grayed out or otherwise blends into the background…look here:

Now I’ve got lotsa files like that, since as a beginner I’m taking copious notes…now compare:

See how it stands out finally? (Pardon the bad Paint.NET editing job; my HDD crashed and I’ve just recently installed this new SSD and haven’t bothered to put Photoshop CS6 on it yet, with which program I’m exponentially much more familiar.) While scrolling, it just helps me to notice really important things – even more important than the other stuff which as comments are by definition important!

I just don’t see what’s the problem. :slight_smile:

Well, not in all cases, to be sure – but since the argument was that a majority of code editors don’t use it, it seems arguable that beginners would be more likely to use a code editor than an IDE…that’s really how I should have put it (apologies for the misleading parsing of my thoughts), and beginners would think more in word processor terms.

Besides, what exactly is the problem to have such functionality?? I’m genuinely puzzled by the resistance. A shrug I understand – but this seems like some real resistance here! LOL – I’m actually chuckling right now wondering just what everyone’s so afraid of, exactly!! :smiley:

You keep thinking in binary either/or terms and I can’t imagine why: so what if people want to highlight their code or comment?? I’m genuinely puzzled at what the harm is!

Wait a minute…aren’t all these colors, italics, etc., saved as a part of some “meta-data” that’s particular to the code editor – and thus don’t affect any compiler or interpreter’s work on the actual code??

'Cause you seem to think that color highlighting would be saved along with the code somehow! I doubt that’s how code editors currently work to display italics, colors, dotted/dashed vertical lines matching up pairs of parentheses, and other such graphics…I imagine this “metadata” is something the code editor keeps track of on its own, in its own program, instead of something that’s saved within the file of the code.


#16

Firstly, if you’re coding a snake game in JS, hats off to you. (I did the same thing, but in Python, when I wanted to mess around with Turtle graphics!)

I wouldn’t say resistance was quite the right word. More, perhaps, that we’re struggling to see the benefit of such a feature.

I’m not so much thinking in a “this or that” way, more that I’m simply expecting a given program to do it’s intended job. Code requires no formatting other than that mandated by the language syntax for it to do it’s job of talking to the computer, so the chosen editor (whether that’s something like Atom or an IDE like Visual Studio) needs to support no elaborate formatting for it to do it’s job of allowing you to create a program.

It is, in fact, completely possible to code a language like C++ or JavaScript in a text editor - which supports no formatting at all. (And, if you go to the right places where the old guard of programming hang out, they’ll tell you that’s the best way to do it!) The formatting that editors/IDEs like Atom and VS do is a convenience, to make it easier for you to write and understand the code; it’s not necessary at all.

I think we can get to the crux of the issue here.

You are, I think, misunderstanding how your code editor - in your case, in your screenshots, Notepad++ - is able to do the formatting it does on your code.

If we look at your screenshots, you can see in the bottom-left corner that Notepad++ knows you’re working on a JavaScript file - because the file extension is .js

Once it knows that you’re coding it, Notepad++ is able to understand the language and it then knows that function is a reserved word for defining a function; that if is a reserved word for conditional flow; and that // denotes a comment.

It is the fact that they are all well defined aspects of the language that allows Notepad++ to interpret your work and go “Oh, you’ve typed // - I’ll style that as grey italics because that’s clearly a comment!” or however you want it styled by changing the settings if your editor supports it.

By extension, then, if you wanted Notepad++ to recognise an “important comment” substring there would need to be a well defined method for indicating this which would require extending the language in some fashion.

The alternative, whereby you can manually select substrings within a comment and opt to highlight them, would require extending the editor so that it saved alongside your code some kind of markup indicating where you’ve highlighted text. Code is portable, so you can take any editor which understands JavaScript and open a JS file and your editor will parse it and apply your styles automatically. Your additional markup file would add complexity where it’s not necessarily needed, as well as possibly introducing compatibility issues - say if Visual Studio Code and Atom, for example, differed in how they implement the markup.

Do you see now why perhaps this is a feature that hasn’t been implemented?

After all is said and done, however, Atom is an extensible editor. As is Visual Studio Code. Both are written in Electron, which is JavaScript-based; so if this is a feature that you want badly enough, it’s certainly possible for you to create it and make it available. :slight_smile:


#17

Thanks for the encouragement – but that’s (hopefully) next month; right now, I’m merely on converting kebab-case input to snake_case input…that’s all! Simple lil’ thing and yet there are a whole bunch of ways to do it; that .js file contains seven or eight different approaches, many using .replace() in various ways but a few are just “low-tech” iterations! Haven’t seen anything recursive yet, though…

So you see, with all the notes I take, all the comments I make (yes they say you’re supposed to comment on “why” and not “how” but as a beginner I feel I must do both), it would be of benefit to highlight things, even the code itself!

Okay, sorry, not “resistance” – I didn’t mean that in a negative way or anything…funny how human psychology works: when something seems obvious to one, another not sharing the same mindset can appear to be obstinate! Again, not intending anything “negative” with that word, though yes, the connotations are negative – but I can’t think of a better, “softer,” word…other than “resistance!”

Now I did provide images so let’s get to those, then… :slight_smile:

Indeed – thanks for that dive into details. Yes, I did have a slightly different conception of what’s happening “under the hood” than what you’ve described – but only slightly, and I still think word-processor type of text highlighting can be achieved, only as “metadata” of some sort, as I say, that the code editor would recognize, of course, such metadata being something the code editor keeps track of in a kind of lookup-table of some kind somewhere, so that when it sees “file2345.js” it looks up the metadata info on it, that at Line 42 and beginning with Column 51 in the midst of a comment block The Great Question to the Ultimate Answer of Life, The Universe, and Everything has been highlighted…for example! :wink:

Yes, some kind of metadata…as mentioned previously, I hope to be proficient enough one day to cobble together a “beginner’s code editor” from open-source code that will provide for this. If nothing else, it’ll be a niffty feather in the cap, a nice résumé bullet point! (Maybe it wouldn’t make an impression in the tech world, but as a middle-aged student I’m prepared for teaching roles in school [what with the increasing emphasis on coding in public education – NYC’s current mayor has the goal of making computer programming a fundamental subject from pre-school onwards, just like readin’ and 'rithmetic!], I think that would look nice to prospective employers, never mind at least some of my fellow beginners!)

Well, actually, I wasn’t thinking of anything “really” attached to the file itself but rather to the code editor, mostly – maybe if “only” through plugins or extensions – somehow keeping simple track of which specific files require what specific visuals.

So yes, markup of some kind, but mostly out of the way, kept by the code editor itself somehow. Probably as an innocuous short line or two of comment referencing the code editor, with the first line in plain English with technical info ("// this line for visuals maintained by Ye Olde Beginners’ Code Editor; more info at SomeURL.org") and the second some short assembly-like data-dump.

What about mischievous people who would mess with those lines? Okay, maybe we’ll have to get a bit more involved with the file than that – as in cryptography, literally encoding the lines to be even more innocuous, appearing as “organic” comments on the code! So instead of a line of officialese with a second of assembly language looking content, it’s all encoded to appear like natural-langue comments: “start tertiary level of view control” which is really code, to be unscrambled by the code editor when opening the file, as “highlight this area of the screen!”

What if the file names change? Well, that’s why those comments would help – the program matches file names with the metadata, deferring to the metadata in case of conflict. Remember, 99.99% of this metadata resides with the code editor; these comment lines are just short camouflaged “triggers” that identify the file to the code editor, which will then apply the visuals associated with that ID when the file is opened in it.

Not really! Like I was saying, all this metadata could be inserted as simple code comments in their own right. I mean, sure, any “complexity” would be on the part of the code editor that can actually use those comments, but otherwise it would just be a comment like any other. Heck, if I ever make such a program, I’ll name some of its variables, codes, or workflows “the pitycoder” and “stetim94”…!! Like the “‘thepitycoder’ module” will handle markup… :wink: