HNHacker News
TopNewBestAskShowJobs

theOnliest

360 karma · joined April 14, 2013

Writing Perl at FastMail/Topicbox/Pobox. www.mcclimon.org
submissionscomments
theOnliest··on An experiment-driven guide to Perl
Sorry, I meant I'd never seen it called the second way (nested parens). I also haven't seen the no-parens version, which looks really bizarre!
theOnliest··on An experiment-driven guide to Perl
That's true, but I've never actually seen anyone call 'has' like that. Plus, Perl's behavior on lists makes sense (always flatten) if there's no mucking around with prototypes, so that's much less confusing than the behavior in the article.
theOnliest··on An experiment-driven guide to Perl
I guess I really meant "is baffling without a thorough understanding of context." I feel better about looking up the + now that I know you did too, though! I don't think I've ever seen code like that in the wild, and I've never seen a Perl programmer attempt to call a sub with nested parens, like what_are((1,2),(3,4)) before.
theOnliest··on An experiment-driven guide to Perl
> In Perl, there are three contexts in which an expression may be evaluated.

> 1. scalar

> 2. array

> 3. void

There's actually no such thing as "array context" in Perl; instead there's "list context". An array is a list that's been stored in a variable (this is a fairly common mistake).

See http://friedo.com/blog/2013/07/arrays-vs-lists-in-perl and http://perlmaven.com/scalar-and-list-context-in-perl for good examples/discussion.

EDIT:

Posted this before I finished the article. Understanding the difference between arrays and lists makes the following potential WTFs a lot clearer:

    sub take_two_arrs (\@\@) {
      print $_[0], $_[1] ;
    }

    take_two_arrs @a1, @b1 ;         # prints ARRAY(0xAddr) ARRAY(0xAddr)

    take_two_arrs ((1,2),(3,4)) ;    # error: arrays must be named
The second doesn't work because the prototyped function takes array references, not lists. It would work if you called it like this:

    take_two_arrs ([1,2],[3,4])
  
I'll admit that this is baffling.

    sub what_are (++) {
      print $_[0], " ", $_[1] ;
    }

    what_are ((1,2),(3,4)) # prints 2, then 4
(This is part of the reason that Perl programmers don't use prototypes very often.) perlsub warns:

> When using the + prototype, your function must check that the argument is of an acceptable type.

The plus here forces scalar context on the arguments, which are lists (not arrays!), so they return their last elements. This would work how the author probably wants if called like this:

    what_are ([1,2],[3,4]);   # prints ARRAY(0xAddr), ARRAY(0xAddr)
theOnliest··on Linode CLI
Why not also release to CPAN? It would make managing the dependencies easier for those not installing the packages from homebrew/apt.
theOnliest··on The worst thing about CoffeeScript
I think cursork was talking about 'use strict' in Perl; he said that everyone uses it. 'use strict' in JavaScript is much rarer than it is in Perl, at least in my experience.
theOnliest··on Best Paper Awards in Computer Science Since 1996
I'm not sure how far afield from CS you actually want to go, but the list for music theory is at http://societymusictheory.org/archive/publications.
theOnliest··on Why Emacs is a better editor – case study for JavaScript developer
It's in the history printouts.
theOnliest··on Vi Hart: cramming G+ into YouTube has made comments even worse, I'm leaving
I'm not a heavy YouTube user, but I think I'm in a similar situation. If I am on YouTube I often want to read the comments (I have no moral problem with any of them), but if I'm searching for something on Google I don't usually want a bunch of spam/porn/whatever gets filtered by SafeSearch in the way of what I'm actually searching for. When I search I'm looking for something, and when I'm on YouTube I'm usually wasting time...they're very different use cases.
theOnliest··on “I Quit Academia,” an Important, Growing Subgenre of American Essays
The value-add to taxpayers is much less concrete in the humanities. My argument was that research in the humanities is essentially done for the sake of doing research: to learn more about the world and the people in it. It is hard to see definite, monetary benefits, which is one of the reason arts/music/creative writing programs are being slashed cut in favor of match/science in primary education in the US.

The benefit of studying the humanities is one of personal edification. Students who study art or music in school are likely to be more disciplined and score better on standardized tests than their non-musician/artist colleagues. Not to mention, young students who have a strong background in the humanities are often happier with their quality of life (I know that music was the highlight of my day/week when I was in school).

A patronage program would be great for this type of degree...if any VCs out there want a personal music theorist I'd be happy to apply! My argument is that it is traditionally universities which have been the patrons of these degrees. This goes back at least to the earliest universities in Europe, where students learned the seven liberal arts: grammar, logic, rhetoric, arithmetic, geometry, music, and astronomy. The idea of the university was not to churn out good economic workers (as it tends to be today) but to produce well-rounded human beings. We in the humanities still think this is a worthy goal (and consequently, tend to make much less than our STEM counterparts).

theOnliest··on “I Quit Academia,” an Important, Growing Subgenre of American Essays
This has been my experience as well. I went to a small liberal arts college for undergrad. My teachers there did very little research, but all taught their small classes by themselves with no TA.

My particular field (music) tends to be much more expensive per student since private lessons must be taught one-on-one. One physics professor could teach 15 students for three hours a week, but a piano professor needs essentially needs 15 hours to teach each of those students for one hour a week. Some of this work can be done in small groups/classes, but higher music education is much more individual.

Some of my colleagues who have graduated now teach at liberal arts schools where their tenure requirement is essentially one presentation at a regional conference or one publication, with a strong record of teaching. Compare this to a large institution, where the expectation has traditionally been that you need a book deal in order to obtain tenure, whether or not you're much good as a teacher of undergraduates.

theOnliest··on “I Quit Academia,” an Important, Growing Subgenre of American Essays
> Do we really need more papers on Ancient History, or should we invest the same money in better teaching?

This seems to me like a pretty dim view of the humanities in general. Research in the humanities is not in the same category as research in Computer Science, for example; there is often little to no free-market value. People who enter the humanities tend to do so (at least in my experience) because knowledge for the sake of knowledge is something worth pursuing. Your next company might not make a fortune knowing more about agricultural practices of the ancient Macedonians, or the concept of fatherhood in the music of Robert Schumann, but people doing that research aren't doing it simply "to advance their career," and not necessarily just to teach new people how to research either.

It has traditionally been the function of universities to foster this sort of research, as a general goal of "making the world a better, more knowledgeable place." It's a societal goal that goes way back: people say that humanity was set back something like 1000 years when the library at Alexandria burned down. This type of research doesn't fit neatly into any of your categories, and it is (I think) a more trenchant problem. Disillusioned humanities PhD's often have problems finding work in the "real world," since companies aren't keen on hiring someone who knows everything there is to know about Macedonian agriculture.

-- a fairly disillusioned Ph.D. student in Music Theory

theOnliest··on Perl 5 + Perl 6 = Perl 11
It would be nice if it actually said this on the page. I had to poke around for several minutes to figure out what this project actually was, and I'm a Perl person myself.
theOnliest··on Taking PHP Seriously [pdf]
I work in a large educational institution, using PHP and MS SQL Server, and I can't convince the sysadmins to install PDO because the SQL Server PDO bindings have a big red EXPERIMENTAL sign on the page (http://php.net/manual/en/ref.pdo-dblib.php). So I'm stuck using 'mssql_' functions, I'm afraid.
theOnliest··on Show HN: Mr. Poole - A butler for Jekyll
I'm not sure I follow...how did moot.it end?
theOnliest··on Show HN: Mr. Poole - A butler for Jekyll
Ha! It seems like the obvious name if you're going to write a helper application for Jekyll. Most of the things I saw poking around were to generate scaffolding, which Jekyll can do by itself now.

I was annoyed with manually moving files around, so obviously the solution was to spend many more hours than I ever would have spent doing that writing this instead.

theOnliest··on GCP - cp with a progress bar
I'd recommend "pcp," for "progress copy"...I'd use it for the name alone!
theOnliest··on GorillaScript
Perl 6 does...I can't recall anywhere else, though.
← PreviousPage 4 of 4