Learn a Programming Language Faster by Copying Unix
61–70 of 110 posts
Re: Learn a Programming Language Faster by Copying Unix
#62For learning functional programming languages, Project Euler[1] is a really great resource. [1] - http://projecteuler.net/
Re: Learn a Programming Language Faster by Copying Unix
#63My favourite way to learn new languages & platforms was implementing a du-like ('disk usage') tool. It was also the exercise I proposed to my students. It doesn't require complex algorithms but touches a lot of the basics: recursion, filesystems, command line parsing, output formatting, etc.
Re: Learn a Programming Language Faster by Copying Unix
#64It can be fun if you try to put your own spin on things, though with diminishing returns.
Edit: also https://github.com/darius/sketchbook/blob/master/regex/grep....
Re: Learn a Programming Language Faster by Copying Unix
#65Your ruby version of cat implements none of the command line switches. I learned C by going through the FreeBSD code and helping with POSIX compliance. For fun I would implement a lot of the commands in Python. You get the most out of learning both the language and UNIX by implementing all the command line options.
And you get a better grounding in the Unix philosophy if you omit the command line switches and make small utilities to handle those cases, because as the paper said, cat -v is harmful ( http://harmful.cat-v.org/cat-v/unix_prog_design.pdf ).
Re: Learn a Programming Language Faster by Copying Unix
#66Earlier quoted context omitted.
And you get a better grounding in the Unix philosophy if you omit the command line switches and make small utilities to handle those cases, because as the paper said, cat -v is harmful ( http://harmful.cat-v.org/cat-v/unix_prog_design.pdf ).
The Unix philosophy is somewhat of a myth. http://cm.bell-labs.com/cm/cs/who/dmr/man12.pdf shows that that same first edition already had a -t option on ls. Surely, that should have been some | sort, but AFAICT, they did not bother to write that until some later time.
Re: Learn a Programming Language Faster by Copying Unix
#67Can someone give a non-expert way of going about this learning method? For instance, what are your options on Windows or Mac? And are the languages you can do this with limited to Ruby, Python, or Javascript?
On Windows you can install Linux in a virtual machine, or you can install Cygwin (which is basically an almost complete POSIX system on Windows).
You can use your preferred programming language to implement any of these tools: Ruby, Python, Perl, Scheme, Common Lisp, C, C++ ... The original Unix implementation of these tools was done in C.
Re: Learn a Programming Language Faster by Copying Unix
#68Re: Learn a Programming Language Faster by Copying Unix
#69The example code for cat is only half of cat, which reminds me of Rob Pike's criticism of "cat -v"---Unix programs are often more complicated than they arguably should be, are "reimplementing" Unix programs often means implementing a small subset of the features. Or, look up the manpage for your locally installed "tree" and see how many non-standard options and features have been bolted on. I think it would be helpfu…
Re: Learn a Programming Language Faster by Copying Unix
#70The project seems to be sleeping, although there are many contributions:
http://search.cpan.org/dist/ppt/