LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

View Poll Results: Do you use the GUI or a VT to write source code?
I use a GUI. 18 58.06%
I use a VT. 13 41.94%
Voters: 31. You may not vote on this poll

Reply
 
Search this Thread
Old 08-12-2011, 01:54 PM   #16
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713

I tried proportional fonts for programming, and maybe they are more readable, but the fact that it's not like a 2D grid any more just has too many disadvantages. For example, here are some things that I do often in my code that aren't possible (or look really ugly) with proportional fonts:

Headers like this can't be made all the same length:

Code:
// Example ////////////////////////////////////////////
You can't neatly align long function parameters on multiple lines, like this:

Code:
someFunction(reallyLongParameter,
             example,
             test);
And you can't align comments that are to the right of your code, like this:

Code:
i=0;                   // counter variable
for (i=0; i<10; i++) { // iterate from 0 to 9 (inclusive)
    printf("%i\n");    // print the counter's value
}
And finally, Vim (the editor I use most of the time for programming) doesn't support proportional fonts.
 
3 members found this post helpful.
Old 08-12-2011, 02:12 PM   #17
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by MTK358 View Post
I tried proportional fonts for programming, and maybe they are more readable, but the fact that it's not like a 2D grid any more just has too many disadvantages. For example, here are some things that I do often in my code that aren't possible (or look really ugly) with proportional fonts:

Headers like this can't be made all the same length:

Code:
// Example ////////////////////////////////////////////
You can't neatly align long function parameters on multiple lines, like this:

Code:
someFunction(reallyLongParameter,
             example,
             test);
And you can't align comments that are to the right of your code, like this:

Code:
i=0;                   // counter variable
for (i=0; i<10; i++) { // iterate from 0 to 9 (inclusive)
    printf("%i\n");    // print the counter's value
}
Can be easily done, you need IDE with elastic tabs support. See attachment. The only "trick" is to use tabs instead of spaces for idents.

Quote:
Originally Posted by MTK358 View Post
And finally, Vim (the editor I use most of the time for programming) doesn't support proportional fonts.
Are you certain? I vaguely recall launching either gvim or xemacs with proportional font support few years ago on linux.
Attached Images
File Type: png 5.png (2.5 KB, 18 views)
 
Old 08-12-2011, 02:37 PM   #18
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Quote:
Originally Posted by SigTerm View Post
Can be easily done, you need IDE with elastic tabs support. See attachment. The only "trick" is to use tabs instead of spaces for idents.
Can Vim support elastic tabstops?

Quote:
Originally Posted by SigTerm View Post
Are you certain? I vaguely recall launching either gvim or xemacs with proportional font support few years ago on linux.
I attached a screenshot of GVim with the font set to DejaVu Serif. It still treats the characters as if they have the same width.
Attached Images
File Type: jpeg gvim-proportional-font.jpeg (17.4 KB, 15 views)
 
Old 08-12-2011, 02:54 PM   #19
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by MTK358 View Post
Can Vim support elastic tabstops?
Well, even if it doesn't support them, you could probably hack it to add support (the difficulty is hard to estimate, though - I haven't read vim's source). I don't use gvim for development (only for emergency situations), and I don't see the reason to use only vim for development.

Quote:
Originally Posted by MTK358 View Post
I attached a screenshot of GVim with the font set to DejaVu Serif. It still treats the characters as if they have the same width.
Then I guess it was XEmacs.
 
Old 08-12-2011, 03:44 PM   #20
jcmlq
Member
 
Registered: Aug 2009
Posts: 32

Rep: Reputation: 19
Am I still considered a gui user if I mostly use the gui as a place to keep 4 or 5 urxvts running screen in order to use vim and shell tools?
 
Old 08-12-2011, 04:35 PM   #21
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Am I still considered a gui user if I mostly use the gui as a place to keep 4 or 5 urxvts running screen in order to use vim and shell tools?
You make it sound like something to be ashamed of. It isn't. Those things are made for a purpose.

--- rod.
 
1 members found this post helpful.
Old 08-12-2011, 05:05 PM   #22
jcmlq
Member
 
Registered: Aug 2009
Posts: 32

Rep: Reputation: 19
Quote:
Originally Posted by theNbomr View Post
You make it sound like something to be ashamed of. It isn't. Those things are made for a purpose.
Yeah, I just find it funny that the latest and greatest tech seems to serve best by being used as a platform for technology that's older than dirt.
 
Old 08-12-2011, 05:27 PM   #23
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
It's all chill, chaps, Sigterm's entitled to his curt but clear replies to my statements as much as I was entitled to make them in the first place.

He's clearly blind and wrong, but entitled to his opinion
Actually, not joking 100%, dude what is that font, how can we talk about any readability when you're suffering that utter lack of anti-aliasing/sub-pixel rendering?!

As for verbose naming schemes, we can be verbose in any font so you seem to be confusing the issue by mentioning separaters like _, and I'm not sure I agree with your logic. I'd assume my brain would be tuned to best pick up these natural words when they're correctly separated in normal prose, rather than run together lines of characters. Therefore, I don't think it would be any easier to read concatenated words (assuming no separators) if they could have varying minor spacing around/between them, rather than having a consistant pixel position for their ends as with a monospaced font. As with that trick of shuffling a word's inner characters, leaving only the first and last ones unchanged, and the word still being almost as readable, if you remove the end hints, you brain surely has far more permutations to search/match.

Perhaps a bad example:
togetherthereherheretheirtogather
togetherthereherheretheirtogather

I have written some C++, and use similarly-styled imperative languages (Java, C#, PHP, JS, etc), but also done functional programming like Haskell, and fear how one of the most fun languages, Python, would appear without monospaced fonts. Perhaps not an issue, but I don't think I'm about to try it.

Would proportional fonts really interfere with e.g. 4space tabs aligning things? Because that does sound 'game-breaking' for programming.
I seemed to have missed you clarifying in post 17 that it would not, unless I'm mistaken.

Block selection/edit mode is beast when you need it.

konsolebox, you know Notepad++ is Scintilla-based, and that there are cross-platform varients so that you don't need Wine, right?

Last edited by Proud; 08-12-2011 at 05:41 PM.
 
Old 08-12-2011, 06:16 PM   #24
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
I voted GUI, since Geany is my main editor/IDE for what little tinkering I do (though I compile in a separate X terminal), but I occasionally use nano for quick editing.

I can use vi(m), but I don't really know all the ins and outs of it; all I really know are the basic line/word manipulation comands (d(n)w, dd, p), and (w)q(!).

Yes, I'm an editor weenie.

Last edited by MrCode; 08-12-2011 at 06:19 PM.
 
Old 08-12-2011, 07:01 PM   #25
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by Proud View Post
Actually, not joking 100%, dude what is that font, how can we talk about any readability when you're suffering that utter lack of anti-aliasing/sub-pixel rendering?!
That's matter of taste. I HATE font antialiasing - it nearly makes me feel nauseous, so I prefer fonts to be crisp.

Quote:
Originally Posted by Proud View Post
if you remove the end hints, you brain surely has far more permutations to search/match.
Not exactly. I use "camelCase", so in addition to end hints, capital letters signal beginning of a new word. (CapitalLettersSignalBeginningOfANewWord). Certain letters "stick out"(f,p,h,l,y,q,i) or form recognizeable character combinations combinations that are easy to pinpoint.

Quote:
Originally Posted by Proud View Post
Perhaps a bad example:
togetherthereherheretheirtogather
togetherthereherheretheirtogather
IMO, even in this example, monospaced font is harder to read. In proprtional-font example "th" and "h" provide a visual cues that allows you to quickly break down this mess into words. Those cues are much harder to notice with fixed-width font which turns everything into letter soup, plus entire word is longer, so I see less letters per block of pixels.

Quote:
Originally Posted by Proud View Post
I have written some C++,
I'm not sure that I should discuss usage of proportional fonts in C++ with you. C++ is NOT java, C#, PHP, or JS.

Quote:
Originally Posted by Proud View Post
Would proportional fonts really interfere with e.g. 4space tabs aligning things? Because that does sound 'game-breaking' for programming.
I seemed to have missed you clarifying in post 17 that it would not, unless I'm mistaken.
Not sure if I understand you. With proportional font it is recommended to use IDE/editor that supports "elastic tabs". "Elastic tab" means that instead of inserting 4 spaces, tab character moves "cursor" to a next tabstop ("column"). Each tabstop is located at fixed interval from the left side of text field (roughly at 4 spaces, 8 spaces, 12 spaces from the left etc). In case of proportional fonts, you'll never use more than one space, but you'll use a lot of tabs when you need to align things. You can work without elastic tabs, but you won't be able to align text/tables as with MTK358's example.

Quote:
Originally Posted by Proud View Post
Block selection/edit mode is beast when you need it.
I needed block selection (rectangular selection) 2 or 3 times in my entire life, and in all those cases problem wasn't related to programming. Not sure what kind of C++ program would need block selection. "Search/replace within selection" using regular expressions should always work better than that. Block selection is useful only for grids. Program text is not a 2D grid, it is a list of lines of variable length.
 
Old 08-12-2011, 07:02 PM   #26
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
I voted CLI (vim, w/ syntax highlighting, code-completion suggestions,
in-line help support and all that goodness).
 
Old 08-12-2011, 07:38 PM   #27
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
@Proud: You mean other software that's based from Scintilla? I haven't known any good alternative to Notepad++ so far. At least it should be able to provide syntax highlighting and is able to use themes. For other features I think at least it includes a vertical bar, wrapping/unwrapping with custom columns, trimming of trailing spaces, imaginary markers (the mirrored P-like thing) and searching and replacing with regular expressions. The search mechanism of Notepad++ is also very useful i.e. find/replace all in all opened files/current document/directory. Not mentioning EOL conversions and switching of encoding formats like ANSI, UTF*, and other character sets like Shift-JIS

I also thought about possibility of having Notepad++ directly built in Linux if Scintilla was portable but I've thought about the many features of it and its dependent implementation with DOS paths instead of UNIX paths. There are also plugins in it that's very usable to me in which I doubt is usable in Linux (AFAIK they could be DLLs only) e.g. Light Explorer (finds it better than the newer Notepad++ Explorer) which could only traverse DOS paths.

When Notepad++ was starting to get popular with Linux-Windows users, I also thought about trying to port the application to Linux sometime but I haven't had the chance, time or motivation. I also thought that someone will really make a port of it (esp. the developer) out of many requests but no one did.
 
Old 08-12-2011, 07:50 PM   #28
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Quote:
Originally Posted by konsolebox View Post
At least it should be able to provide syntax highlighting and is able to use themes. For other features I think at least it includes a vertical bar, wrapping/unwrapping with custom columns, trimming of trailing spaces, imaginary markers (the mirrored P-like thing) and searching and replacing with regular expressions. The search mechanism of Notepad++ is also very useful i.e. find/replace all in all opened files/current document/directory. Not mentioning EOL conversions and switching of encoding formats like ANSI, UTF*, and other character sets like Shift-JIS
Except for "vertical bar" and "imaginary markers" (since I have no idea what they mean), Vim can do all that as far as I know.

Last edited by MTK358; 08-12-2011 at 07:52 PM.
 
Old 08-12-2011, 07:58 PM   #29
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by konsolebox
imaginary markers (the mirrored P-like thing)
The pilcrow sign ()?
 
Old 08-12-2011, 08:05 PM   #30
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
@MTK358: yeah it sure does vertical bar is just a blue/cyan imaginary line on the right side of the document that marks the end of the custom number of columns. I always use 72 for that. For the imaginary markers I mean these (see attached file)

@MrCode yes that one lol
Attached Images
File Type: jpg markers.JPG (7.7 KB, 9 views)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing GUI front-ends: what language + what GUI library? pear Programming 7 07-07-2008 08:17 AM
LXer: Code Craft: The Practice of Writing Excellent Code LXer Syndicated Linux News 0 01-09-2007 04:03 AM
Is it possible to use a GUI to compile new software (Source code)? narayanaras Linux - Newbie 10 12-18-2006 09:02 PM
LXer: Democratization, Writing and Writing Code LXer Syndicated Linux News 0 11-22-2006 05:03 AM
C Source Code browsers with GUI support RohanShrivastav Linux - Software 1 02-17-2005 09:30 PM


All times are GMT -5. The time now is 01:56 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration