Sunday, June 30, 2013

Week Three

Welcome back! I have been gone for a while; sorry! I wrote Week Two's blog towards the end of Week Three, and then that weekend plus all of Week Four was devoted to our first projects, and then Week Five was mostly recovering from that, so I haven't had much free time lately! So, this post might be really long! Let's see how much I remember...

Monday

As I mentioned in the previous post (I was going to say last week, but it was actually ages and ages ago), we covered a lot of stuff this week. I think there were some more abstract concepts covered, and there was less homework than the previous two weeks, which I think combined to make it a bit harder to comprehend everything that was going on. I also had a pretty rough Monday night (I didn't realize until I was going to shower around 1AM that I had run out of clothes, and had to do laundry...) and the tiredness from staying up until 4AM or whatever carried through the whole week. But anyway! On Monday we covered how the different "parts" of a Rails app work together. Previously, we'd kept most of our code to one or two individual files, but as our programs get more complicated, we want to start compartmentalizing code - basically we can group similarly-functioning pieces of code together for easier readability. It also makes it easier to spot problems, and helps to isolate bugs.

Our assignment for the day was to write a blogging program, as some additional database practice. Basically we needed to make separate tables that would store blog articles, comments, and authors/users. So if I can make my own blog, why am I still using blogger? Well, I wouldn't want to go and change the address on you guys in the middle of my class!

Tuesday

As I already mentioned, I ended up having a rough Monday night thanks to stupidly not noticing that I'd run out of clothing, so I was super tired during class today. We reviewed the blog program, and then learned how Rails can magically make all of those pages that we had spent so many hours creating. This is a slight exaggeration, but we can basically write "rails create blog" and poof, done. I actually nodded off for a few minutes during this part of class, so I missed everyone ELSE flipping out, and then had my *own* "WHAT IS THIS WITCHCRAFT" moment when I woke up. We also discussed routes, which really shouldn't be that complicated (I think) but my head was so foggy that I didn't really have a solid grasp on them until pretty recently. Routes are basically how URLs are made, which is fairly simple, but we learned a few ways to rename them inside of the program, and that confused me. Why are we suddenly writing new_blog_path instead of article/new? And why is it sometimes /articles/new? And what is going on with articles#new?? Who knows! So basically, kids, don't sleep in class...

Wednesday

We covered a bunch of different topics today - more on routing, partials (basically a way to further compartmentalize your code), assets (an area created by Rails where you should store images and things), CoffeeScript, which is another way of writing JavaScript (we briefly touched on it; I'm not sure if we'll go back to it in the future, or just stick to JS though), and how to create sessions, which basically give us the ability to create login verifications. Whew! That was a lot of stuff! And I actually forgot something! Flash notices! They are sort of like little alerts that will pop up and tell you things like "Your password is incorrect." (in the context of the day's lesson). Anyway, there was a ton of stuff covered today, and I honestly have no idea how to write a login, so that is something I really need to get around to learning/relearning, although Rails is magic and I can find some login code that someone else wrote and just it install it into my program and boom done. BUT, I would like to know how to write a basic login, just for personal study reasons. So I will have to get on that at some point.

Thursday

So this past Thursday (real time) we had a homework assignment that required us to write a search function, and I was sure we had never written one before. As it turns out, we learned one today (blogtime)! So yeah, when I say that 1) I was really out of it this week, and 2) we cover a lot of stuff really quickly, I am not lying...

We also covered JSON, which is a commonly used way of displaying lots of information, since computers can read it easily, and it isn't *horrible* to read as a human. We used a "scraping" gem called Nokogiri that let us pull all of the information from a website and store it as a JSON file, and then we were able to open that and parse it for the specific information we wanted. As a concrete example, we had created a recipe website earlier in the week that would let people post recipes they liked. We used Nokogiri to scrape a recipe from a recipe website, then wrote a program that would post the ingredients and steps to our recipe website (and leave off the useless extra stuff). We also did a bit of work with Twilio, and set up a simple bit of code that would send us a text message to alert us that a recipe had been posted on our website. All in all some pretty neat stuff. The final thing of the day was covering seeding, which will automatically put information into our database (rather than having to go into our website and manually add it). I more or less forgot about seeding, but it ended up being super vital to my first project, which I'll get to in a bit (hopefully!).

Friday

Today we were given partners for our first assignment. We were given pretty free rein - basically make whatever we wanted. We then spent most of the day covering things that would help us in working with partners - making "branches" on github, for example. Github is basically an online code repository - I can post my code there, and someone else can download it and work on the same program, and then upload their changes to the repository. By making "branches" they can make changes to the code and upload it for me to look at, but it will be in a branch file rather than in the original file. That way, if I don't like the changes, I don't have to add them. We also covered environment variables, which are basically a way to store information on your computer rather than on the internet - it prevents people from just looking at our website's code and getting information we don't want them to have (phone numbers, for example). Our only assignment for the weekend was to come up with a project idea, and neither I nor my partner, Isaac, really had anything in mind at this point.

Well! That about wraps up Week Three! I will be back in a bit (hopefully) with Week Four! I felt a bit lost this week, and was stressed out about some random stuff as I'd mentioned in the Week Two post, but once Week Four rolled around, I was so busy with my project that I didn't really have much time to feel stressed about anything else! Our project was pretty neat though, so I'll see you back here soon with the summary of how that went!

Thursday, June 13, 2013

Week Two!

Welcome back! Sorry this is going up so late - my weekend was pretty busy, and I just never got around to writing a new post. Class is still going well, although the last few days I've felt like I'm falling a bit behind, which worries me. Up until now I've felt quite confident in everything, but we've just started using Rails, and it does so many *things* for you that it is a bit overwhelming. I've also felt a bit under the weather, so hopefully this weekend I can just rest up, go over week three's work, and get back on track. But! That's for the next post! As for last week...

Monday

On Monday we were introduced to JavaScript and jQuery. While Ruby does work behind the scenes on web pages, JavaScript deals with what the user actually sees, and can let the user interact with the website. jQuery lets you put JavaScript right into your HTML file, so you can perform simple (or maybe even not-so-simple?) things right there. That was a pretty bad explanation, sorry. Anyway! We made a banking website that allowed you to move money between your Checking and Savings accounts, along with throwing up an alert if you overdrew from either account. For the most part, this program wasn't too difficult, although getting the overdraft to work properly was a bit tricky.

Tuesday

We played with Twitter Bootstrap today. Bootstrap is basically a collection of styling code that you can include in your websites. Rather than (or in addition to) writing your own style code (fonts, margins, where things are placed, etc), you can use Bootstrap's pre-made styles, and apply them to your website as you like. It isn't as straightforward as a template (like you might see on some make-your-own-website sites like wordpress), but it does do a good amount of heavy lifting. I'm not particularly good with CSS (the styling language we use), so Bootstrap automatically making my stuff look a bit more professional is nice. I'm trying to keep most of these coding explanations really simple, by the way, since a good number of my readers don't know anything at all about programming, so hopefully it is simple enough for them to understand, but not so simple that the people that *do* know find this boring! Our assignments for the day were to go back and apply Bootstrap to our Bank and "Playground" (from the previous week) programs, and make them look nicer.

Wednesday

Databases were introduced today, which meant that we would finally be able to store information. Previously, any information we added while running our programs was lost after we exited (so in the pet store program from the previous week, I could adopt every animal in the shelter, but if I closed the program and reopened it, it would reset). We worked on two medium-sized projects today, one in class, and one for homework. The Favorites app that we made in class stored information about our favorite books and movies - pretty basic stuff. The To-Do list had us add and remove tasks, as well as mark whether they were complete or incomplete.

Thursday

We continued working with databases today. This was the first really complicated concept that we covered, in my opinion, as we now moved on to relationships between items. Backing up a bit, a database is basically a collection of tables, and each table is related to one "object". You can give the objects various "attributes", which are then stored in the table. For example, an "authors" table would store things like first/last name, age, date of birth, etc. That is pretty simple, right? But what if you want to include every book he's written? Now, maybe we want a separate "books" table (and those might have attributes like genre, number of pages, fiction/nonfiction...)...but then we need to show that they're related! Well, a book (to simplify) always has one author, but an author can have many books, right? So we will establish that "relationship", and then we can request all books by a certain author, and display them. Ta-da! Now we have a list of every book by F. Scott Fitzgerald! (Assuming we sat there and entered every single book he wrote into our Books table, anyway. Maybe we just put in The Great Gatsby, since that's the only one that matters). I don't really have any problems figuring out what the relationships should be usually, but I was (am?) still not quite certain how to write all of that code out without checking a guide, so this is tough. Our assignment for the day was to create a Stock program that would allow the creation of a client, portfolios, and stocks. The client could have multiple portfolios, and the portfolios could have multiple stocks, chosen from the "brokerage's" offerings. The only thing I couldn't figure out (and lost a lot of sleep over) was getting a portfolio not to completely refresh every time I wanted to add new stocks to it (overwriting the old ones). As it turned out, we hadn't learned how to prevent that yet. Whoops.

Friday

We used today as a bit of a review day, covered "refactoring" (cleaning up and organizing our code to make it more efficient and easier to read), and a few other topics. Honestly, I was really tired since the Stock program kept me up late, so I had trouble focusing. I asked Sumeet, our instructor, if we could have another database assignment for the weekend, since I felt like I and others could use a bit more practice, and he obliged with a "Party Management" program. This allowed people to create parties, create and list items they wanted people to bring (potluck-style), tag items (vegan, snacks, etc), and allow people to "claim" items as well. It was a pretty neat program, and a good way to drive home databases. I'm still not an expert, but I'm fairly comfortable with them now at least!

Well! That wraps up week two! I'm sorry for the delay in posting! Hopefully it was still a fairly enjoyable read (my memory is a bit fuzzy, and I'm pretty tired today). I guess you'll be getting another update really soon though!

One thing that worried me early on was how difficult this class would get, and whether people would be left behind. At this point, I think we've lost about 6 people, from our initial 24(ish). I don't know everyone's reasons, but I think that most of them left because they were unsatisfied with the program for one reason or another. We lost a number of people after the first two or three days, which I thought was a bit ridiculous - at least wait out the week to see how things ramp up. I'm pretty sure I spoke in the Week One entry about how the first two days were slow, and then the next two were much more involved. So far, I don't think anyone has dropped due to feeling unable to keep up - we have a good group of people now, so hopefully none of them will! I thought there was a fairly large gap between the people that were at the front of the class and the people that were at the end, but I think that gap is narrowing now that we are getting into more complicated territory.

Honestly, regarding how some of the drop-outs felt the class was too slow in the beginning, now that we are halfway through Week Three, I don't know if I could deal with this class going much faster than it is currently. Without giving too many spoilers away, we started using Rails this week, and I am feeling kind of overwhelmed. Partially I think this is because I just had a hard time sleeping the last few days, so I've been extra tired in class, and I was kind of distracted today from some personal stuff (nothing super important, don't stress mom/sisters/family), so that certainly didn't help. Anyway, as I said at the beginning, my goal with this blog was to write about the good and the bad, with the hope that feeling like I have this "commitment" will force me to fight through things as they get a bit harder, so that is what I have to do! I started Week Three feeling really confident, and my confidence is really shaken right now, but you will have to read about that on Saturday! Hopefully I'm back on solid ground by then!

Monday, June 3, 2013

Week One: Orientation, Intro to HTML, CSS, and Ruby

Welcome back! I'm a bit late writing this (since I said I'd aim for every Saturday) but hopefully you can forgive me. Today, I'm going to talk about my first week of class, and the programs we made.

Monday

Monday evening was orientation. Everyone gathered around for pizza and drinks, and chatted for about thirty minutes. A class website list had been sent out a few weeks prior, with an introduction thread, but for whatever reason most of my classmates hadn't posted in it (only nine or so), so most of these people were brand new to me. There were a surprising number of people that were from the east coast, and even another person from New Jersey (though he moved to SF about three years ago). After the eat-and-greet, we all sat down for a short presentation about the program, an introduction of the teachers, and then we all introduced ourselves, talked about our goals, and shared what our guilty pleasure was (mine is eating a pint of ice cream without realizing it - this happens way more than it probably should). We then had an "Installfest" - basically, everyone installed a bunch of programs on their computers so that we'd be ready to go on Tuesday.

Tuesday

Well, obviously Tuesday morning about half the class had errors running various things (myself included) so we spent about two hours getting everything *properly* installed, and then class finally started. I wasn't really sure what to expect - some of the pre work had been pretty difficult and/or hard to understand, and if we jumped in from where the pre work had left off, I think I (and a lot of others) would have had a rough first few days. Fortunately, the class started off basically from zero, and started us off with some basic command line and github commands, then moved into a basic overview of HTML, before letting us loose shortly before lunch to work on a profile website. After lunch, we were asked to add in as much CSS as we remembered, and spent the rest of the day tweaking our websites.

Wednesday

Our instructor was out sick today - Monday and Tuesday he'd had a throat cold, and I guess he finally lost his voice, so the two assistant lecturers took over for the day. We spent the morning going over a bit more HTML and CSS, and then in the afternoon went over some basic Ruby stuff (again starting will really basic stuff). I noticed that a few people seemed a bit unhappy with the slow pace of the first two days, but personally I didn't mind it, since I think that reviewing these basic concepts is good and even though I personally was okay with most/all of what was being covered, I didn't mind having it drilled in one more time. Besides, it wasn't like we couldn't also work on our website, or any programs from the pre work, while listening to what was being said, so I didn't think it was a waste of time or anything. I also expected that the class would ramp up pretty quickly, and two "easy" days out of twelve weeks isn't such a huge loss. Our homework problem was to build a calculator program that (for whatever reason) offered two settings: Basic (addition, subtraction, multiplication, division) and Advanced (exponents, square roots). I was really proud of how "clean" my program felt when I was done with it, but I showed it to Erek and he thought basically the opposite. Whoops. I believe his friend said, "I have never seen so many nested methods in my life." Oh well! Erek also left a bunch of comments on my calculator program, so I intend to go back and work on it some more when I get a chance (I'd hoped to get to it this weekend, but ended up being a bit too busy), but sometime this week or next weekend, I'll need to be more vigilant.

Thursday

Today was all Ruby, and the pace picked up quite a bit. We spent most of the day covering Classes, as well as making our first multi-file program. The main assignment of the day was to work with a partner to develop an animal shelter app that would allow the user to adopt pets and give pets up for adoption, and to search for a specific type of pet. My partner, Tom, and I were able to map out how we wanted to write the program pretty quickly, and wrote most of the smaller files quickly, but then got stuck for a ridiculously long time on some pretty simple things. I was pretty tired (going to sleep super late for whatever reason the night before) and my brain started shutting down around 5:30. We stayed after class to keep working, and finally called it a day around 8, but I don't think I really contributed anything at all during that time. I got home, had dinner, and slowly recharged, and then got back to work, and was able to figure everything out. Amy also had a great idea of adding ASCII art animals to give the program a visual aspect, which made it a lot cuter. She found some pretty great pictures, so in the end I had a pretty unstandard animal shelter that allowed you to adopt not only cats and dogs, but also giraffes and dinosaurs. Of course, I didn't implement this until about 3 AM, so I headed into Friday with about four hours of sleep (again...why...).

This was the roughest day for me, but we did have an ice cream social during lunch, which was pretty great!

Friday

Sinatra was introduced today - Sinatra is a web framework similar to Rails (Ruby on Rails is what we're ultimately moving towards learning to work with, and is what most bootcamps teach you), but is much simpler. I might be explaining this wrongly, but basically, we can write code in a bunch of different languages, and then Sinatra combines it all together, so that I can have Ruby programs running in the background on my website.

The concept of Ruby gems was also introduced. Gems are basically programs that other people have written, and you can install them and then call them in the program that you are writing. As an example, we installed an Image Search gem, and then used that to search Google Images in our program. So what was this program?

Well, it is a bit more difficult to explain than the previous programs, since this one was pretty specifically geared towards familiarizing us with Sinatra and gems, but it was basically a website with three different search functions (each powered by a different gem). You can search for information on a specific stock, you can search IMDB for information on a movie, or you can run an image search. This one was pretty fun to write, even if the different parts didn't "flow" together smoothly.

Reflections

After my first week, I'm really enjoying programming. There are occasionally frustrating parts, but when you finally figure out what was wrong, and get your program to work properly, it is pretty satisfying. Unless it's something dumb, like adding an 's' to a variable somewhere, and it taking you two hours to notice. Or when you save a duplicate file, and then make changes in it, and can't figure out why none of your changes are showing up, only to realize you're still running the original file. Ugh. But! Aside from those times, it's been fun!

I should go now, but I hope you've enjoyed reading my summary of my first week!