So if you read this title without knowing that I am learning some Ruby programming you may have started to picture me chipping away at at large red rock (ruby) to create the desired shape for my latest pendent…. well perhaps 😉
In some ways this visual could be true if the actual function of the object was not changed. In a nutshell Refactoring Ruby is basically analysing code and making changes that leaves it
CLEAN SIMPLe and EASY TO MAINTAIN
without effecting the function of the code!
A number of diferent ideas were intorduced and then I was given an opportunity to have a go! for example:
Pulling together a number of concepts to create a simple app. I am still finding a lack of flow and need to practice a little more- perhaps some coding puzzles might help. THis code is all about verbs… doing code 😉 I used the concepts of Â CRUDÂ Â
Today was the first day of the 6th Lockdown for Melbourne. There is some solis in learning to code in amongst the croazy homeschooling and teaching…. I also have a deadline to try to get this pre learning done by the end of August. My struggle is coming down to a lack of practice and getting stuck on blocks.
My Code today cuts up a string, creates an array and looks at the frequency of word in a given input…….
After a small (lockdown induced break” I have started again now with a deadline set I am ploughing through. I am battling myself as a learner as my role as a teacher has sarted to be un undoing. I am frustrated with not completley understanding it and struggling with not having the language fluenency to help myself. I can read chemistry, biology, science, gardening, parently…. this Ruby language is new so I feel slow and clumsy.
Today my Hash.new, .each and putting data from arrays and array of arrays was on the menu.
Woah this is getting a bit tricky… I wonder is it my remote teaching fatigue, having four children remote leanring at home, the wet weatehr or simply things are starting to ramp up! Today I redacted and use a .split method. But the big aaaahaaa moment was simply seeing strings and arrays and starting to get the idea of blocks…. I panic here and there about wher to put the next bit of code… today my take away you can have blocks in blocks!
Thought I might also tackle the additional question the first being about dropcase but the others will have to wait- this beginner is flaking out with brain lockdown fatigue……
This lesson was tough, with the school term starting back this week and today the start of lockdown 5.0 for Melbourne, I am somewhat tired…. but once I got my coding logical mind switched on I got the hang of creating loops. It seems Ruby has a heap of various ways to loop- I managed to create 3 infinate loops and crashed my codecademy learning site 3 times!
I am writing lots of notes in my note book as the retention of these new ideas is somewhat fleating and being able to reference my notes makes it all flow a lot better.
So today was a .downcase!, .include? and .gsub! introduction…. I am struggling with some of my odering and recalling the simple things like adding a end after an if or else. With perserverance and concentrating- (a little hard with 4 children consentantly interrupting) I managed to figure it out.
This code basically takes an input drops it to lowercase hunts for the presence of the letter “s” and replaces any s the “th”. It is basically the reverese code of how my brothers speech therapist in the 1980’s taught hin to put his snake (aka tongue) behind its gate (aka teeth) and soon I became Sarah rather than Tharah.
After a short break I found my flow a little bumping at the start of the unit- a great reminder that a daily practice is going be hugely benefical for my learning. Today we chomped our way through creating a form…..
gets take the input from the user while chomp simple removes the extra line…..
The method to capitilize was forced to only be applies to the variable answer rather than the variable by simply making it “exciting”…… just add a ! to the end….