Arc Forumnew | comments | leaders | submitlogin
7 points by fallintothis 5580 days ago | link | parent

It'd be interesting if there was a pattern to hyphenated names. I assume there isn't because I just hyphenate when it seems like I "should". i.e., Names are often broken up by hyphens because they're easier to read that way. No real algorithm for that. Things like the length of the name can play a factor (e.g., expand-metafn-call doesn't run together like expandmetafncall). Now that I think of it, that's probably why Common Lisp has so many hyphens: its long names would run together otherwise. Even so, it has butlast, notany, notevery, pushnew, and the p vs -p inconsistency.

Arc tends to avoid hyphens:

  arc> (do1 nil
         (= hyphenated     (keep [find #\- (string _)] (keys sig))
            non-hyphenated (rem  [find #\- (string _)] (keys sig))))
  nil
  arc> (len hyphenated)
  103
  arc> (len non-hyphenated)
  386
  arc> (sort < hyphenated)
  (-- abusive-ip admin-gate admin-page app-path bad-newacct clean-url
  code-block code-density common-operators common-tokens cook-user create-acct
  create-handler date-nums days-since defop-raw defopr-raw disable-acct
  edit-app end-tag english-date english-time enq-limit ensure-dir esc-tags
  expand-metafn-call failed-login fill-table fnid-field gen-type-header
  get-user good-login handle-post handle-request handle-request-1
  handle-request-thread harvest-fnids hello-page hours-since indented-code
  insert-sorted load-table load-tables log-request logfile-name login-form
  login-handler login-page logout-user md-from-form minutes-since n-of
  new-bgthread new-hspace next-parabreak noisy-each parse-date parse-format
  parse-time ppr-call ppr-progn pr-escaped precomputable-tagopt prompt-page
  rand-choice rand-elt rand-key rand-string read-app read-table reassemble-args
  reinsert-sorted rem-app respond-err run-app safe-load-table save-optime
  save-table set-pw single-input space-eaters start-tag static-filetype tag-if
  tag-options text-rows text-type timed-fnid tree-subst unique-id url-for
  user-exists username-taken valid-date vars-form view-app w/link-if
  when-umatch when-umatch/r write-app write-spaced write-table)
Just from this, I see names that work well with hyphens: I can't parse createacct on first glance, hourssince & dayssince are awkward with the two S characters, responderr looks like "responder" with an extra R, pprprogn has too many similar letters jammed together, logfilename could be parsed as either "name of the logfile" or "log the filename", nof is just weird, etc. But there are names that don't strictly need hyphens: I think endtag, filltable, getuser, loadtable, loadtables, randkey, and others look fine, which indicates to me that the issue really is just aesthetic.