ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: Do you use the GUI or a VT to write source code?
I'd like to know what you, programmers, use the most when writing source code: the virtual consoles (VTs) or the GUI. For example, if you use Vim, you can either run it in a VT or in the GUI. Or may be you prefer using an IDE, which would mean you are in the GUI.
Click here to see the post LQ members have rated as the most helpful post in this thread.
As in most questions, the answer is 'it depends'. If the file is on a local disk, I will usually use a GUI editor, such as nedit. But if it is just a small file on which I want to make a quick change, I will use vi. If the file is on a remote host, and if I have a fast network connection, I will often use a GUI editor, if there is one. If the network is slower, I will usually use vi. I almost never use an IDE, although I've tried to convince myself that Eclipse can be worthwhile.
Your poll doesn't have a choice of 'Both'.
--- rod.
I almost every time use vim on CLI, although I also have GVim installed. No need for an IDE here. I program really seldom, and if so I only write small scripts in zsh or Python.
Personally, language-specific syntax colouring/highlighting is really nice, and second most desired is definition collapsing. Beyond that I like to keep things to the basic text editor + webpage documentation open, rather than depend on autocompletion, refactoring, immediate compilation error detection etc. Not that those don't probably save a surprising amount of time for a larger piece of work. I'm plenty happy using the command line, but won't abandon GUI stuff if I don't have to and it'll obviously make things easier. So if I have X/Windows in front (and no struggle to run Eclipse) yeah I might favour an IDE, or at least KWrite/Notepad++, and yet still config and build things rather manually.
I personally prefer using Vim, or for that matter any other text editor, in the text console (VT). And the reason is this: I began programming when GUIs did not exist. And maybe because of this that the chars generated by the ROM character generator seem to me more legible than those "drawn" by the graphics card. Among other reasons, there are these:
1) The GUI uses equispacing (tries to equalize the space between chars). But this certainly works very bad. Not at all like the work of a printer.
2) With the not confessed purpose of making the GUI look like a book, it uses black foreground on white background. This is harmful to the eye and, in the long run, causes fatigue. It's like steadily watching a 40w light bulb at a distance of 0.50m. When you see a movie, why do you think the credits are white on black? True, you can invert the colors. But then the legibility decreases.
Of course, to sense the difference between the two scenarios, you should be over 40.
Most editors I know of offer a suite of monospaced fonts and also themes/colour palettes/schemes to cater to both of your concerns. E.g. I think Zenburn is popular beyond VIM. http://slinky.imukuppi.org/zenburn/zenburn.png
I'd like to know what you, programmers, use the most when writing source code: the virtual consoles (VTs) or the GUI. For example, if you use Vim, you can either run it in a VT or in the GUI. Or may be you prefer using an IDE, which would mean you are in the GUI.
I use GUI text editors, because VT does not support proportional/variable-width fonts, and proportional/variable-width font make (C++) code more readable. Regardless, you should be able to program anywhere using whatever editor is available, and on unix-like platform it makes sense to know VI. Relying on single editor is not a good idea.
I seriously can't comprehend not using monospaced font. You say for readability, but you're not reading prose, you're interested in spotting typos, missing characters, differences between similar(even copy-pasted) lines.
A different font for comments/long strings is about the only place I can see this being reasonable.
I seriously can't comprehend not using monospaced font.
That's not my problem. Are you a C++ programmer?
Quote:
Originally Posted by Proud
You say for readability, but you're not reading prose,
There's a concept of literate programming, and recommendations to use long names for variables, classes and functions that would explain their purpose. Plus it was recommended by Stroustroup at one point.
Quote:
Originally Posted by Proud
you're interested in spotting typos, missing characters, differences between similar(even copy-pasted) lines.
I do not see how monospace font would make it easier. One letter difference will make entire word change its width (instantly noticeable), which is not the case with monospace font where you'll have to read entire line to find the problematic character. Punctuation is also instantly noticeable, and it allows longer lines. I don't need to read every letter to recognize identifier.
Quote:
Originally Posted by Proud
A different font for comments/long strings is about the only place I can see this being reasonable.
Look, I'm not forcing you to switch to variable-width font at the gunpoint, and if you're trying to change my preferences, that's not going to happen. If YOU don't like it, YOU don't use it. In my opinion, monospace font needlessly wastes screen space and is only useful for hexdumps/big horizontal tables (that can be frequently aligned with tabs even with variable-width font), it also makes code too "sparse" to read quickly. With variable-width font code provides a lot of visual cues (".:;()[]-<>*&^~=') that split wall of text into identifiers ("words"). Monospace makes everything look like a chessboard, which is confusing. Compare code with a book. Variable-width is more "book-like" so if you read a lot, that would make code easier to read (IMO).
I use Vim on terminals or consoles. I also use nano sometimes when I feel like it; mostly when I need to have a very quick edit of a configuration file. On GUIs I have Notepad++ as my favorite (runs also on linux with wine). I've been using the editor way back since 2005 or 2004 (versions 2.x). I mostly use KWrite when I want to open a file for quick viewing or editing (got really used typing kwrite *). Before I had Notepad++ stable with wine, I always used KWrite for GUI. Netbeans, on the other hand seems delicious to code with and Bluefish is a good alternative when editing webpages.
I prefer monospaced fonts as I like strict coding. I love keeping my codes clean and in uniform style (polished that is). Even having a slight extra trailing space (mostly left out by auto-indents) and wrong indents (like having spaces instead of tabs) makes it feel so unfinished to me. For scripts and codes that are meant to run on terminals, I don't mind working them with Vim (I do it on times when I feel like not wanting to separate my hand from the keyboard; using alt-tab is slow when you have lots of windows that are already open) but I always finish them with Notepad++.
Zenburn is my favorite theme also but I sometimes use the default theme as well.
I don't use /usr/bin/write so I changed it to a script that accepts arguments and runs Notepad++ instead. That makes it easier for me to open files.
I frequently use 'block copy's, where the selection is by row & column. I cannot imagine how this would work if the character cells were different, and text did not always align on even vertical columns. Same or similar objection to alignment of outer levels of indented text that visually accent blocks of code.
No, thanks. I have no use for proportional fonts in a programmer's editor.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.