Live data from Hacker News

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

derwiki.tumblr.com

31–40 of 104 posts

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

#31
post #26

Why are we taking C/C++ programming advice from somebody who has been doing it for just over a year? And not to troll, but anyone who honestly believes vim is a better development environment than one of the mature Linux IDEs (Eclipse, Code::Blocks, KDevelop) is an idiot.

I upvoted this by mistake. But I don't believe "not to troll" and "anyone who believes vim is a better environment is an idiot" can go together.

And this is coming from an emacs user ;)

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

#32
post #26

Why are we taking C/C++ programming advice from somebody who has been doing it for just over a year? And not to troll, but anyone who honestly believes vim is a better development environment than one of the mature Linux IDEs (Eclipse, Code::Blocks, KDevelop) is an idiot.

Linus Torvalds has pretty much always used an Emacs variant for his work on the kernel. Matz uses Emacs for his work on Ruby. DHH uses TextMate, a text editor. Pretty much every major piece of software that you can name on the Unix platform was and is developed in either Emacs or Vim.

Anybody who thinks that a text editor is better than an IDE is an idiot? I think not.

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

#33
post #26

Why are we taking C/C++ programming advice from somebody who has been doing it for just over a year? And not to troll, but anyone who honestly believes vim is a better development environment than one of the mature Linux IDEs (Eclipse, Code::Blocks, KDevelop) is an idiot.

If you're been doing C/C++ programming for longer than I have, this post is probably not meant for you. If you're a student who has to learn C/C++ or someone starting a job in it, then this post might be for you. This was stuff that I didn't know when I started that I wish I would have known.

And not to respond to your troll, but a lot of the more senior devs on my project (10, 15+ years) as just as efficient in vim/emacs as they would be in Eclipse. I don't think there's a one-IDE-fits all solution. Vim is certainly capable if you're willing to learn it.

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

#34
post #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…

Sorry, I didn't mean to imply that one set of tools is inferior. If I was doing Java development, I would fight harder to make Eclipse work for the project. But the specifics of our infrastructure, SCM, and utilities (we do have ctags and cscope) set up -- and the fact that the team has been using vim/emacs to do this job for the last 15 years -- makes vim/emacs a more natural choice.

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

#35
post #29
post #27

Worse is NOT Better; use a safe and high-performance programming language and learn its foreign-function interface to call out to C and C++. Life is too short for core-dumps and premature optimization, plus you only have two feet to shoot at. The better designed a language the better its development process feels. You can get immersed in a lowly Lisp, J, or Forth listener. Just a little black xterm with nothing else…

I didn't really mean for this to be a battle of which language is better, although I prefer not to use a screwdriver for a nail -- I'm doing systems level/kernel programming, so C makes a lot of sense.

Point taken. Although I personally don't see C as "another" programming language, more like a system building-block, closer to a portable processor binary format :-)

When I wrote kernel modules I used C; today I'm writing an in-memory cache for a mulithreaded webserver. It has to maintain user-sesions in memory across several load-balancing servers. It has a multi-stage storage system. It has a queue manager that maintains a private queue for all concurrent users of the system; everything dynamically scheduled in realtime with a bunch of matrix munching algorithms. Allot of intricate stuff that I would have written in C when I didn't know better.

I would still write C code though, but only if I absolutely must, as in your case.

Regards.

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

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

There are more .screenrcs (including my own) in this thread: http://news.ycombinator.com/item?id=425890

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

#37
post #26

Why are we taking C/C++ programming advice from somebody who has been doing it for just over a year? And not to troll, but anyone who honestly believes vim is a better development environment than one of the mature Linux IDEs (Eclipse, Code::Blocks, KDevelop) is an idiot.

My development environment runs 24/7 and I can get to it from ANY machine on earth.

ssh me@mysite.com

$ screen -x

Even the cursor stays where it was between sessions.

How can I do that with ${IDE}?

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

#39
post #28
post #22

Earlier quoted context omitted.

Ctags is just as accurate at scanning C declarations as an IDE, and with a bit of vim magic, it even auto-updates when you save files. One thing to realize is that vim IS an IDE of sorts. Only, it's far more extensible for the same effort. (although, from my brief forays with emacs, emacs certainly beats vim for extensibility)

Emacs also supports ctags. I didn't find it very useful with C++ though, which is my usual language, since it didn't autocomplete member functions - I think it's supposed to work, though I couldn't be pushed to tweak it. Cscope, as commented on the article's website, sounds quite interesting too.

ctags on C++:

ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .

Post reply on HN