13

Where to ask questions about "Linux/Unix programming libraries" ? Is it better to ask such on Unix.SE or StackOverflow ?

As @Mat pointed out FAQ says "If your question is a programming question, requiring knowledge of programming languages other than unix shell scripting languages, ask on Stack Overflow." .

So I think about questions of library existence :

  • Could you suggest programming library (C/C++) doing this and that with Unix ?
  • Which programming library (in terms of popularity) is more common, better?
  • ... other related with existence of library, not programming with it.

I mean this and that I mean very Unixy/Linuxy things, like ncurses, X-window system... etc.

My feeling is that answering questions about existence, does not require knowledge about programming.

For example, I could answer question "What are cryptographic programming libraries installed on your system?" by using my package manager or just listing /lib to find out : "On my system there is /lib/libcrypto.so".

Motivation:

What's more. I believe, experienced Unix,Linux SysAdmin have seen so many ".so" files and packages that are related to, that have better intuition, which solutions are used around that programmer, who might know about programming libraries which are very rare, and be surprised about dependences his program has. I try to write program that has as less rare dependencies as possible, to make installation of package clear and lightweight. (Imagine installing small 200k program with 200MB dependencies. I try to avoid it, but using popular and lightweight programming libraries. Sometimes a few lines of code can decrease dependencies size from hundreds of MB to just a few of commonly used).

  • 2
    Your question is a bit vague. What type of question? The faq says: "If your question is a programming question, requiring knowledge of programming languages other than unix shell scripting languages, ask on Stack Overflow.". Also meta.unix.stackexchange.com/questions/314/… – Mat Feb 6 '12 at 13:32
  • @Mat updated question – Grzegorz Wierzowiecki Feb 7 '12 at 10:45
11

The help center says, as you say:

If your question is a programming question, requiring knowledge of programming languages other than unix shell scripting languages, ask on Stack Overflow.

If your question is about writing code using Unix or Linux libraries, it should go to Stack Overflow (provided it follows that site's guidelines too).

Questions about how common APIs work (say POSIX interfaces) can be on topic on U&L though. (See here for another meta post, linked from the FAQ.)

Questions about finding a library to do XYZ could be OK on U&L provided that XYZ is properly specified and detailed, and XYZ is something that you'd only do on Unix/Linux systems.
If the asker has already found/experimented with libfoo and libbar but finds specific limitations or inconveniences using those (and explains them), asking for alternatives that meet the additional requirements makes for good, specific answers that can provide long-term value.
If the library being sought is not directly tied with Unix, this type of question can be asked on Stack Overflow.

If the question is just:

What library can I use to build a GUI on <whatever>?

the answers could very well degenerate into long lists of stuff, grow out of date without maintenance from the posters, and don't really provide more value than a good set of search terms and a good search engine. Wikipedia or similar formats are, in my opinion, better for these types of general "catalog" questions. (Hence, neither U&L nor SO.)

Asking for the "best" library for anything, except for very specific requirements and after having shown research effort, either falls into the previous point, or more often falls into the "Not Constructive" close reason available on all Stack Exchange sites, and the "What kind of question should I not ask here?" section of the FAQ.
For library questions, best can't possibly be answered without actual code requirements, data-structure considerations and such, in my opinion; a list of features isn't enough.

Your example:

What are cryptographic programming libraries installed on your system?

is a "poll" question. It provides no long-term value, and the list of answers is essentially useless - why would you care if I have libSuperCrypt-42.7.so on my own system?
Fits neither U&L nor SO.
Much better to look at the environments you're looking at deploying for and checking which crypto providers they ship by default, and which ones can be installed easily.

  • Could you address another shortly another Question that comes to my mind ? "I can find UI lib for Linux that enables possibility of accessing program UI though : ncourses and graphical interface. To make uses possible to access program in Graphical environment and console like screen as well" – Grzegorz Wierzowiecki Feb 7 '12 at 12:06
  • You mean "looking for a library that allows the same program to run either on the terminal, or as a normal X application"? – Mat Feb 7 '12 at 12:14
  • I'd like to write UI code ones. Than, I'd like to choose between ncurses and X-window (can be any kind : Gtk,Qt,wxWindow,etc) interface. Choice can be made on compilation stage as well as resulting program parameter. – Grzegorz Wierzowiecki Feb 7 '12 at 12:43
  • Well, IMO that's one specific requirement, and it's pretty much tied to Unix-like systems. It could be ok on both U&L and SO, and it's not really easy to search for (not an usual requirement). That being said, it's already been asked: stackoverflow.com/questions/1256871/…, stackoverflow.com/questions/40259/gui-tui-linux-library :) – Mat Feb 7 '12 at 12:49
  • Thanks for references I have been searching for it on U&L not on SO :). However, I think it's a good example of programming-related question tied to Unix&Linux environments, to ansering which there is not required programming knowledge/skills. – Grzegorz Wierzowiecki Feb 7 '12 at 13:53
  • The Software Recommendation site also exists now. – Faheem Mitha Apr 28 '16 at 8:13
6

Going a bit further than the FAQ, a few things come to mind:

Serious answer

On Linux (and as far as I can remember, on both Solaris and FreeBSD) section 3 of the man page document library calls. Let me rephrase that, the Linux manual describes the libraries for the user to use.

Even more, Joel Spolsky wrote the following about Unix:

Unix culture values code which is useful to other programmers, while Windows culture values code which is useful to non-programmers.

I like to think of using Unix and programming for Unix as two tightly linked activities. Making users ask these questions on SO only hardens the (imho false, especially on Unix) idea that system administration and programming are two distinct categories.

Half serious answer

One word: Gilles.

I know, basing rules on one particular user is not credible, even less viable. But he's no ordinary user either. I mean who can give you the different error codes returned by 6 different shells (revealing a bug in zsh by doing so) when the system runs out of resources for a new fork() call? In 20 minutes, no less.

I doubt I'm going to get such a good answer on SO, and despite what the rules (or common sense) will say, I will naturally try to target this user in order to get the best possible answer for my question.

Furthermore, Gilles may be outstanding, but he's not the only one here to be well versed in "Unix C programming". Members here are generally well versed in the field and will provide great answers as well. (First example I ran across)

Can't we adopt a pragmatic approach and taking advantage of our existing user base instead of limiting it?

On top of that, doesn't the fact that so many members here are very knowledgeable about the topic, help prove my first point?

About StackExchange

I also know that Unix is one thing, and running a good Q&A website (let alone a family of websites) is a completely different thing. I understand the need for separating content and defining scopes. This is why I would suggest drawing the line at the man page. In short:

I suggest we tolerate library/programming questions as long as they have a corresponding man page.

(But man pages vary across Unix distributions. I know ...)

  • man is too liberal, e.g. man Moose works on my system, but I certainly don't think that it's on topic here. Basically if it's within the bounds of Unix Specified or specific API's I'm cool, but I think it's good to have boundaries between SO and here on programming. – xenoterracide Feb 26 '12 at 4:36
  • different error codes returned by 6 different shells does not appear to be as described. – Faheem Mitha Oct 18 '15 at 13:15
  • Good catch. I edited the question with the correct link. – rahmu Oct 21 '15 at 9:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .