Live data from Hacker News

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

derwiki.tumblr.com

11–20 of 104 posts

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

#11
post #7

There's an incremental find option in Eclipse. Ctrl-j or was it Ctrl-i (or something like that) which is pretty nice and I wish all IDEs (read: IDEs) have that. That beats Ctrl-F any day. How did you do refactorings? Or you just don't?

Which IDEs don't? Borland/Codegear IDEs have had that at Ctrl+E for over a decade, while Visual Studio defaults to Ctrl+I. F3/Shift+F3 scroll backward and forward through matches by default.

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

#12
c++filt - an absolute necessity.

Also, he should have just pointed out that all IDEs are ass for C++. Java is simple enough that an IDE can be a big help, but C++ is too complicated and too slow to compile. (The remote access thing is just a matter of the work environment being adapted to one set of tools and not another -- the real issue is that text editors beat IDEs for C++.)

Otherwise, an excellent list.

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

#13
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.

One day I took the time to work this out for my .screenrc, and it's served me well since:

  # Set up my status line at the bottom of every frame
  caption always "%{gb}  %{ck}%m-%d %C %{gb}  %{gb}%?%-Lw%?%{ck}%n*%f %t%?(%u)%?%{gb}%?%+Lw%?"
All of the %{gb} things are color codes. It looks like this: http://shenani.gen.nz/~scott/screen-statusbar.png

Binding ! @ # etc. to select 10, 11, 12, ... is handy, too.

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

#14
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…

Unfortunately, your expectations would not be met. IDEs make up for their limited text-editing features by providing language-dependent, code-aware functionality. Because C++ is such a hairy language, IDEs aren't able to do much with it. They don't give you anything like the cushy, comprehensive support that IDEs provide for Java. With C++, giving up the relatively lame IDE features to get a powerful text editor is a no-brainer. (I use Eclipse for Java and emacs for everything else.)

You're absolutely right about their development environment; it's adapted for one set of tools. It doesn't necessarily mean other tools are inferior in general, as the author seems to conclude.

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

#15
post #10
post #9

When I started developing in C in Vim there are two things I've gotten used to that I can't live without now: ctags and auto-complete (they help with eachother). Ctags is great, especially for navigating someone else's code. What does this function do? Just ctrl-] and suddenly I'm at its definition. Something in there I don't recognize, same thing. Ctrl-t to go back up the tag stack. Ive become so used to navigating…

Of course, if you use an IDE, it can do all of this for you and much more, and more accurately than ctags.

Of course, it's easier to write a program that generates tags for a new language than to build an IDE around it.

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

#16
post #12

c++filt - an absolute necessity. Also, he should have just pointed out that all IDEs are ass for C++. Java is simple enough that an IDE can be a big help, but C++ is too complicated and too slow to compile. (The remote access thing is just a matter of the work environment being adapted to one set of tools and not another -- the real issue is that text editors beat IDEs for C++.) Otherwise, an excellent list.

The real issue is that C++ is too complicated and too slow to compile.

Languages that are easier to throw together a reasonable parser for (Lisps, Smalltalk, Lua, or even C) have a much lower barrier to entry for development tools. Keeping the language syntax simple enough means that somebody scratching an itch can write something useful in an afternoon or a weekend, rather than taking a team and months.

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

#17
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.

IDEs can work well editing code that is targeted to a different platform. The code is edited locally (and parsed, analyzed, colorized, etc. by the IDE locally) but built and run remotely on other machines. That setup used to be pretty common for enterprise and web development before Moore let us run entire enterprise application servers on our laptops. It takes more work to set up than just sshing into a remote box and firing up emacs, but it can be done.

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

#18
post #7

There's an incremental find option in Eclipse. Ctrl-j or was it Ctrl-i (or something like that) which is pretty nice and I wish all IDEs (read: IDEs) have that. That beats Ctrl-F any day. How did you do refactorings? Or you just don't?

In Vim, install ack, then put "set grepprg=ack" in your .vimrc. Then, open your project in Vim, do a ":grep ", and use ":cn", ":cnf", ":cp", ":cpf", ":cr", etc. to move about. Combined with strong knowledge of setting marks and using ":s/" substitutions, and I often wonder how people who use IDEs do refactorings! ;-)

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

#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, and because of that, they generalize just about all the functionality a programmer is likely to need when coding in any language. Even supposing there were eclipse-like IDEs for every language out there, it is more than likely that there will necessarily be differences between them (since they were written for different languages) which will be jarring for the power user. One would have to learn an IDE for every language. With vim and the assorted tools mentioned in the OP, one just needs to learn one set of tools and can use them for every language. If you foresee that you will only code in one language for the rest of your life, then sure, find the best IDE for that language. In my job, however, I have to code in C++, Python, Perl, PHP and shell (most times editing source files in more than one language at the same time), so to increase speed of development, (though I am no elite programmer) I use vim.

Post reply on HN