LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Writing source code: VT or GUI? (http://www.linuxquestions.org/questions/programming-9/writing-source-code-vt-or-gui-896960/)

stf92 08-12-2011 08:23 AM

Writing source code: VT or GUI?
 
Hi:

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.

theNbomr 08-12-2011 08:44 AM

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.

sycamorex 08-12-2011 08:49 AM

I use terminal (sakura) on i3 (GUI). Mostly I use Emacs or Vim.

TobiSGD 08-12-2011 08:49 AM

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.

Proud 08-12-2011 09:51 AM

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.

stf92 08-12-2011 10:11 AM

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.

Proud 08-12-2011 11:18 AM

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

SigTerm 08-12-2011 11:28 AM

Quote:

Originally Posted by stf92 (Post 4440833)
Hi:

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.

Proud 08-12-2011 12:19 PM

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.

stf92 08-12-2011 12:52 PM

I know this is not very constructive, but I'm a 100% with Proud.

SigTerm 08-12-2011 12:59 PM

3 Attachment(s)
Quote:

Originally Posted by Proud (Post 4441058)
I seriously can't comprehend not using monospaced font.

That's not my problem. Are you a C++ programmer?

Quote:

Originally Posted by Proud (Post 4441058)
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 (Post 4441058)
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 (Post 4441058)
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).

TobiSGD 08-12-2011 01:07 PM

@SigTerm: I wonder why you are so offended of Proud's opinion.
Quote:

That's not my problem.
He never said that.
Quote:

Look, I'm not forcing you to switch to variable-width font at the gunpoint
He never said that.
Quote:

if you're trying to change my preferences
He also never said that.

Keep calm man, this is a poll, the OP asked for opinions. No one wants to change your type of programming.

SigTerm 08-12-2011 01:14 PM

Quote:

Originally Posted by TobiSGD (Post 4441105)
@SigTerm: I wonder why you are so offended of Proud's opinion.

I did not intend to sound offended (miscommunication?). I explained my position, that should be sufficient.

konsolebox 08-12-2011 01:25 PM

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.

theNbomr 08-12-2011 01:32 PM

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.

--- rod.


All times are GMT -5. The time now is 04:42 AM.