100 Days of Code: mappin

Such a wee snippit, but I fulfilled my goal. I made sammiches by mapping over an array of meats and adding concatenating little bun strings. I think in this case, the proper term is mayonnaising. 

var meats = [‘hamburger’, ‘roast beef’, ‘pulled pork’];

function makeSammich(){
 return meats.map(function(val, i){
   console.log(“bun ”+val+“ bun”);
 })
 return
}                  
makeSammich();

100 Days of Code: Baby Boolee

I did it. I grasped playing with the Boolz. I didn’t have much time, but where there’s The Googles, there’s a way. 

I did not see that the secret was nesting. It’s not really a secret. I just didn’t see it. And I couldn’t grasp the organization. All that nesting … And I was trying to deal with both yes and no. I now realise that I need to focus on one direction and not build out the yes and no side. Okay, true and false, but my idea I’m working on is yes and no. Work with me. 

I became caught up in “If (yerp) {then yerdly derdly turdly}”, “else {then scooby dooby booby}. Focus! Chose one path, young dev-hopper. When I get to the end point and want to build out the else, then I can, but not at the same time. 

I have also decided to do 100 Days of Code. My rules are just to start and finish in a day; therefore, these will be wee snippets. I will allow myself to work on bigger things, but for this challenge, I will have little codelettes. Functionleins. Loopitas. They’ll be examples for me and not a foo feckin’ bar or “Hello, World” in sight.

Day 1/100: Baby Boolie:

Boohooleans

Ima strugglin’ with knowin’ vs. doin’ vs. playin’.

I know what booleans are. Fecking ex-maths teacher. 

I know to return true or false when I need to. This is not hard. Do I always remember? No. But I know I have to do it. I also know that I have to watch what I eat, and I certainly don’t always do that. And put down those greasy fries, you judgmental git. 

And this is still what I think of when I see git or github. And just once I’d like to write “connected series of statements intended to establish a proposition” in lieu of “args” just once. 

But back to the issue at hand: booleans. I know; I do; I cannot play. Playing is not the same as knowing. I know about fire. I do not play with fire. Not literally. Figuratively and metaphorically, I’m all about the fiya!

I am still trying to figure out how to take my idea in my Brians to the console, but I can’t let that stop me from mini-coding. 

I’ve learned a lot in two months. I’ve learned a lot about coding as well as my own psyche. The problem with learning a lot in a short amount of time is that what you’ve learned gets quasi-forgotten. It does at my level. I am sure classmates with previous coding experience do not have the same problems, but I was as experienced as a zygote before enrolling. 

While I finish the course, I decided to do mini-functions (I funkin love functions, ajax can suck it!) to keep things I’ve learned fresh and maybe even get some keystrokes memorised.

Playing with the basic if-else-if and sassing my computer at the same time:

image

At least when I struggle with the new, I enjoy playing with the old. 

ABCs

[original post: 6 April 2016, latest edit: 23 April 2016, more added 29 August]

When I taught, my students and I loved ABC books. Not the kid written by committee. Not the kind that drive me nuts with B is for Bird and later D is for Duck. A duck is bird, dammit! We liked clever ones. And to make our own was also great fun: ABCs of geometry, ABCs of the animals in South America.

I’m still determined to tackle coding with mini battles along the ABCs. I have played with arrays and am still building my boolean project. While I am at it, why not make my list? Some will be repeats because they’re parts of other wholes (keys, objects), but I’m not where I turn my nose up at repetition. Open-toed sandals and tube socks, however …

A: array, AJAX

B: boolean, backbone, buttons, bang

C: constructors, callbacks

D: do-while

E: event handlers

F: functions (in general), for-loops, forms, forEach, Flexbox

G: gulp

H

I: if/else if, iterate, ice cream (as coding assistant)

J: jQuery, jQueryUI

K: Keep-It-Simple-Stupid vs Katy-Is-Super-Sizing

L: loops (in general)

M: matrices, Math dot, methods, .map

N: Node toots

O: OOP

P: .push, position(relative, absolute, static), props(/state), Perk fun

Q: querySelector

R: .reduce, React, radio buttons

S: strings, state(/props)

T: test-driven development, transitioning

U

V: var — in CSS

W

X

Y

Z

Add to and build as I go.

Var-nelle, Let-icia, and Const-ance

Var-nelle, Let-icia, and Constance are three sisters, the daughters of Ecma. Var-nelle is the oldest; Let-icia and Constance are twins, but look nothing alike. 

Var-nelle, although fetching in kicky sportswear, is the less secure of the three. A little wishy-washy, she easily allowed herself to be reassigned, unlike her bullheaded younger sister Const-ance, who once assigned, stayed assigned. Const-ance changes for no one once assigned. Don’t try to add to her or make her increase. She won’t do it. Don’t bother asking. Once her mind is made up … She’s a real pain in the ass at Thanksgiving and around Election Day.

Var-nelle is most like the bright and sweeter Let-icia (who smells like sunshine and lemons, by the way). Like Var-nelle, Let-icia is happy to be reassigned and rewritten, but they’re very different in their scoping. If the two of them are in a function block, you can’t really tell them apart. They are both visible as long as they’re playing in the function block. You can see them. They can see you. 

In smaller enclosing blocks, their differences appear. Let-icia can concentrate and remember what she’s doing, so whatever she’s doing in that smaller enclosing block is what she’s working on. Her head’s down doing her thing, concentrating, looping, and she cannot be seen outside of that block. Not so our garish Var-nelle. Are you kidding? She can be seen and heard in the for-loop and on either side of it in the greater function block. Some say it’s her personality as the first born. She had to do it all as she was the only option. I say it’s her shocking red hair and her flirty nature. Var-nelle’s been around the block and has no wish to rein herself in. Gawluvver. 

K.I.S.S. vs K.I.S.S.

It’s Keep It Simple, Stupid vs Katy Is Super Sizing, as I knew it would be. Backing away from my laptop and Sublime and returning to pencils, paper, and the whiteboard. 

Grrs: Idea blowout, keeping this about booleans, figuring out the best way to display questions and answers. This is my exercise for me. Eventually, I’ll give a rat’s arse about how the user feels, but right now, I’m both the user and the dev. It’s all about meeeeeeeeeee. (eeeee). 

Whees: I’m having fun.

Boo-ya-lean

How you been? I been boolean. Boo. Booya. Boo boo be do. 

B is for Boolean

As promised to myself, I’m working my way down the alphabet to tackle coding in bite-size bits. Booleans bore me. I don’t think I’m giving them credit. They’ve just been there as necessary tools to determine if user input is valid or not. Maybe they’re not boring, but I am. I’m not playing with them. I am not appreciating their potential outside of enjoying the way “boolean” sounds and looks. 

Now, what to build? Build your own limerick? Choose your next genre to read? Fill a messenger bag? Lady’s maid / gentleman’s valet? I see that the challenges are to not balloon out of control with options. K.I.S.S. usually means “keep it simple, Stupid”; however, in my world, it ends up meaning “Katy is super sizing”.

Task: Build a basic sumpin that lets me practice booleans. (see last para)
Tools: y/n questions, options for t/f, flow charts from Draw.io, dry-erase tablet.
Due: 15 April 2016 [updated to reflect frustration and reality of tax time.]

Trifecta of good luck with that.

Physically, I am an only child. Mentally, my parents got triplets: ADHD, anxiety, and depression. 

Oh, an array! 

Although I am a contemporary American, I do not go to the pharm for help much. I suffer through headaches until it’s unbearable. I deal with my tennis elbow by bitching about it and not taking anti-inflams. I do not have a medicine cabinet for myself (my pets however …). I made a deal with my faculties: for one i—WAIT! I smell a for-loop:

Let’s see if it worked. 

Of course, it worked. As if I’d bore you with the screenshots of my little angry red notes. It eventually worked, but the road to hell is paved by adverbs; therefore, IT WORKED! “Eventually” omitted. (I should put the first two in a sentence, but then that would be getting into obsessing.)

Symptoms of adults (anyone?) with ADHD are as follows (thank you, Mayo Clinic):

Trouble focusing or concentrating
Restlessness
Impulsivity
Difficulty completing tasks
Disorganization
Low frustration tolerance
Frequent mood swings
Hot temper
Trouble coping with stress
Unstable relationships (with humans. I’m awesome with pets!)

I eventually get there, but in every endeavour, I struggle to find out how I can be the best Katy I can be. The start is always hard. Organising my thoughts, not allowing myself to become my own worst bully, and not spitting the dummy and saying that I’m too dumb for this when I can’t get something in what I think is the appropriate amount of time.

I won’t take ADHD meds; I’d rather figure this out. I won’t take anti-anxiety meds; I rather just not deal. But I will take vitamin Z so that I get out of bed to deal with the first two and the rest of life’s arrows slung at me. And when I need it, I am learning to ask for help. 

At least now when I’m distracted when my coding homework gives me the shits, I play with code outside of my homework. Yes, it is off topic, but it is better than online shopping or a ride to a bakery.

Tools I’m using to help:

  • Vitamin Z (Sertraline)
  • Code for me
  • Apps for staying on task and organised

Things people tell me not to do, but I ignore:

  • Getting off caffeine. 

Being off caffeine doesn’t keep me more focused. It just makes my jumps slower. If I jump away slower, then I jump back slower. Rather ping than lurch.

Whew. That shit is off my chest. Time to bitch slap my coding demons. Or at least sass them with arms akimbo.

Div, div, and array. Around the corner function’s made.

Now stick those words into this classic:

A is for Array

Muscle memory. I don’t have it in coding yet. It’s getting there, but too often I forget the ( )s, { }s, or mix up when to use a comma and when to use the semicolon. Some of this is because of my background in editing and proofreading. No space between console.log and the opening parentheses? You’re killing me, Smalls. 

Without the muscle memory, I am spending too much time thinking about the syntax and not the logic needed, plan of attack, or where I could get a decent slice of chocolate cake in south Austin. While I’m learning to code, I’m going to make myself go back to what I already know in theory, but don’t have in muscle memory. 

This leaves me with a bunch of tools that I know the names of, but don’t remember to use or sometimes use inefficiently. I’ve grabbed a bangy thing to get a twisty thing into a piece of wood. I eventually remember that I do not use a hammer with a screw, but in a fast-pace coding school, I don’t think I’m starting projects correctly or efficiently. So, where to start?

Arrays. I can make them, but I forget to use them or am so full of anxiety about completing an assignment on time, that I barely remember how to spell array, much less use one. The alphabet starts with A, so why not start here?

Task: build a basic haiku builder using arrays
Due: Tuesday 29 March 2016 [update: done]

Moto as learning metaphor

(a quasi-apology for temporarily hating my coding instructors)

I’m 48. I’m two dozen years old. If this is half of my life, we’re talking about living to 96. I have no plans for that, so my life is half way over. Closer to dying than birth, but birth is kind of messy, and being a baby looks boring. As long as I keep trying new things, aging is adventurous and gives me more time to learn.

And to fail.

When I was 46, I took my motorcycle safety foundation (MSF) Basic Rider I course. Me go, girl. Unfortunately, the job that was going to afford me my first motorcycle fell through. I had the M on my license but not moto in my garage. 

On February 14, 2015, ten months after getting my license, which I got learning on a glorified scooter, I bought my first motorcycle: a Honda CB500F. After I bought it, I threw my leg over, fired up the ignition, then looked at my salesperson and said, “Oh, fuck.” This motorcycle was a lot more powerful than the glorified kiddie-scooters we had in class.

Thanks to a friend with a motorcycle trailer and decades of riding under his belt, I got a little tutoring before having it delivered to my house, where I named her P.J. Soles. I ended up with just enough re-learning to get me out of my driveway and around my neighborhood to practice. 

Then I crashed. I was practicing left turns. No big deal in a car; your arms turn the steering wheel this way or that way, and the gas and brake are under your right foot. On a motorcycle, when you turn left, your front brake and throttle are going away from you. It’s an awkward feel, and I wanted to practice it. First left turn. Sweet. Second left turn. Sweet. I GOT THIS! Third left turn? Too much throttle, I’m freaking out, forgetting to engage the clutch, and I speed across the T-intersection, pop the curb and crash into a parked car. Bonk. Damn. Fuck. 

I couldn’t lift my motorcycle. I felt like an impostor. I am forever grateful that the owner just laughed it off and didn’t want me to pay for a wee dent (it really was wee). Convinced that I broke my motorcycle, I walked the half mile home holding back tears. I called AAA and paid too much to have it towed from too close to home. 

For weeks I stared at P.J. I felt that I was neglecting her. I felt that I didn’t deserve a new machine. I felt like a failure. I felt too old to learn something new.

I knew I didn’t have the self-confidence to do this on my own, so I put it out there to strangers for help: Meetup and even OKCupid (“I am not looking for a partner; I’m looking for a riding tutor”). Seek and ye shall find. And find I did. I had the basic knowledge. I knew what do to. I knew that I needed seat time—practice. What I didn’t have until a few months after my crash was a moto-mentor. 

It has been over a year since I popped that curb and bonked the car. I no longer call it a crash. It was really a spectacular drop. I rarely drop it. Not never. Never say that. I have a lot of seat time, but I am still learning. I am comfortable riding at 80mph, but turns at a slow speed still make me nervous. So do turns at speed. So do a lot of things, but I am still riding when I can because there’s only one way to learn to build confidence:

Practice. And failing. And getting back up again to practice. 

So here is to hoping that a year from now, I’ll look back at my clumsy starts to programming and see that I did learn from my mistakes. At least I’m not bruised.