# Linux development workflows?

This topic is 1282 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm sort of curious if anyone here develops on linux, and if they do, what do you use? Does anyone use vim/emacs as their "IDE"? How much boilerplate did you have to write?

##### Share on other sites
switch ( Platform.get() )
{
case WIN:
bpp = 32;
break;
case MAC:
bpp = 32;
break;
case NIX:
bpp = 24;
break;
default:
bpp = 24;
break;
}

And that's about it in my case (bpp is bits per pixel btw, turns out Windows/OSX defaults to 32 whereas *nix platforms default to 24).

Edited by TheChubu

##### Share on other sites

What kind of boilerplate?

##### Share on other sites

Honestly, unless I'm sealed into developing on linux, which is rare, I'll program on windows in a cross-platform fashion, and port.  It sounds dumb, but it really doesn't take that much effort to be cross-platform, outside of video/audio and sometimes networking, and sometimes threading, that it just isn't worth using things that lock you in to one platform or another.  If you're like me, and primarily working on back-end stuff or tools, there just isn't much justification for doing platform specific work.

##### Share on other sites

I usually program windows-only, partly because my Linux workflow kind of sucks, but for comparison, this is what I use:

C/C++:

Editor:  For small tasks -- vim.  Larger tasks I open SublimeText for.

Compiler:  Usually gcc, but I've been toying with clang lately

Source Control:  hg (since I use bitbucket a lot)

Debugger:  command-line gdb)

Build System:  make;  More specifically, I have a non-recursive makefile that works as a great drop-in with very little customization.  I only need to specify the executable name and obscure library flags (like -lm for gcc).  All my external dependencies are handled with dependency generation features in gcc and fancy makefile macros.

Python:

Basically the same as C++ with no debugger or build system stuff.

It's kind of a pain.  While the tools are good, the system as a whole isn't cohesive enough (unix philosophy and all that) for the really nice stuff like goto definition, refactoring, or building/debugging in-editor.  So on that level, while Sublime is awesome and all, I strongly recommend finding an ide, unix philosophy be damned.

EDIT:  I should probably add that my Linux stuff all falls into two things:  homeworks from college or cross-platform stuff that I also use on windows.  As such, I generally only work on the Linux side when I need to make it work for Linux.

Edited by SeraphLance

##### Share on other sites

outside of video/audio and sometimes networking, and sometimes threading

Even those are all easy enough to make portable. Use OpenGL, an audio library like FMOD or Wwise, and Boost/STL threading or a library like Intel's Threading Building Blocks. IO can be done via PhysicsFS, Boost/STL, and so on as well. All the windowing and input is handled by all the common window-system libraries like SDL.

Does anyone use vim/emacs as their "IDE"?

When I used Linux as a desktop/development OS (which I haven't for some years) I used Vim exclusively. These days a lot of people swear by QtCreator which also runs on Windows and OSX so it's a decent choice for a cross-platform IDE. I can't really stand any IDE I've put time into aside from Visual Studio anymore, though, though Sublime Text (which runs on Linux) make a good run.

How much boilerplate did you have to write?

The boilerplate is no more or less on Linux than it is elsewhere when you use a window-system toolkit like SDL2, GLFW, SFML, etc. and a build system tool like CMake. If you're writing raw OS API code (Win32, X11, etc.) there's tons of boilerplate to write but there's really no good reason to ever do that these days.

##### Share on other sites
Since I started out with programming on UNIX I tend to use that same development environment even when on Windows.

In a typical Linux/UNIX project I generally find all of these tools useful.

Editor: Vim - Including the NETRW and Buffergator plugins. Helps navigating scattered source bases quickly. More importantly, it does not require a "project file" for source aware navigation to work. My biggest annoyance with Visual Studio or other IDEs.

Code completion / Navigation
- exuberant ctags (Vim supports by default now).
- cscope (performs some tasks ctags cannot)
- doxygen (With C the automatic flow chart generator is fantastic for development and learning codebases)

Compiler:
- gcc for main releases
- Any compiler I can get my hands on since they all potentially pick up on different issues.

Build System:
- cmake
- simple Makefiles for release builds and test harness

Continuous Integration: Jenkins on a bunch of VMs targeting many platforms

Misc: tmux for multiple terminals

Debuggers / Profilers:
- Valgrind
- gdb
- ElectricFence
- Intel VTune
- splint

Arguably GLX requires less boilerplate code than Windows alternatives when setting up an OpenGL rendering context.

http://www.opengl.org/wiki/Programming_OpenGL_in_Linux:_GLX_and_Xlib

You may notice it has a line count close to when using Glut. Edited by Karsten_

##### Share on other sites

Honestly, my development experience on Linux is mostly as a kind of playground. That is, the kind of coding I do there is mostly recreational -- messing around with Arduinos or other embedded stuff who's tool chain runs best on *nix, exercising my more 'academic' language pursuits like Haskell, or playing with neat linux stuff like Docker. Because I'm not so concerned with efficiency then, that informs some of my other choices. I use Vim not because I find it to be instantly productive, but because leaning Vim is a goal in itself -- its simply useful to know at least one lightweight text editor that you can use even from a remote text console -- and because the long walk leads to becoming possibly more efficient than WYSIWYG editors and fancy IDEs.

In general I like Linux because its a more 'orthogonal' environment in some sense of the word. The trend on Windows (and old-world Macs, the trend has reversed since OS X) has been towards more monolithic, swiss-army-knife applications, or to largely independent 'kingdoms' of apps that inter-operate nicely. The trend on *nix has always been towards a more inter-operable ecosystem of smaller and more focused tools that do one thing very well. It goes beyond the apps themselves though -- even where windows has functional equivalents (say grep vs. findstr) the command-line apps on Windows all use wildly-different argument formats, and not every app necessarily supports piping in ways it ought to. The *nix world largely has that problem sorted.