Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

NEXT Academy

Last updated: September 3, 2015

BUILD AN APP IN 3 STEPS


Authors Note
Before I joined the bootcamp at NEXT Academy, I had close to zero programming knowledge. I
knew enough HTML and CSS to fumble through editing my blog layouts in Blogger, changing
little bits of the code here and there, hoping that what I wanted would appear on the screen.

It was a lot of trial and error; I didnt actually fully understand what I was doing. I didnt know any
web fundamentals how the Internet worked, the dierence between a web application and a
web site and I definitely could not have built an application from scratch.

When I first joined the bootcamp, I knew that I wanted to build some kind of indexing system
that would be as organized as a library system. But also, as pretty and graphics-oriented as
Pinterest. Now that Ive graduated, I want to build even more things. And I can.

The bootcamp was far from easy, but it was completely enriching and being able to build any
application I want? That feeling is absolutely amazing!

Id like to share that experience with you. I know that you may not have time to sign up for the
whole nine weeks so heres a fun little app that you can build within a super short time.

Enjoy! :-)

Code Fairy

Writer & Coder, NEXT Academy

nextacademy.com

NEXT Academy

Last updated: September 3, 2015

Step 1: Try Ruby


I love Ruby. Designed and developed in the mid-1990s by Yukihiro
Matsumoto, its a truly powerful programming language that can be
used for a range of functions. That makes it a pretty versatile
language.

It can be used to process text, create games and, when used as

A Little Piece of Trivia:

Ruby was first released


in 1995, which makes it
older than Twitter,
Facebook and even
Google!

part of the Ruby on Rails framework, to create applications. (Ive


even seen Ruby used in hacking programs shhhh.)

One of the best things about it, is that it looks a lot like English. This makes it really, really easy
to read and write Ruby.

For a quick trial of how Ruby works, head on over to Try Ruby and finish the exercises there. Itll
only take 15 minutes (and was incidentally also my first ever exposure to the Ruby language).

Step 2: Write Pseudocode


One of the first few applications that we built in the bootcamp using Ruby was a Pig Latin
translator. That was really fun for me because I still remember how in primary school, my friends
and I would speak F-language I-fye have-fef a-fuh se-fee-cret-fruht (I have a secret) or
Dribble he-leh-geh lo-lo-go (hello) so that boys wouldnt understand us.

Its really simple, especially if you understand the logic behind the app. Sometimes programmers
use pseudocode to understand what a client wants. Pseudocode is normal text that outlines a
process/function that a programmer can easily translate into code.

nextacademy.com

NEXT Academy

Last updated: September 3, 2015

Heres an example of pseudocode that details how the Pig Latin translator will work:

Script: CONVERT TO PIG LATIN


Iteration One: CONVERT SINGLE WORD
GET a word from user input
IF the word starts with a vowel, don't change it
ELSE replace the word with its pig latin equivalent
GET all of the consonants before the first vowel in the word
SET the consonants at the end of the word and add the suffix "ay"
ENDIF
PRINT the pig-latin-ified word

Do you understand the pseudocode? Its pretty self-explanatory, isnt it? For our app, were
going to translate single words from English into Pig Latin.

Step 3: Write Some Code


If youre just trying Ruby out, you dont have to install it on your computer just yet. There are
online environments where you can type and run scripts. For today, well use Tutorials Points
Ruby environment. (Click on the link to get there.)

Now, lets think about how we want the app to run. First, when we run the script, we want to
prompt the user to input a word. If the users word starts with a vowel, the word should look the
same. If its a consonant, however, the translator should remove the consonant from the front
and move it to the back of the word, as well as add ay. So the word apple would still be
apple but the word hello would be ellohay.

Heres the script that I wrote when I first wrote this application:

def pig_latin
puts "Type a word:"
word = gets.chomp
if word.start_with?("a","e","i","o","u")
word
else
consonants = ""
while word.start_with?(b,c","d","f","g","h","j","k","l","m","n","p",
"q","r","s","t","v","w","x","y","z","qu")
consonants += word.slice!(0)
pl_word = word + consonants + "ay"
puts pl_word
end
end
end
pig_latin

Run this script in the Ruby environment and see what happens! Now, try and write your own
version of this app.

nextacademy.com

NEXT Academy

Last updated: September 3, 2015

Final Words
What I really love about programming is that there is no one correct answer or solution.
There are many ways that one can go about solving a problem or making something work. As
someone who has always had trouble with just following orders, this arrangement is ideal!

Now that youve dipped your toes in Ruby, do you think you might want to try more?
Codecademy has a great Ruby tutorial and you can learn about Rails using Michael Hartls Ruby
on Rails Tutorial.

Before I signed up for the bootcamp, I tried learning coding online but found it rather slow as I
didnt have someone available to show me the ropes. At NEXT Academy, I had mentors and
classmates that I could discuss my programming challenges with. Even now, when building my
own applications, I sometimes run into trouble and I know that I still have a community that I can
go back to seek help from.

If you would like to be part of a community like that you can sign up here: APPLY NOW

Else, keep subscribing to get access to other online resources!

nextacademy.com

You might also like