puts"a website I will build today"unlessweb_crawlers
Week 3!
Hello World. Week 3 is almost over. During the week it felt like we were moving slowly but now that I’m reflecting on what I learned, it feels like a lot. Monday we practiced designing a database for different website. That was a really fun exercise for me. I have a really easy time understanding how different tables connect together. We then moved on to ActiveRecord. ActiveRecord is a gem that amount other things communicated between ruby and sql. Basically it takes in ruby code and converts it to sql select, update, ect. statements. This is really useful because it allows developers to work in ruby and rails (ActiveRecord is included in rails) while trying to fetch data fro the database. I struggled with this a little because SQL has become so intuitive to me and ActiveRecord required a weird SQL-Ruby combo syntax which I wasn’t use to. Not too big of a deal though, for the most part I will always know what SQL statement I want and can work backwards to get the ruby/ActiveRecord statement I need. After this we worked on connecting tables with ActiveRecord. Also very useful. There were a few funky relationships which I could conceptually understand but transforming that into ruby/ActiveRecord felt a little funny.
On Wednesday we started working with Sinatra. Sinatra is basically Rails-lite. It works with ActiveRecord but doesn’t have all the ActionController stuff. This was great for two reasons. 1. It makes Sinatra smaller and easier to use on smaller projects which require less pages. 2. It was a great to learn Routes.
Routes, in my words, are the combination or HTTP requests and web addresses which tell a web server what a user wants to do. When you visit a websites homepage you are probably using the GET HTTP verb and visiting the ‘/’ page. If you are signing up for a website you are probably on a ‘/signup’ page (or whatever name the website decides to use) and when you click the ‘sign up’ button you are using either the POST or PUT HTTP verb. A POST verb will tell a web server that you are sending it data and are asking to make an update or insert into the database.
After we played with Sinatra I decided to update my applepicking website to use Sinatra and build a form of my own instead of cheating and using a google form. Part of the reason I used a google form was because I didn’t know how to create a database on Heroku (a free website hosting service) but we covered how to do this while doing the Sinatra tutorial. While going over how to update my website with David, he showed me how to use a new site.gem/api called Stripe to allow users to pay for the applepicking trip while signing up using my site. How cool is that?! ‘So cool, Kyle.’ Awe thanks anonymous reader. So basically my site can go from a clunky single page to a full fledged sign-up site this weekend. Boom its happening.
Today we are going to start building a web scraper. Web scrappers, also called web crawlers, move around websites on their own reading html text and navigating pages to pull useful information. I’m really excited about this project because I actually had a plan for a website built around a web scrapper fetching university academic calendars and then aggregating then in one site. Be on the look out for springbreak.io, its gunna be big.
springbreak.io, its gunna be big
So thats the week. We also learned about the internet on Wednesday. I am going to try and write a full post about the internet (its a big deal) tomorrow to explain it to all my faithful we’blog’ followers and to wrap my own head around it.
Cheers,
Kyle
P.S. I found out sublimetext2 has a spell check, all spelling mistakes are no longer forgivable.
puts"something meta this way comes"unlesshardcoded
Week 2!
It might be easier to keep track of weeks than days. So lets say week 2(4) and leave it at that. Topics I want to talk about paired programming and meta programming.
Paired programming is popular programming style (maybe those arn’t the right words) where two programmers work together on the same project using 1 computer. In paired programming 1 programmer writes tests they expect the program to pass and then the other programmer takes over an writes code to pass the test. This approach is called ping-pong or red-green programming. Programmers pass the keyboard back and forth, which is where the ping pong comes from. After the first programmer writes the test, all the tests are run and b/c the functionality in the program has not been written yet, the tests fail. Failed tests show up as red in the command prompt (*you have to set the tests to show colors). Then the second programmer writes the code to have the tests pass. Once the code is written the tests are run again and if the program has been written correctly, (sort of an arbitrary idea) the tests will pass. The functionality can then be changed, or ‘refactored’, to clean it up or just write it better. Having tests written out is really nice bevause it means that if your code changes you will always know if changing one small thing will effect anything else in your code. The ping-pong/red-green process continues until they have competed the project (or atleas thats what I think, but we’ve only been doing 1-2 day projects).
The downsides of paired programming are obvious. A company could be paying two programmers to do the work of one and the better programmer can dominate the project while the other sits back and doesn’t contribute. But the pros far outweigh the cons. My favorite benefit is that it forces eah person to vocalize what they are thinking. ften times I will have an inkling of what I should be doing and then dive into the project without fully fleshing out my idea. In paired programming you normally explain what you think you are about to write to the person you are working with before you write it. If my idea is only partly formed or has some falicy, it becomes obvious while I am speaking. Additioanlly, if I understand a concept, or rather think I understand a concept and my partner does not, I get to explain it to them and along the way learn a little bit more about the concept because I am trying to clearly explain it to someone else. The fli[p side of this is if I don;t understand something I have someone sitting next to me who is willing and able to explain things to me. Other things I benifit from are having a second person around to watch for syntax, typos and gramatical mistakes. Another important benefit which someone mentoned today is that diring paired programing, you can’t really goof off. And to be honest, you don’t feel the need to goof off nearly as much. Rather than just staring at a screen and feeling the constant need to check if ESPN posted another article about the NHL, I feel fully engaged in the problem I am sovling.
Overall, I feel like I have been the more experienced programmer in the 3 pairs I have been in. Even so, I don’t think I would have completed the project much faster if at all, had I been working by myself. My partner has saved me from entering a fruitless rabbit hole many times. Also becasue someone is watching me type my code, I think I write much cleaner code. I used better variable names, space things out better and am more willing to write helper functions.
I’m pretty sure where I used to work, does not use pair programming at all. I think they do do some type of testing (well ya, obviously they test things kyle) but not exactly the types of things we did here. I know the phrase ‘acceptance criteria’ was passed around which seems similar to what we are doing in red-green testing, but I don’t think use it as liberally as we did in our work.
Ok so thats paired programming.
meta programming:
is probably not the right phrase. but i like it. (also im going to stop capitalizing everything) . meta programming is basically programming code to write more code. it is understanding that whatever code you need may not exist yet but based on a few inputs, we know what functions we might want to create. some people find this very confusing but i love it. for me its just recognizing patterns. i think day-to-day it probably isnt used too often but the few times you need it, it can be super powerful. to me powerful means it can handle many different cases and hopefully cases you dont even conceptualize when you write the code.
im sort of we’blog’ed out for now.
oh one other thing I worked on this week was linking to the facebook api. that was fun. hard because my javascript skills are subpar but its comeing alont. i am trying to create a simple site where people can sign up with facebook. more to come
Cheers,
Kyle
P.S. Please forgive any grammatical or spelling mistakes
Day 5 / Day 20. Week one of Fullstack is almost over. Yesterday was a really fun day. We used pair programming for the first time. ALthough my ruby skills are probably better then most of the people here, I still found lots for benifits from paired programming. When I wasn’t on the keyboard I had to vocalize what I thought we should do instead of typing it. This slowed my thiking process now and gave me a chance to catch some of my mistakes. It also made me explain why I thought we should do one method vs. another and vocalize what information we ahd and what we wanted to do with it. I also think that my typing is not amazing yet so not being on the computer let me continue to think instead of stopping and starting while I typed. Which is what I’m doing now lol.
The API part was awesome. Defintely my first time really using an API and having some semblance of an idea why we took the steps we took. I’d like to read over and API at sound point to understand what is really going on behind the scenes. I understand taking the API as is and not asking too many questions is generally benificial but on an general level I’d like to understand what happens when we install a gem and then require the gem and then call the API class and its methods.
The day we did the Learn Ruby stuff felt slow to me. Apparently I had already done most of this stuff to prepare for the AppAcademy code interview, but I didn’t realize it until I had gone through all the exercises. I did enjoy the Haiku stuff. I like those type of mind games. I think having some extra extra challenges would have been good. Then could have kept playing with my code more.
Yesterday I started writing a Sudoku solver. This was promted by Julian deciding to write a sudoku generator. I was thinking it through last night as I was falling asleep and I can definitly see pieces or groups that I am modeling and feel like using classes could benificial (right now I am using a complex array to keep track of everything) but still don’t completly understand how to relate classes to each otehr and call each other’s methods and all that jazz. *side note, that gsub! problem really shook my ruby confidence yesterday and now I keep doubting if I truly understand what I am updating. WHich is a good thing, but I definitly have questions and may be creating too many variables or may not be creating enough.
I am excited to get into javascript. Even after doing the prep courses on javascript I still only have a basic understanding of it but realize how powerful it is and how much fun I could be having with it. It sort of feels like ruby logic but with very visual and wuick results.
puts"chive is the best cream cheese"unlessloxandtomato
Day 18 baby! Biggest day of the class! “But Kyle, its only day 3 of the class. How can today be both day 18 and ‘the biggest day of the class?” Well rude imaginary person, I started doing prep-wrk for this class on September 1, so thats how its day 18, silly. AND everyday is the biggest day of the class. Leggo.
Recap: Yesterday we bulit a blog. This blog. Blogs were origonally called weblogs. Some fancy person came along and decided to drop the “we” and now weblogs are called blogs. I might be a weblog guy myself. Not sure yet, but I’ll get back to you when I know. This blog is cool because it is very customizable and everything in it uses code. To post stuff I have to send a git push request. To update visuals, I can update the html and css code. Fun stuff. Great for learning and for webloging. After we built a blog everyone int he class worked on ruby. I went through the Test First dot org tutorial up through number 11 I think. I will do a few more this morning. I then built a haiku maker. We were given a file which had all the words in the dictionary and how to sound the words out which indicated how many sylabls(spelling) the word had. For this, I could randomly generate numbers which when paired together would give a haiku. Here is an example:
SHAFTED WILLISON
PECH COLORISTIC TEACHING
ACCOMPANYING
or this one:
SIDLER HEAVEN’S
PROPPED WATNE COIN UNGAR THIEDE FUNES
TESTICLES BEGINS
Future: Today I will write a script with will find all the haikus in a book. And also finish the Test First stuff.
Thats all for now. Send me a youtube video and I’ll try to post it.