You are not logged in.

#1 2017-09-17 21:23:53

bloodh101
Member
Registered: 2017-09-17
Posts: 4

C/C++ - How do you develop?

Hi all, first post; Sorry if this has been done elsewhere.

I'm interested to see how you develop in C or C++!

Personally, I write up code in leafpad or the likes, and compile on the command line using a Makefile.
I'm aware of IDE's like Codeblocks, but i'm interested to see different processes.

Offline

#2 2017-09-17 23:04:18

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,797

Re: C/C++ - How do you develop?

emacs, of course.

Specifically using autocomplete with clang.  Enable EDE extensions.  Extra bonus points for enabling source control through git.
Edit: Oh, and autotools

Last edited by ewaller (2017-09-17 23:06:26)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#3 2017-09-18 00:03:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: C/C++ - How do you develop?

Vim, of course.

Lately I've been becoming aware of just how gnu-dependent much of my code has been.  So now (partially for learning purposes) I'm avoiding as much gnu-anything as possible*.  So I've also been dabbling with clang as well as musl libc.  And I now write portable makefiles (tested with bmake) with no gnu-isms ... and so definitely no autotools.  And Fossil for DVCS is replacing git for me.

(* - I tried switching to a BSD.  That was painful.  It's easy to get up and running if you like all the default settings/ports, but those defaults are so insanely bloated it's ridiculous.  And the approach of going through a near infinitely-regress of blue `dialog` screens to deselect all the silly options ... no way.  Such a good idea, such bad execution.)

Last edited by Trilby (2017-09-18 00:04:49)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2017-09-18 00:11:37

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,395
Website

Re: C/C++ - How do you develop?

Leafpad for small changes, geany for more complex ones.

Offline

#5 2017-09-18 09:23:36

null
Member
Registered: 2009-05-06
Posts: 398

Re: C/C++ - How do you develop?

Also Vim with ctags plugin and Makefiles. But I've only done smaller university C{,++} projects.


Trilby wrote:

(* - I tried switching to a BSD.  That was painful.  It's easy to get up and running if you like all the default settings/ports, but those defaults are so insanely bloated it's ridiculous.  And the approach of going through a near infinitely-regress of blue `dialog` screens to deselect all the silly options ... no way.  Such a good idea, such bad execution.)

That's why there is the /etc/make.conf where you can (and definitely should) set defaults for most of the common options (see $PORTDIR/Mk/bsd.options.desc.mk [FreeBSD] for a list). This will skip most of the dialog screens and you get consistent options all over your ports. Also you can just set the options there that you care about (like no X11 and no SSL2+3) and choose default options otherwise.

Last edited by null (2017-09-18 09:24:08)

Offline

#6 2017-09-18 12:46:07

YesItsMe
Member
Registered: 2017-07-12
Posts: 37

Re: C/C++ - How do you develop?

Emacs, of course. Because Emacs.

Trilby wrote:

(* - I tried switching to a BSD.  That was painful.  It's easy to get up and running if you like all the default settings/ports, but those defaults are so insanely bloated it's ridiculous.

FreeBSD is "a BSD", accidentally the one which tries to be as easy to use as possible for Linux refugees. It is probably not the best choice for everyone though.

Offline

#7 2017-09-18 13:11:48

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: C/C++ - How do you develop?

Oh man, where to begin! big_smile

Vim is my text editor of choice.

One day, I realized that the reason I wasn't working on my programming projects as much as I wanted to was because it took me FOREVER to get back to where I was the last time I was programming. So, I solved it by creating a silly little script called "drc-ide". Now, I can sit down at my computer, hit a shortcut on my keyboard, and be ready to code!

My script does a few things: You send it one command line argument, which is the name of the project to work on (for example, a software project named "chickenblaster"). First, it creates a giant terminal window near the center of the monitor, in the directory "~/Projects/chickenblaster", inside a tmux session. Next, it creates a slightly smaller winder to the right of that window, for anything I want to look at while working on another file (header files, data files, man pages...). Finally, it creates a tiny window near the bottom of the monitor in the directory "~/Projects/chickenblaster/dev/buildit", ready to compile and run the project.

I don't have access to my computer at the moment, but a screenshot would totally look like this:

PwzhQbU.png

Next... I setup GNU Autotools for my new projects as soon as possible, making compiling super simple. Learning GNU Autotools is not super simple, but once I got it working one time it's been pretty easy to use in my other projects. I documented my efforts in these files: autotools-templates

Next... What's in the "buildit" directory you ask? Well, I created my own set of GNU Autotools "helper" scripts, called buildit (that's "build it"). They make my life so much easier! I can just type "./run" or "./debug", and it will do everything needed (clean, build...). And it does it all in a directory in "/tmp/chickenblaster-drcouzelis". It even has a "./wipe" command to delete (as safely as possible) ALL unneeded project files.

...and that's pretty much it! It's very tailored to my needs, but it has helped me enjoy working on my programming projects a lot more, now that I don't have to futz with window placement, makefiles, and building. smile

And I only do C programming! None of that nasty C++ garbage. In my opinion it should be called "C--". wink

Offline

#8 2017-09-18 14:39:04

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: C/C++ - How do you develop?

Sorry if this has been done elsewhere.

https://bbs.archlinux.org/viewtopic.php?id=47105

To the topic at hand - I use QtCreator and on Windows, Visual Studio. Both combine to about 20GB of files!

Last edited by Alad (2017-09-18 14:46:55)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#9 2017-09-18 17:52:20

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: C/C++ - How do you develop?

#!/bin/bash
# wrapper for leafpad to  set tab size to 4
leafpad --tab-width=4 $@ &
exit 0

You're just jealous because the voices only talk to me.

Offline

#10 2017-09-18 18:28:09

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: C/C++ - How do you develop?

For those who program using Leafpad...

You really code without syntax highlighting? O_O

Offline

#11 2017-09-18 19:06:05

bloodh101
Member
Registered: 2017-09-17
Posts: 4

Re: C/C++ - How do you develop?

Interesting! Thank you.

I have to say I quite like the idea of having a script that sets up a few terminal windows etc.


And yes, as long as indenting is a thing, for smaller projects I can survive without syntax highlighting.. ~sometimes smile

Last edited by bloodh101 (2017-09-18 19:07:20)

Offline

#12 2017-09-18 19:38:26

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: C/C++ - How do you develop?

drcouzelis wrote:

For those who program using Leafpad...

You really code without syntax highlighting? O_O

http://www.linusakesson.net/programming … hlighting/


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#13 2017-09-19 00:42:24

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,395
Website

Re: C/C++ - How do you develop?

drcouzelis wrote:

For those who program using Leafpad...

You really code without syntax highlighting? O_O

Yes...  almost everything I contributed to pacman has been done that way!

Offline

#14 2017-09-19 04:34:26

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 653

Re: C/C++ - How do you develop?

I develope and navigate code using vim and ctags/cscope. I keep tags and cscope databases at the root of each project and autoload them when anywhere within the tree (like git searches for .git dirs). Cscope does a bit more than ctags In particular, it gives "find functions calling this function" from a key mapping.

Offline

#15 2017-09-19 12:44:31

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: C/C++ - How do you develop?

Holy cow, that article has produced a full decade's worth of comments! Talk about a sensitive subject. big_smile

I disagree that disabling syntax highlighting will help me with programming, but I can't complain... I'm one of those idiots that prefers fewer monitors, smaller screen sizes, lower resolutions, and smaller windows, to help me focus on what I'm looking at. roll

bulletmark wrote:

ctags

Woah. I can't wait to try this out. It's time for me to up my Vim game!

Offline

#16 2017-09-21 19:42:53

mis
Member
Registered: 2016-03-16
Posts: 234

Re: C/C++ - How do you develop?

kate, nano and sometimes mcedit

Offline

#17 2017-09-21 20:07:16

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,093
Website

Re: C/C++ - How do you develop?

I use vim, with enhanced C syntax highlighting, clang with -Weverything and a bunch of hardening options (I would switch back to gcc in a heartbeat if they added -Weverything—though I'd miss leaksan), and though I had a brief affair with Tup, I'm heading back to plain Makefiles again for build-system. I've poked around with ctags, but haven't gotten it into my workflow well enough that I rely on it (probably because I haven't gotten around to setting up a make target to generate them for me or anything).

I've used IntelliJ in college, Visual Studios and vim professionally, and poked around with a littany of other environments, and I sill prefer, by far, vim for essentially everything.

All the best,

-HG

Offline

#18 2017-09-21 20:40:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: C/C++ - How do you develop?

HalosGhost wrote:

At first I thought "oh cool, what's that".  Then suddenly the previously-mentioned case against syntax suddenly made a bit more sense.  Really that enhancement just looks like different colors for every possible thing in the code just for the sake of having more colors.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#19 2017-09-21 20:44:17

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,093
Website

Re: C/C++ - How do you develop?

Trilby wrote:

At first I thought "oh cool, what's that".  Then suddenly the previously-mentioned case against syntax suddenly made a bit more sense.  Really that enhancement just looks like different colors for every possible thing in the code just for the sake of having more colors.

Really, the biggest thing for me is just that operators get highlighted, which I find really nice. smile

All the best,

-HG

Offline

#20 2017-09-22 03:00:50

escondida
Package Maintainer (PM)
Registered: 2008-04-03
Posts: 157

Re: C/C++ - How do you develop?

I run acme. Generally, I'll have the main file I'm working on at the moment as the only visible window in the main (left) column, with things like current directory listing, shell for testing or whatever, build output, misc. notes I've taken, relevant manpage, etc., in the right. (Not all of those things at once, generally, just whichever are relevant at the moment).

Offline

#21 2017-09-22 06:39:53

bloodh101
Member
Registered: 2017-09-17
Posts: 4

Re: C/C++ - How do you develop?

That's an interesting article.

I'm glad to hear that most people seem to do the compiling 'themselves' instead of using an IDE.. but then again I don't really know what I expected! If I'm on Windows I always just use Visual Studio because, although bulky, it's easier and I'm lazy. I much prefer developing on Linux though, as it's faster and of course you have more control.

I might have another look at Vim, i've always avoided it because of the control scheme, and once again, I'm lazy and didn't fiddle with it.

Last edited by bloodh101 (2017-09-22 06:41:10)

Offline

#22 2017-09-22 07:59:55

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: C/C++ - How do you develop?

bloodh101 wrote:

I might have another look at Vim, i've always avoided it because of the control scheme, and once again, I'm lazy and didn't fiddle with it.

Once you go past the initial barrier, you'll never look back; or at least you will find Vim to be *highly* useful.
I use vim for everything - taking notes, writing HTML markup, C programs, text documents and sometimes also as a pager instead of less. The only place I find it difficult to use is Java development, but Java is a defferent territory altogether.

Offline

#23 2017-09-22 12:17:53

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: C/C++ - How do you develop?

adesh wrote:

and sometimes also as a pager instead of less.

I just recently set my "PAGER" variable to "vimpager"! smile

Offline

#24 2017-09-22 12:46:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: C/C++ - How do you develop?

adesh wrote:

The only place I find it difficult to use is Java development, but Java is a defferent territory altogether.

It's been said before that the difference between emacs and vim is that emacs does everything; vim does everything worth doing.  So use emacs for java tongue


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#25 2017-09-22 14:41:52

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,797

Re: C/C++ - How do you develop?

As an emacs user, I can poke fun at it with the old cliché that emacs is a great operating system in search of a good editor ....


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

Board footer

Powered by FluxBB