# Developing on Free/Open/NetBSD



## wenp (Aug 31, 2013)

I want to try moving from Linux to *BSD for a programming environment. However, from reading online chat, the three major versions sound about equally good. How do they compare in these respects?

System analysis. How are the facilities for tracing and logging bugs?
Community support for bug fixing. When you find a bug, how easy is it to find descriptions of the problem, find the right person to report it to, and get it fixed?
Accurate information. How accurate and thorough is the documentation? How is the signal to noise ratio in the community? A big cause of wasted time for me has been the large amount of outdated or inaccurate information regarding Linux. Chalk it up to the diversity and erratic evolution of the platform, I guess.
Package management. When you add something to a system, how often to things go wrong and how easy is it to recover when they do? How safe and clean is it to remove programs?
Tools. How well are the usual development tools supported?


----------



## xibo (Aug 31, 2013)

FreeBSD supports DTRACE, profiling, valgrind, ..., ..., rlimits and syslog, however whether a given functionality is usefull to you depends mostly on what you want to analyze.
The usual way is to contact the developers via some mailing list.
The Wiki, FAQ and man pages cover most things. There are books on advanced topics (PF, kernel, ...), and there's this forum and the mailing lists to ask questions.

The Wiki is partially out of date, and forums/mailing list postings might end up not being answered by anyone (as in any other forums/mailing list). IMO the answers returned here are quite useful.
I can't remember of troublesome situations I got into by something other than my own incompetence 

That said, on FreeBSD you really shouldn't be using STABLE and especially HEAD operating systems and/or "experimental" ports repositories on a production system and you really should read UPDATING before running any updates, too. For example there are quite a number of breakages around, which are being discussed on the mailing lists, so tracking the mailing lists (ports@, stable@, ...) is really useful for preventing undesired updating effects.

Official ports on supported RELEASE versions have a very low number of breakages and they are taken care of by the developers (ports@ mailing list)
What are "the usual development tools" to you?


----------



## Captain_HM_Murdock (Aug 31, 2013)

Vi is a useful development tool.


----------



## YZMSQ (Aug 31, 2013)

wenp said:
			
		

> 5. Tools. How well are the usual development tools supported?


Editors like Vi/Vim, Emacs, IDEs like Codeblock, Eclipse all work like a charm on FreeBSD.


----------



## andyzammy (Aug 31, 2013)

I would like to question whether vi(1) really is all that useful on FreeBSD for developing. I have attempted to try to use this in the past, but have found it's ctags(1) and cscope(1) support quite limiting. Lack of Exuberant ctags support, coupled with the :cs and :ta commands taking the user directly to the first symbol found without offering choice are complete show stoppers for me. I don't understand how people are able to navigate code without these features.

Despite some effort in trying to make vi(1) work for me, I've been forced to default to using vim(1), which has the above requirements and more, at the cost of bloat.

I have tried in the past to ask how exactly people use vi(1) in FreeBSD, both here on the forums and on the mailing lists, but no-one responded. It lead me to believe that nobody uses vi(1) to develop.

Corrections on my observations are very welcome!


----------



## wenp (Aug 31, 2013)

xibo said:
			
		

> 5. What are "the usual development tools" to you?



Things like Valgrind, *strace, scanmem, pstack, cscope, gdb, ddd. Note that I am not asking what is available. I easily got that info from reading the online documents. I am asking for a comparison of FreeBSD, OpenBSD, and NetBSD based on your experience using these platforms.


----------



## kpedersen (Sep 1, 2013)

As you know, FreeBSD has devel/valgrind whereas OpenBSD has to make do with Otto's malloc hack (http://www.drijf.net/malloc). To be honest though, I tend to do my memory testing with Valgrind on Linux and IBM Purify on Windows anyway.

For modern C++ (0x,11) support, FreeBSD has clang and a newer g++ whereas OpenBSD does have clang but not lldb and its g++ in base is a little too old for -std=c++0x. It does however have a port for g++ 4.7 which does support newer c++ standards.

For 3D graphics development, I find OpenBSD is a little bit ahead of FreeBSD. Their OpenGL profile support seems to always be higher (i.e. 2.1 vs 2.0 on Intel GMA 950). I also find it to be a little bit more robust. I.e. a faulty GL call doesn't take down the whole of X11.

Other than that, I find FreeBSD and OpenBSD very similar to develop on. Usually I install which ever my hardware supports best (i.e. when stuck with an NVIDIA card, I have to use the binary blob on FreeBSD).

FreeBSD has an excellent handbook which is kept up to date. OpenBSD has an FAQ (which is admittedly about the size of a handbook). The documentation for these two operating systems is far superior to any single Linux distro IMO.

I guess because FreeBSD has a higher userbase, it (usually) gets things first such as emulators/virtualbox-ose and DTrace which are often useful for development.


----------



## fonz (Sep 4, 2013)

andyzammy said:
			
		

> Despite some effort in trying to make vi(1) work for me, I've been forced to default to using vim(1), which has the above requirements and more, at the cost of bloat.


Admittedly, although I find "vanilla" vi(1) good enough for sysadmin tasks, it arguably isn't "rich" enough for coding. And yes, editors/vim has bloated considerably over the years, but there is of course always editors/vim-lite.


----------

