Re: How do old-school emacs/gcc/gdb hackers do their coding?

From: Eric Taylor (et1_at_rocketship1.com)
Date: 03/03/05


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
just fine.

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 :)

eric



Relevant Pages

  • Re: A little musing on Linux ( was Re: Zip files to multiple floppies)
    ... > various distributions Of linux have made me think a little harsh about ... > and troubles far more than Windows. ... The amount of extra work to program a gui ... Mounting filesystems for example - windows computers only ...
    (Fedora)
  • Re : Re: A little musing on Linux ( was Re: Zip files to multiple floppies)
    ... >> and troubles far more than Windows. ... >> Hope we will all be part of the Linux evolution into a nice desktop OS ... The amount of extra work to program a gui ... This is also one of the limiting features of a windows ...
    (Fedora)
  • Re: Flame Bait! Windows vs: The Unices
    ... does Linux provide a "Linux" window manager, ... MS-Windows, however, *only* provides a graphical environment. ... )> You do not need a GUI to type make. ... You don't need a GUI to have multiple windows, ...
    (comp.programming)
  • Re: Linux, the final decision
    ... I have a stock standard Xandros installation. ... performs essentially the exact same process as windows... ... apps via Xandros Networks that have required a GUI restart. ... more and more people will turn to linux because LongArm ...
    (comp.os.linux.misc)
  • Re: C++ and GUI
    ... >> to have it working as GUI, i use this app on linux and windows, my ... >> that idea because i wouldnt be able to run it on linux. ... > Second, look at Tcl/Tk. ... written in tcl and some c in the book. ...
    (comp.lang.cpp)