How Ruby Manipulates Variables and Objects and Passes Them Around

  • Understand if a method returns a value, or has side effects, or both
  • Side effects - displaying something to the output or mutating an object
  • Understanding the methods you are writing and using methods from existing libraries, etc., it is critical to understand their side effects vs return values when writing code that is well organized and easy to read
  • Avoid using a method that has both side effects and a meaningful return value
  • Name methods appropiately, preface the name of the method with whatever the output value is
  • A method should do one thing, and be named appropiately
  • Don’t write a method that mutates, outputs and returns a meaningful value. Make sure the method does one of those things
  • Don’t mutate a collection while iterating through it
  • Run rubocop to catch variable shadowing for you!
  • Don’t use assignment in a conditional
  • Use underscore for unused parameters and ones you don’t care about
    • Or if you have an unused parameter when there are multiple parameters
  • Gain experience through struggling
  • It’s less useful to learn “best practices” without first learning why they’re best practices, learn why first
  • Be ok with struggling through the “bad” or sub-optimal practices first
  • Spend the time programming, learn to debug through problems, struggle with it, search for the right terms, play around with the code. Another problem occurs, repeat.
  • Move repetitive logic into hashes and arrays comes up in all kinds of programs
Read More

How Ruby Manipulates Variables and Objects and Passes Them Around

  • Re-assignment doesn’t change the object, it binds a new object to the variable
  • Re-assignment to a variable doesn’t change the object referenced by that value
  • Re-assignment isn’t considered a destructive operation In Ruby, numbers & boolean values are immutable
  • nil(the only member of the NilClass class) and Range objects(1..10) are immutable
  • Regardless of which strategy a language employs for a given argument or method, it’s important to know which one is used so you can understand what happens if the method modifies one of its arguments
  • Pass by value, means copying the original objects, so the original object cannot be modified
  • Assignment to a variable merely changes the binding; the object the variable referenced is not modified. Instead, a different object is bound to the variable
  • Mutable objects can be modified without creating new objects
  • Ruby is a pass by value for immutable objects, pass by reference otherwise
Read More

UX Notes

  • Understand interaction models
  • fox, comcast interaction models on choosing a carrier
  • understanding proper use case for condensed weights of a font
  • line charts charts and how they scale, rounded corners? what is the benefit?
    • round edges defining the edge/end of it as opposed to flat lines within the bar
  • line better than dot at small scale?
    • circle creates viz hierarchy and difference between things
  • how does the untrained eye perceive the design?
  • how to make legend distinct, what is the best way
  • thinking of all aspects and how it expands
  • AAA Gar level reqs
  • pixel gap in line charts helps differentiate levels on a scale
  • real nomenclature in product
  • truncation based on length of string
    • difference on web and mobile
    • what is the most helpful use and how people name things?
  • understand complexity of multi-selection and zoom in pie charts
  • hover must have keyboard alternative for accessibility
  • prototype implementation of tab and arrow keys when moving around elements of a website
Read More

Ruby Foundations 101-109 | The PEDAC Process

After having read through the Launch School materials pertaining to the PEDAC Process I have found it useful to iterate over how I approach the process of solving the logic layer portion of exercises as I begin my LS/Programming journey.

Read More

Understanding Pseudo-Code

Pseudo code, is meant for humans to read and not meant for machines or programs to process. Therefore, there is no rigid format to follow.

Read More

First blog post. What to Expect.

In this blog you can expect detailed tutorials, tips, and tricks that I find useful revolving around programming, html, css, productivity applications, and much more!

Read More