Things that might help beginner learners

I was a TA at Dev Bootcamp in San Francisco for two months, and now I write Ruby professionally (though at a junior level). Here are some things I know about learning Ruby and web dev in general that come into play for learners. I doubt this format will be terribly useful for actual beginners, but it’ll be a handy reference for me as I write more in depth and useful articles on these things. If it’s targeted at any particular group, it’s to people beginning to learn Ruby with the intention of entering the web development industry, like for example code school students.

– The | key is right above “enter” on your keyboard. It’s called a bar.

– Microsoft Word is used to edit text, but it’s not what developers mean to when they say “text editor”. They mean programs like Sublime Text, Atom, or vim.

– Don’t use vim as your first text editor; it has a very steep learning curve. I recommend Sublime Text 2 or Atom to start. Experiment with vim later.

– Most developers aren’t particularly smart or motivated. Don’t worry if you think you don’t measure up. Most of them are very unsurprising.

– Don’t name things after their type. It might might seem nice and explicit to name your Hash hash, but try and evaluate hash in irb without having declared anything with that name. It’ll return a long number, which you can confirm for yourself by evaluating hash.class. You can read about this behavior here, but it’s not very important. It can get confusing and weird.

– If you see a # before a method name in documentation, it means it’s an instance method. Don’t type it like that in your code, go ahead and replace it with a period when you use it. Class methods are denoted in documentation with a leading period just as they would appear in code, like String.try_convert, for example.

– Nerds call the # sign a pound or a hash, usually, and sometimes an octothorpe. Not a hashtag, but that’s fun to say to piss them off, like saying Frisco to Friscans. Likewise, ! is usually called a bang rather than an exclamation point.

– “Syntactic sugar” is any type of syntactic shortcut a language allows, e.g. the plus operator (“+“) is actually an instance method of the Fixnum class and can be called with dot notation like so:
Ruby has a lot of syntactic sugar. It’s nice.

– The Class#class method has got to be one of the most useful debugging tools. Because Ruby is dynamically typed (i.e. variables can be changed from strings to numbers), you’ll often find that what you’re working with isn’t what you think it is. Run print thing.class to see what’s up.

– Class#methods is useful too; it returns a list of all methods available to that object.

– The Enumerator#map method. It cycles over a list of things just like #each, and it returns a list just like #each, but it’s very different and independently extremely useful. It’ll return a new array or hash that has been modified according to what you do to its elements inside the block passed. In other words:
[1,2,3].map{ |x| x + 1 } returns [2,3,4]

– Once you’ve understood the basic concepts surrounding Arrays and Hashes, read up on the lower-level data structures they represent! Arrays traditionally have an immutable size, and Hashes (outside of Ruby, they’re called hash tables, dictionaries, or maps) do not. This has to do with how things are stored in memory. Skim: Hash tables and arrays.

– If a company offers you free meals and does your laundry, that’s a bad thing. It implies that they want you to spend most of your free time there, and encourages the notion that developers are exceptional, super committed nerds. They’re not. They’re humans doing jobs. It’s a cool job but still.

– Programming is a people job. It’s not going to save you from human interaction, if that’s what you’re after. As my teachers liked to say, projects almost never fail for technical reasons.

– Don’t get too attached to JavaScript frameworks, but learn them as you need.

– Ruby and vanilla JavaScript will both be around for a while and you can get attached to them with some security.

– Don’t get hyphy about functional programming, either, but learn it. It is very useful but is not the second coming.

Leave a comment

Filed under code

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s