Live data from Hacker News

What I Wish I Had Known About Developing C/C++ From Linux Before I Started

derwiki.tumblr.com

71–80 of 104 posts

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#71
post #48
post #3

I use "screen" a lot, but I wish it had a better name. It helps if you search for "gnu-screen", but not much. Here's a tip that has saved me once or twice. If you start a long-running process, but forgot to use screen or nohup, bash lets you 'disown -h' its jobspec.

The biggest problem with screen is that it breaks ordinary virtual terminal scrollback, which is something that I can live with, but…

Does this not work for you?

From http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq....

  Q: My xterm scrollbar does not work with screen.
  A: The problem is that xterm will not allow scrolling if the
     alternate text buffer is selected. The standard
     definitions of the termcap initialize capabilities ti and
     te switch to and from the alternate text buffer. (The 
     scrollbar also does not work when you start e.g. 'vi'). 
     You can tell screen not to use these initialisations by 
     adding the line termcapinfo xterm ti@:te@ to your 
     ~/.screenrc file.

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#72
post #3

I use "screen" a lot, but I wish it had a better name. It helps if you search for "gnu-screen", but not much. Here's a tip that has saved me once or twice. If you start a long-running process, but forgot to use screen or nohup, bash lets you 'disown -h' its jobspec.

I might be slow about screen, but how is it different from running several tabs in Terminal on Mac OS X for example ?

I can see it being useful in ssh through : you can have it emulate tabs through a single ssh connection.

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#74
post #72
post #3

I use "screen" a lot, but I wish it had a better name. It helps if you search for "gnu-screen", but not much. Here's a tip that has saved me once or twice. If you start a long-running process, but forgot to use screen or nohup, bash lets you 'disown -h' its jobspec.

I might be slow about screen, but how is it different from running several tabs in Terminal on Mac OS X for example ? I can see it being useful in ssh through : you can have it emulate tabs through a single ssh connection.

screen is persistent over dropped connections. Lets say you are doing some long running operations on a remote server and your connection drops. With screen you can log back in and run 'screen -r' to resume the session.

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#75
post #71
post #48

Earlier quoted context omitted.

The biggest problem with screen is that it breaks ordinary virtual terminal scrollback, which is something that I can live with, but…

Does this not work for you? From http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.... Q: My xterm scrollbar does not work with screen. A: The problem is that xterm will not allow scrolling if the alternate text buffer is selected. The standard definitions of the termcap initialize capabilities ti and te switch to and from the alternate text buffer. (The scrollbar also does not work when you start e.g. 'vi'…

No, it becomes chaotic and unusable when I have more screen windows and switch among them :-)

I would not complain, if I knew such an easy way to make it work, really. :-)

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#76
post #45

There is one thing I feel have been neglected here: Debugging. Debugging C in Linux is a dream with gdb. Debugging (heavily templated) C++ in gdb is a nightmare. I therefore have one additional tip, though it doesn't work in console: Run Visual Studio in wine. It's debugger can pick up running Linux processes and is awesome to work with.

I feel the same way about GDB lacking in C++. I ran across project Archer... apparently better debugging support for C++

http://sourceware.org/gdb/wiki/ProjectArcher

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#77
"diff: pretty standard utility, but this is what I use it for: I loop through all the files I’ve modified and diff to the previous version, then pipe to a grep where I can search for something I think I’ve changed but can’t remember where."

NOOOOOOooooooo. That implies he is using ad-hoc version control (uniquely named files or directories with non-revisioned copies).

Tracking and finding changes is what git is for. Commit early and often! If you mess up, it's got your back! If your compatriots use SVN, that works, but not nearly as well (when I used SVN, I would still revision control my local copies with RCS in between SVN commits). If you are developing by yourself, rcs is the minimum acceptable alternative.

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#78
post #19
post #2

This is a nice list! However, I really think that increasing speed of development with better tools is a cornerstone of being one of those elite programmers, and vim<<eclipse, at least for Java! I haven't done C/C++ for some time... but I expected similar IDEs exist. "The way our development environment is set up though, there was really no good way to use Eclipse because everything is done on a remote development bo…

I haven't done much development in Java since my days in college, but... However, I really think that increasing speed of development with better tools is a cornerstone of being one of those elite programmers, and vim For every other language that I have encountered, the utilities listed by the OP (especially vim/emacs) are the better tools, as far as I'm concerned. Firstly, they were written by hackers for hackers,…

Do vim and emacs really have all the features of eclipse? Autocomplete, integration with Javadocs, automated refactoring, integration with bug tracking systems, integration with source control, full debugging inside of the server all with the click of a button? Do you have a resource for how to setup emacs this way? I used to use emacs...

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#79
post #6
post #2

This is a nice list! However, I really think that increasing speed of development with better tools is a cornerstone of being one of those elite programmers, and vim<<eclipse, at least for Java! I haven't done C/C++ for some time... but I expected similar IDEs exist. "The way our development environment is set up though, there was really no good way to use Eclipse because everything is done on a remote development bo…

Eclipse is an Integrated Development Environment. That is, all of the development tools are integrated into the editor. I don't develop using an IDE, but I still have access to the same kind of functionality. It's just not integrated into my editor.

and so imho this increases your turnaround time for changes unless you are a real wizard with your tools, which is certainly possible

Re: What I Wish I Had Known About Developing C/C++ From Linux Before I Started

#80
post #5
post #2

This is a nice list! However, I really think that increasing speed of development with better tools is a cornerstone of being one of those elite programmers, and vim<<eclipse, at least for Java! I haven't done C/C++ for some time... but I expected similar IDEs exist. "The way our development environment is set up though, there was really no good way to use Eclipse because everything is done on a remote development bo…

It's a rather massive codebase, and our remote dev machines are a lot beefier than our laptops -- also 64-bit, whereas our laptops are 32-bit. I'm not saying it couldn't be done locally, but it might actually cause more headaches than it solves.

It might and your approach may be optimal already. I guess it's a question of how much the environments differ? When I am moving to a new project I try to get myself setup so I can make changes and test them as quickly as possible and it's always a judgment call about how much time to spend doing that setup. Also, there is a cultural element like one poster said if everyone is using vim them that becomes a clear choice...
Post reply on HN