Re: How do old-school emacs/gcc/gdb hackers do their coding?
From: Eric Taylor (et1_at_rocketship1.com)
Date: Thu, 03 Mar 2005 10:06:31 -0800
Charles Fox wrote:
> I am newish to linux, having finally switched over from MS after about
> 4 years of using Visual Studio etc.
I've used Visual C/C++ version 6 now for quite some time. Yet, I have to
write portable code, that runs on windows, linux, solaris etc.
So, ... guess what, I use visual C and a little bit of conditional comp. For the
most part, I don't write gui stuff in C, so I choose the visual C console task with
no MS code. If I have something that is not portable between the two, then
I write a simulator. For example, I needed to develop a library of code that
had to use mmap. Well, in linux I just use mmap, but on windows, I had to
use (forget the names) something else. So, I wrote a procedure called mapfile
and used conditional comp. Now I have a portable (and somewhat easier to
use) way of mapping to files.
Or, I could have written a routine called mmap on windows, that used the
exact same calling sequence, and once this was shaken out on windows, there
was a very good chance that using the real thing on linux would simply work
first time. And all the code that used this mmap routine would probably be
already portable, so just developing on windows in vis C was enough.
I can then step through 99% of the code in vis C and so develop
in my usual style of write 10-15 lines of code and step it through method of
growing code. For the handfull of lines of code that only run on linux, well
I just do that brute force.
I also use winspc (freebie sftp) which can detect when a file is re-written and automatically
transfer it to a linux system. Then I would just use printf debugging for the 1%
of the code that was not portable. But I would still get to use all the MS code
writing tools, just not the debugger for this last step. But by then, printf would be
For gui, I dabbled with using tcl/tk combined with C code to build a portable
gui app. But lack of support for the wrapping tools led to some problems with
the newer releases of tcl/tk and so I have abandoned that approach.
I'm really old school (started using unix on a pdp-11 - what's that!!)
and so I don't really like java or C++, and so now when I need a gui program
I try to write it in tcl/tk entirely, since they've made it pretty robust, fast, and
portable. If I also need performance, then I might just use tcl/tk for a front end
and spawn C programs to do the dirty work. For designing the tcl/tk gui, I often
use a program called Visual Tk.
Now, if you intend to write kernel code, then it's kprintf :)