2

I work with new programmers a lot in my day job. The PATH variable in Unix (and Windows to a degree) is a source of huge confusion.

  1. If you run a program and get x: command not found, it's not clear to newbies why the command was not found or where the terminal was looking. Especially if you just downloaded or installed something and expect that it should run.

  2. You can add things to your PATH with export PATH=blah:$PATH and things start working, then the changes are gone the next time you boot up your computer and it's not clear what broke or how to fix it (remember, when you are getting started you get a ton of errors and try a ton of different things to fix them, with varying degrees of success).

  3. Relative file paths (eg ./, tests/executable) are not solid concepts for newbies, and any tutorials that reference relative file paths and are run from the wrong relative location will fail.

  4. The whole idea that the first argument in a command is the executable, lives somewhere in the filesystem, and can be retrieved with a command like which is not intuitive, and could use some explanation.

I've done some searching on SO and on Google and haven't found a great, canonical answer to these questions that's directed at newbies. I would love it if Stackoverflow could host the answer to all of these questions in one place. I did ask the question: https://stackoverflow.com/questions/13815966/what-is-the-unix-path-variable-and-how-do-i-add-to-it and it's getting downvoted to hell.

Would appreciate your thoughts.

3
  • @AzizShaikh - That's a great point, and you should post that as an answer.
    – jmort253
    Commented Dec 11, 2012 at 8:38
  • Hi Kevin, as an aside, if the question gets closed, go ahead and edit it anyway and then flag it for moderator attention. Good luck! :)
    – jmort253
    Commented Dec 11, 2012 at 8:43
  • Related: Should SO host howto-style writeups after all?
    – Pekka
    Commented Dec 11, 2012 at 13:48

4 Answers 4

5

I did ask the question: What is the Unix PATH variable and how do I add to it? and it's getting downvoted to hell.

The details and context that you have added in this post (on Meta Stack Overflow) should have been added to your question on Stack Overflow. In 30 minutes you got just 2 downvotes, reason being that the post seems like that you have not done any research. Edit your post and add details. You've got 4 detailed answers by now.

More importantly, keep in mind that Stack Overflow is not a tutorial site but rather Q&A site for well-defined and specific programming questions. From your comment: I want something I can link new command line users to it seems like you are trying to build a FAQ of sort about PATH variable.

3

Stack Overflow gets a ton of questions per day, and many are low quality questions or questions where the motivation for asking is not very clear.

Aziz makes a great point about how to prevent your legitimate question from being viewed as low quality, or at least manage the risk somewhat. Explain in the Stack Overflow post what you explained here! In this case, your research involved observing that new users continually stumble over the same roadblocks, and your research hasn't yielded a quality canonical answer, at least in your opinion.

As it stands, your question appears on the surface like one where no research was done, and these questions are generally hard to answer because the askers that don't put in effort will typically keep trying to ask more and more follow up questions in the comments, which tend to drain those kind souls who simply wish to help others. So many users tend to avoid these types of questions so they don't become the victim of a help vampire.

Again, I don't think that describes you or your intention, but that's how it may have been perceived.

So, edit your question to make the problem crystal clear. Explain why you are asking, and be sure to present it as a problem that needs to be solved. Just try to avoid making the question too broad or turning it into a "list-of" scenario.

With that said, I can't guarantee your edits will make this a constructive question, but this will surely help. Good luck! :)

1
  • +1 for "help vampire" alone :)
    – trojanfoe
    Commented Dec 11, 2012 at 11:20
3

I have a problem with this question being asked on stackoverflow.com given setting $PATH is something a non-programmer would frequently want to do. I think the question belongs on one of the non-programmer sites.

I understand that $PATH relates to the UNIX shell which can be considered a programming language, but most of the time the shell is used interactively, and not for scripting, and in fact all of the examples cited in the question relate to interactive use.

1

The problem is that some "new" programmers have no clue about life beyond the IDE. A solution is th let them work command line only for a few days/weeks, that will teach them a lot. And of course:

  • use simple text editors without syntax highlighting
  • make files
  • no integrated debuggers

Hard yes, but you learn fast and you know more about the inner workings which will prove invaluable for the remainder of your professional life.

You must log in to answer this question.

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