swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

OS X command line tools lack basic features #536

Closed stevenkoenig closed 10 years ago

stevenkoenig commented 10 years ago

As a side effect of using old BSD-licenced command line tools common command line tools such as grep lack basic features, i. e. grep is incapable of colouring output.

I have been told that Homebrew is what you would use to get the good versions. http://brew.sh/

Since I do not have OS X nor access to one I cannot work on that issue.

The first question is: do you also think that Homebrew is a good idea for use in workshops?

codersquid commented 10 years ago

I am enthusiastic user of homebrew for my mac laptop, and I use homebrew'd python on as is recommended in the hitchhiker's guide.

I have not helped with a swc workshop, but I have helped with some beginner python workshops and have run some monthly python project nights.

I've tended to let people know that I use homebrew but don't require them to do so

Asking novice users to install homebrew is asking them to make a big decision. They aren't going to understand the consequences of of choosing a package manager for osx, they might not even realize package management is a thing, they won't necessarily understand homebrew's conventions. I don't think I should be dropping all of that on someone right off.

jiffyclub commented 10 years ago

I use Homebrew extensively, but it requires an understanding of environments and paths (and libraries and package managers and /usr/local) that most of our students do not have even after a boot camp. I'd be against making a Homebrew install a prerequisite of a boot camp.

jkitzes commented 10 years ago

Agree with @jiffyclub on not having Homebrew as a prereq.

That said, I've thought before that it might be a good idea for us to have an SWC lesson that focuses specifically on package managers - what they area, why they're useful, and how to use them. Could be an addendum to the shell lesson, for example, to be used in longer bootcamps or ones more oriented around the command line. Homebrew would be an option, as would just teaching pip or conda for example.

jiffyclub commented 10 years ago

:+1: to supplementary lessons, thought there are quite a lot of bases to cover.

wking commented 10 years ago

On Mon, Jun 09, 2014 at 01:52:06PM -0700, Justin Kitzes wrote:

That said, I've thought before that it might be a good idea for us to have an SWC lesson that focuses specifically on package managers

  • what they area, why they're useful, and how to use them.

I'd think it would be great to have folks write their own Python package (or R, or whatever), and then use pip to install it. Talk about PyPI (or whatever R uses), and how they can push to it, once they have their own package written.

However, I don't think it makes sense to be doing that in the first workshop, with folks who have just learned about for loops and functions. Maybe if we have a sysadmin-track instead of a programmer track, and we drop all of the “how to write your own software” in favor of “how to publish, install, and use already-written software”? Alternatively, the sysadmin-y stuff could come a few months after the initial workshop, after the initial lessons have had time to sink in.

Language-specific package managers only take you so far, though. It's probably worth touching on the traditional configure/make/install, and then splitting folks off into groups by package manager (APT, yum, Portage, Homebrew, whatever folks can find for Microsoft, …). Otherwise it's all going to be a bit vague and theoretical.

rbeagrie commented 10 years ago

@jiffyclub "it requires an understanding of environments and paths (and libraries and package managers and /usr/local)" +1 to this, also if anything goes wrong it can often require interpreting error messages from Make. Any time I try to help a novice install some new software (especially on Mac) I'm astonished by how many different things you often need to know. I definitely think a lesson or series of lessons are a good idea but it will be hard to really tease out all of the assumed knowledge...

gvwilson commented 10 years ago
  1. @jainsley gave a short lesson on creating R packages at the Toronto bootcamp in May - my feeling is that it was much too advanced for most learners.
  2. @embray gave a lesson on creating packages in Python at STSCI last fall to an intermediate audience - @embray, any thoughts on how that went?
jainsley commented 10 years ago

I agree with @gvwilson about a package creation lesson being too advanced. In our bootcamp, there were 2-3 more advanced students where package creation was the only new thing they learned, but for the other students it became a mess of not having the right versions of software installed to get the lesson to work properly.

embray commented 10 years ago

At the time I felt it went quite well. I'm not sure how many people who sat in on that lesson actually made use of what they learned though. Somewhere I have lecture notes I wrote for that that I've (still) been meaning to clean up for a general SWC lesson. In any case it was still considered for an "intermediate" audience consisting of people who have already been using Python on a day-to-day basis.

codersquid commented 10 years ago

@embray I am interested in the lesson. I think lessons on how to package and when one would want to package would be valuable (intermediate skills?). You could talk about re-use and reproducibility too.

stevenkoenig commented 10 years ago

Are there other ways for OS X users to get more feature-rich versions of ls, grep & co.?

jiffyclub commented 10 years ago

In the context of a boot camp, is it all that important that they do?

wking commented 10 years ago

On Thu, Jun 12, 2014 at 11:37:56AM -0700, Matt Davis wrote:

In the context of a boot camp, is it all that important that they do?

I agree that using the stock utilities (even if they're old and wimpy) is the way to go here. Maybe OS X doesn't come with stuff as pretty as the GNU tools, but they should be POSIX compliant, and that's all we should need for a half day of “welcome to the shell”.

stevenkoenig commented 10 years ago

I like to show people that it's not all about deciphering white text on black background, but that you can colour things up a bit to make it easier to distinguish stuff (ls --color). I find this especially important when people are toying around with regexs and I want to show them which part matched.

Since concensus here is to use the stock utilities I close this. Thank you all for your input, I appreciate it very much.

jiffyclub commented 10 years ago

The classic example for Homebrew is wget, other neat things like ls --color could be great in an online lesson.

(BTW, ls -G will color output on a Mac.)