I'm a noob Rubyist so take any of my rules and advice with that in mind. However with that said, last Sunday +David Bock showed +Jason Wieringa and myself how to use a 'Return' and a hash {} to take 52 lines of 'If Else' statements down to about 2 lines of code.
I was blown away because that's exactly what I do when I don't know what to do, I write lots of 'If Else' statements. I was so glad to learn when in doubt try using 'Return' and a hash {}.
I'm sure there are many more ways to code and not use 'If Else' statements, but for me this is now stuck in my brain as a way to try and get around long lines of repetitive code.
I spent 3 hours today working on 'RTanque' trying to figure out how to make the tanks work and do what I want. It's been harder than I thought it would be, but very fun all the same. Two things I learned about myself while working on making little tank bots today: (1) I need to really understand classes better and how to easily use them without guessing. (2) I am SOOO gonna' lose Sunday at our 'Tank Battle' if I don't do something drastic.
Desperate times call for desperate measures, so I tweeted a really good Rubyist on Twitter who shall be nameless for help, and called an emergency 'RTanque' war room meeting for Thursday with +Cody Kemp, +Jason Wieringa , +Colin MacDonald, and Matthew Gallagher. I will be working all day on horses Thursday then from 7pm-1am, it's study/battle time!
I would love to see a beginner's guide to 'RTanque', or maybe I'll end up doing one as I get better. I need to work on the pet rescue website tonight, and maybe some homework. Although homework may have to wait to Friday or Saturday we''ll see. This week is going well, 10 hours of study so far and more tonight. - Josh
Wednesday, March 13, 2013
Tank Making and If Else Statements
Follow Me
POPULAR POSTS
-
UPDATE September 2016: We are now inundated with bootcamps and it's getting harder to land a junior developer position. I created a co...
-
Yes, obviously Free Code Camp is popular. It's supposed to make things easier for you to learn how to code. My problem is the length of...
-
I have always promised honesty and transparency with this blog. Last time I gave a review about Free Code Camp, I wasn't super supporti...
-
You need a Regular Expression to validate a phone number or a user's email address, so what do you do? Go onto StackOverflow and copy so...
-
What up peeps ! I feel like every day gets better and better, I just gotta' say life is good, No brag, just fact :-) I thought I woul...
BLOG ARCHIVES
-
▼
2013
(115)
-
▼
March
(15)
- The end of Berkeley the beginning of Javascript
- 'RTanque' Part 3: Basic Targeting
- Michael Hartl's Rails Tutorial and my 1.5 hour Rsp...
- Junior Developer RoR in 6 months or 182 days!
- Beginner's guide to 'RTanque' Part:1
- 'RTanque' Massacre!
- Tank Making and If Else Statements
- 400.5 hours of learning RoR in 20 weeks!!!
- Why turning down new clients is great!
- Why you need to get Dale Stephens book!
- Finally found some good Cucumber tutorials.
- 4 things that will never change with development.
- Error installing rmagick gem!!
- End of week 19 = 380 hours of studying RoR!!!
- Berkeley 169.2x Quiz 1
-
▼
March
(15)