Week 5 at an Unbootcamp

My fifth week at Learners Guild is coming to an end. Efficiency and internationalization were among the topics I worked on. I also needed to figure out how to deal with a reluctant teammate.

“Cycle 46” is ending today at Learners Guild. Each cycle lasts a week. For me, this is week 5. Cycle 46 is a 4-day week, because of Memorial Day, so there has been a bit of pessimism in the air about whether the Learners would have enough time to complete their various projects. But not much. The Guild reminds us not to over-focus on our completion statistics.

Week 5 was my first encounter here with rejection. The Algorithm gave me my first-choice Goal to work on, together with another Learner, but he had not voted for it or, in fact, for any 2-person Goal. He wanted—desperately—to work on a 1-person Goal and asked me to give up my assignment so he could get a Goal that he wanted. It was, he said, part of a self-designed curriculum. I didn’t have the authority to change my assignment, but the staff does. I agreed to go along with his plan. The staff probed him for justification, but gently, and he didn’t yield, so the staff reassigned us—me to a 1-person Goal that was on my agenda. An agreeable outcome from my perspective: I’ve been spared during this 4-day week from negotiating roles with a teammate, and particularly with a reluctant and perhaps resentful one.

Is it beneficial for the Algorithm to impose its unknown rules, including some inevitable unpredictability, as it accepts or rejects the Goals that Learners voted for? Welcome to the real world. I have to assume that I, too, shall find myself some weeks working on Goals I haven’t voted for. So be it. We’re learning to do work that the world wants done (and is willing to pay for). The Algorithm is my boss, and bosses can be tempermental. We need practice in accommodating that.

I managed to complete the specifications on Thursday morning, so I had time to extend the project. Among the topics I explored further were execution efficiency and internationalization.

What’s most efficient isn’t obvious at first glance. Suppose you want the computer to inspect a sequence of characters (i.e. a “string”) and report whether it satisfies some criterion. The criterion posed in this case was whether the string is a palindrome: a string that is identical to its inversion. For example, “pool” is not a palindrome, but “poop” is. How can you instruct the computer to check this efficiently? One answer is: Tell it to make a inverted copy of the string and then to report whether the two strings are identical. It turns out that this is not the most efficient thing to do, at least in JavaScript.

  • If you think about it, you can see that this method requires the computer to do twice as much work as necessary. A comparison of “pinonip” with its inversion, i.e. “pinonip”, compares “o” with “o” once, but compares “p” with “p”, “i” with “i”, and “n” with “n” twice each. But checking the first 3 characters is enough: if “pin” is the same as “pin”, then the full string must be a palindrome. Any non-palindrome, such as “pinonap” (inversion “panonip”) will be detected within the first 3 comparisons.
  • Once you decide to compare only the first half with the second half’s inversion, how do you do that? Inverting the second half and then checking whether the two half-strings are identical is one method. But it turns out to be inefficient. It requires creating a new string. Another option is to compare the existing half-strings character by character, counting forward in one and backward in the other, using a “loop”. That runs faster. On my computer, it runs about twice as fast. To answer this question empirically, I needed to run my program on a string about 10 million characters long; much shorter strings were processed so fast that it was hard to measure the difference.

As for internationalization, the Goals I have seen so far are agnostic about the multiplicity of scripts, and they seem to reflect a tacit assumption that text is always in the Latin script and limited to the printable subset of the ASCII character set (roughly what you see embossed on the keys of a U.S. keyboard). The palindrome problem’s specifications told us to remove spaces and punctuation marks from the string before checking whether it is a palindrome. It also told us to convert all upper-case characters to the corresponding lower-case ones. Its sole example was limited to ASCII characters. I made my solution international by defining “spaces and punctuation” as all characters other than those classified by the Unicode Standard as “letters” and “numbers”. To make JavaScript implement those categories, I installed a package named XRegExp in my project. Some programming languages do that without extra packages, but JavaScript, in its current version, still needs that external tool.

The help I received from more expert personnel here included answers to my specific questions when I failed to find them on my own, but also suggestions that went beyond answers. A suggestion like “I think your solution is not as efficient as one that loops through the existing strings” was enough to send me on my way investigating the issue. Formal instruction this isn’t. My hunch is that it is more effective. For one thing, I never doze off during it.

5 thoughts on “Week 5 at an Unbootcamp

  1. I’ve been following your blog as I’ve been looking into applying to TLG and you have the most comprehensive summary of your experience so far, so thank you.

    Interestingly enough, I came upon this tweet tonight, and remembered that you wrote code to solve a similar problem. https://twitter.com/fermatslibrary/status/875340896379817984/photo/1
    I thought I would share.

    I’m looking forward to hearing more about your experiences as I’m a bit on the fence what with the varying reviews of the quality of the program. Best of luck!


    1. Thank you, Diana. It is good to know that these notes are useful as you consider your options. I wonder what the week-6 entry does to influence your position on the fence. The folks who run the Guild are, themselves, dissatisfied with its efficacy and intent on making it work better. More old-time Learners tell me it’s getting better than tell me it’s not as good as it used to be. Even if the Guild, like most startups, fails, I enjoy my experience here and find myself becoming fluent in the JavaScript ecosystem. I consider almost all of my time here well-spent. Anyway, applying is free, and the application process teaches you a lot, all by itself.

      1. Yes, I’m looking forward to the application process once they open up. Incidentally, do you know how many cohorts have gone through before you, and of those, how many students have found work?

        1. Learners began enrolling in July 2016. There have been 5 cohorts, followed by a few weekly groups. The Guild found that enrolling 20 or more Learners at once was too stressful for the onboarding system, so began enrolling smaller weekly groups in April. The first cohorts were recently offered 6 more weeks, in recognition of them having undergone changes and deficiencies in the system. Only in the last couple of weeks have I seen some of the earliest enrollees saying (emotional) goodbyes to their colleagues as they head off for jobs or job searches. It seems too early, though, for reliable placement statistics.

Leave a Reply to Diana Cancel reply

Your email address will not be published. Required fields are marked *

Edit translation
Machine translation (Google):
Copy to editor
or Cancel