parinfer

sekao 2017-10-20T14:15:44.000289Z

jumping into this convo late but regarding the nightcode/parinfer teaching feedback, i've heard similar things before. my own experience teaching clojure to dozens of students was that unassisted editing lead to a smorgasbord of unmatched delimiter errors, and paredit was a huge distraction to my lessons.

sekao 2017-10-20T14:16:01.000179Z

the biggest thing i learned after teaching was how philosophical it was. i was the lead java instructor across all iron yard campuses and i was surprised at how much people's teaching philosophy could differ.

sekao 2017-10-20T14:16:21.000112Z

one instructor was adamant that students shouldn't learn java with an IDE. he said the autocompletion and autoimporting were terrible for learning. i disagreed, arguing that typing imports and method names was not fundamental to programming. data structures, control flow, etc are fundamental; i'd rather focus on that.

sekao 2017-10-20T14:16:49.000080Z

another thing that is fundamental is scope, and the most important tool to visualizing it is indentation. i always annoyed my students when their indentation was wrong, b/c it prevented them from visualizing scope. parinfer fit my teaching pattern perfectly because i already was drilling them on good indentation.

πŸ‘ 2
sekao 2017-10-20T14:26:20.000579Z

i think teaching with parinfer requires a mental shift if you aren't already teaching that way. if your students aren't constantly thinking about indentation (and scope) the editing will lead to surprises. i think students should be constantly thinking about that anyway, but as i said teaching philosophies can differ πŸ™‚

chrisoakman 2017-10-20T14:40:03.000040Z

Thanks for sharing this @sekao. I'm a former The Iron Yard instructor too πŸ™‚

chrisoakman 2017-10-20T14:40:50.000062Z

I basically agree with everything you're saying re: teaching philosophies. One of the things I did in my class was get the students to use JavaScript Standard Style: https://standardjs.com/

chrisoakman 2017-10-20T14:41:44.000280Z

The before / after for that was awesome. It caught lots of little issues for them; helped them focus on the logic.

chrisoakman 2017-10-20T14:42:20.000161Z

Which - like you said - I think is the important piece.

chrisoakman 2017-10-20T14:44:28.000714Z

Fixing indentation was one of the more important things that adopting Standard helped my students with.

chrisoakman 2017-10-20T14:45:07.000326Z

"another thing that is fundamental is scope, and the most important tool to visualizing it is indentation" --> πŸ’―. Could not agree more about this.

shaunlebron 2017-10-20T16:06:07.000161Z

@elenam can you share your thoughts on why parinfer was confusing for your classes?

shaunlebron 2017-10-20T16:10:51.000675Z

my intuition is that indentation is natural because outside of programming languages, we still use indentation in bulleted lists:

1. mow the lawn
  a. rake leaves
  b. edge
  c. mow
  d. cleanup
    i. use blower
    ii. sweep the rest
2. paint the house
  a. tape the windows
  b. spray all walls
  c. paint trim by hand
3. buy a car
  a. test drive
  b. haggle
    i. mention bluebook price
    ii. don't be afraid to walk out
  c. drive home

shaunlebron 2017-10-20T16:12:36.000381Z

maybe it can be taught by placing parens on this kind of list first

shaunlebron 2017-10-20T16:14:19.000482Z

(1. mow the lawn
  (a. rake leaves)
  (b. edge)
  (c. mow)
  (d. cleanup
    (i. use blower)
    (ii. sweep the rest)))
(2. paint the house
  (a. tape the windows)
  (b. spray all walls)
  (c. paint trim by hand))
(3. buy a car
  (a. test drive)
  (b. haggle
    (i. mention bluebook price)
    (ii. don't be afraid to walk out))
  (c. drive home))

πŸ’― 2
rgdelato 2017-10-20T16:16:41.000583Z

as an aside, I'm also curious if v3 would make a significant difference in teaching beginners since there's less unexpected behavior

πŸ‘ 2
seancorfield 2017-10-20T17:33:43.000263Z

@shaunlebron parinfer smart mode seems to get a bit confused if you do certain editor operations that cause multiple edits (notably "slurp" with paredit, at least in Atom). I know this is a "known issue" but wondered whether it was more of an editor issue or a parinfer issue at this point? Is there anything I -- as a user -- can do to help? (great to meet you at Conj, BTW)

seancorfield 2017-10-20T17:35:09.000304Z

I tried turning off paredit to see if I could get along with just parinfer but the smart newline (that auto-indents) and forward slurp are just too valuable to live without them (despite the parinfer peculiarity with the latter). πŸ™‚

rgdelato 2017-10-20T17:40:29.000194Z

I still have Paredit installed in Atom, but I have all the keybindings turned off and separately have "enter" mapped to Paredit's newline in my keymap.cson (which is what I recommend here: https://clojurescript.org/tools/atom). I also have a keybinding to select the current sexp, which is nice

πŸ‘ 1
seancorfield 2017-10-20T17:42:45.000149Z

@rgdelato Yeah, I have keybindings off and just a handful of specific bindings of my own https://github.com/seancorfield/proto-repl-setup/blob/master/keymap.cson#L34

πŸ‘ 1
chrisoakman 2017-10-20T17:56:25.000383Z

@seancorfield This is arguably a bug or feature request with atom-parinfer. Is there an open issue for it?

chrisoakman 2017-10-20T17:57:22.000210Z

I don't know if it's fixable off the top of my head. Maybe a special config flag that disables Parinfer when it detects a Paredit hotkey?

seancorfield 2017-10-20T18:24:05.000233Z

@chrisoakman Doesn't look like it. BTW, I also run into this one fairly regularly: https://github.com/oakmac/atom-parinfer/issues/72 (but usually after a duel between parinfer and paredit has messed up the structure/indentation).

seancorfield 2017-10-20T18:26:30.000034Z

Created https://github.com/oakmac/atom-parinfer/issues/94

seancorfield 2017-10-20T18:27:17.000287Z

Not sure how doing paredit:forward-slurp could signal to parinfer that it should wait for the edit operation to complete before doing anything?

seancorfield 2017-10-20T18:28:45.000640Z

According to @cfleming this is a problem in Cursive too when an edit is performing that would rearrange the code independently of parinfer -- parinfer seems to try to "interfere" while the other edit is still ongoing (multi-step editing).

shaunlebron 2017-10-20T19:08:03.000295Z

I think anyone who can just port over the auto-indent newline to parinfer would be a hero

πŸ‘ 1
shaunlebron 2017-10-20T19:08:44.000037Z

that’s a big pain point that I experience every day

shaunlebron 2017-10-20T19:09:28.000232Z

parinfer is going to have problems when multiple changes are not specified in batch

shaunlebron 2017-10-20T19:12:02.000340Z

we talked about combining changes as they come in to debounce parinfer processing without breaking

shaunlebron 2017-10-20T19:12:22.000271Z

i’d put that far on the roadmap though

seancorfield 2017-10-20T19:19:29.000217Z

Then I guess as long as there's a way to switch parinfer modes so users can switch to paren mode, do their complex editing (paredit), and then switch back to smart mode, we'll be good.

cfleming 2017-10-20T21:07:29.000110Z

I don’t think it’s due to the changes not being in batch, #176 and #177 are problems where the changes are batched, but still confuse parinfer.

cfleming 2017-10-20T21:07:54.000213Z

Obviously non-batched changes will be worse, but there are bugs when batching too.

cfleming 2017-10-20T21:10:15.000010Z

@seancorfield I commented over on your issue there. One thing that can help as a user is a repro case of what you were doing, ideally minimised, but you mentioned that this often breaks undo in Atom which makes that pretty hard.

seancorfield 2017-10-20T21:44:15.000230Z

@cfleming Thanks. Yeah, now that I've actually created an issue for it, I'll try to pay a bit more attention to code where it breaks and actually set up a repro case in the issue (rather than just cursing and fixing my code and moving on!).

cfleming 2017-10-20T21:45:16.000284Z

Great, thanks - that helps a lot.

cfleming 2017-10-20T21:45:37.000168Z

I find that usually I can come up with a minimal example, but I understand the algorithm pretty well now.

seancorfield 2017-10-20T21:46:13.000400Z

I have a suspicion that it happens specifically when you try to slurp an expression that has a sub-expression that is also split over multiple lines so I'll try to keep an eye out for that going forward.

cfleming 2017-10-20T21:48:09.000030Z

I’m totally willing to believe that based on my experience, yeah.

taylor 2017-10-20T23:28:49.000149Z

big fan of Parinfer πŸ‘

πŸ‘ 2
πŸ˜„ 1