Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check ordering of exercises with stubs vs without stubs #279

Closed
petertseng opened this issue Apr 9, 2016 · 5 comments
Closed

Check ordering of exercises with stubs vs without stubs #279

petertseng opened this issue Apr 9, 2016 · 5 comments

Comments

@petertseng
Copy link
Member

Here are the exercises with stubs, with their order in config.json and the number of lines in the stub:

 1      hello-world  23
 2             leap  12
 3            clock  26
 4       gigasecond  10
 5        raindrops   7
 6              bob   3
 7         triangle  17
10       food-chain   3
19          hamming   3
23    crypto-square   3
30       word-count   9
36  circular-buffer   3
40       custom-set   3
61    tree-building 109
64           paasio   3
68       tournament   3
71           ledger 227

A few points of interest to me:

  • difference-of-squares, secret-handshake, do not have despite coming before food-chain which does
  • a big gap between hamming and food-chain: should hamming be moved earlier, or should its stub be deleted?
  • it's understandable that tree-building and ledger have stub files since they are refactoring-focused exercises...
  • but what about all the others that come after (my arbitrary cutoff of) hamming? And the three-line ones have nothing more than a testVersion and package name, so don't seem terribly necessary.

If the idea behind the stub files is to give people new to Go a starting point, it makes the most sense that the first N exercises would have stub files and then we can stop. So I wonder if we should close the gaps in the early exercises.

Footnote, script run to produce these results:

exercises="
    hello-world
    leap
    clock
    gigasecond
    raindrops
    bob
    triangle
    difference-of-squares
    secret-handshake
    food-chain
    house
    pascals-triangle
    series
    queen-attack
    grains
    etl
    scrabble-score
    parallel-letter-frequency
    hamming
    sum-of-multiples
    pythagorean-triplet
    bank-account
    crypto-square
    luhn
    largest-series-product
    sieve
    palindrome-products
    bracket-push
    anagram
    word-count
    binary
    allergies
    rna-transcription
    roman-numerals
    say
    circular-buffer
    robot-name
    react
    counter
    custom-set
    atbash-cipher
    phone-number
    strain
    pig-latin
    prime-factors
    nth-prime
    diffie-hellman
    octal
    beer-song
    ocr-numbers
    wordy
    nucleotide-count
    grade-school
    matrix
    saddle-points
    trinary
    hexadecimal
    meetup
    binary-search
    binary-search-tree
    tree-building
    kindergarten-garden
    simple-cipher
    paasio
    pov
    minesweeper
    robot-simulator
    tournament
    word-search
    connect
    ledger
    poker
"

i=0

for slug in $exercises; do
  i=$(expr $i + 1)
  stub=$(echo $slug | tr - _)
  file="exercises/$slug/$stub.go"
  if [ -f $file ]; then
    lines=$(wc -l $file | cut -d\  -f1)
    printf "%2d %16s %3d\n" $i $slug $lines
  fi
done
@kytrinyx
Copy link
Member

kytrinyx commented Apr 9, 2016

Interesting.

I think hamming could go earlier, and we could probably keep bob's stub file and delete all the subsequent ones unless there's a particular reason to have it.

@petertseng
Copy link
Member Author

I examined word-count's stub file. It defines a type Frequency map[string]int that is subsequently used in the tests and expected as the return value of WordCount. For now I'm going to leave that particular stub file. The three-line stub files are not adding much value and I'm going to delete them.

@kytrinyx
Copy link
Member

That sounds good.

@petertseng
Copy link
Member Author

Great, now the stub files look like this:

 1      hello-world  23
 2             leap  12
 3            clock  26
 4       gigasecond  10
 5          hamming   7
 6        raindrops   7
 7              bob   3
 8         triangle  17
30       word-count   9
61    tree-building 109
71           ledger 227

This all looks reasonable to me.

@kytrinyx
Copy link
Member

Yeah, this looks good to me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants