What is Elm? Q&A

July 23, 2015

Thanks to everyone who has picked up a copy of our brand new Elm video tutorial! Since releasing it we've received a bunch of questions and thought we'd roll them all together and answer them here.

Q: What is Elm, in under 144 characters?

A: Elm is a functional programming language that compiles to JavaScript and runs in the browser.

Q: What makes it a functional programming language?

A: In simplest terms, Elm programs are a collection of functions. For example, here's a cheery Elm function that transforms one string into another:

greet name =
  "Howdy, " ++ name ++ "!"

Q: OK, but isn't this just like a method in my object-oriented language?

A: The important difference is Elm functions don't run in the context of an object where they share state with other functions. An Elm function is stateless: it simply transforms its inputs into its output, with no side effects. Given the same inputs, a function always returns the same output.

Q: And that's important because... ?

Well, for starters, it means refactoring is easier because you can move code around without worrying about stuff outside the function. And the code is easier to understand in general. With a stateless function, what you see is what you get.

Q: I heard immutability was also an important part of functional programming. What's Elm got to say about that? ...

[Continue Reading…]

New Elm Tutorial: Building Reactive Web Apps

July 21, 2015

There are plenty of JavaScript-based frameworks for building single-page web apps. But there's a common problem with all of them: JavaScript. We need a better solution. Elm offers a fresh approach that makes functional, reactive programming not only possible, but practical!

In our new Elm tutorial, you'll learn how to create a single-page, reactive web app from scratch so you see how everything fits together and can start experimenting on your own!

What is Elm?

Elm is a functional programming language that compiles to JavaScript and runs in the browser. Elm isn't a band-aid over JavaScript's ugly parts; it's a whole new, fresh approach to browser programming.

What will I learn in this tutorial?

You'll learn the ins-and-outs of Elm as we build an actual web app from the ground up. By the end of the tutorial, you'll not only have a thorough understanding of the Elm language, you'll also know how to properly architect Elm applications. Check out the full course outline.

Is Elm for me?

If you want a fun way to learn functional programming or you're ready for an alternative to JavaScript, you should learn Elm! This tutorial is designed specifically for experienced web developers who are fluent in HTML, CSS, and another programming language. No prior experience with functional programming, Elm, or JavaScript is assumed. Check out the first few videos for free!

We hope you'll join us in The Studio for this fun, new course!

Jump In and Save 25%

June 11, 2015

Update (June 17, 2015): We've wrapped up our summer sale (thanks everyone!), but you can still pick up our popular courses at everyday great prices! And don't forget that after purchasing your first online course with us, you immediately become a Pragmatic Studio alumni and get 25% off all subsequent Ruby and Rails courses!

We don't offer sales very often, but the start of summer seems like the perfect time to help you jump into Ruby/Rails and save money doing so!

Today through end of day Tuesday, June 16, save 25% off any of our courses:

Everyone saves during this sale!

  • If you've never taken an online course in our Studio, now is the perfect time to come on in at an amazing low price.
  • If you're a Studio alum, you'll save an additional 25% on top of your alumni discount!
  • And if you've already taken all our courses, consider sharing the news of this sale with your friends and co-workers so they too can jump into Ruby and Rails along with you.

No coupon code necessary—the prices are already slashed.

Come join us in the Studio this summer!

How To Write "Macros" in Ruby

April 14, 2015

In Rails you use class-level declarations such as has_many, belongs_to, and other so-called "macros" all the time. Look familiar?

class Movie < ActiveRecord::Base
  has_many :reviews
end

class Project < ActiveRecord::Base
  has_many :tasks
end

Folks new to Rails (and Ruby) often assume these declarations are a magical aspect of Rails. In fact, there is no magic—it's just Ruby code. Indeed, Ruby makes programming in this declarative style easier than you might think.

In this short video tutorial we recreate a simplified version of the has_many declaration from scratch so you understand how to apply this same powerful technique in your own Ruby code!

Thanks for watching and please feel free to leave a comment below!

P.S. If you're using Rails and it feels too magical or you struggle with Ruby concepts, check out our online Ruby course. You can start this course for free today and begin learning how to design object-oriented programs the Ruby way.

How to Create, Preview, and Send Email From Your Rails App

March 31, 2015

Rails 4.2 includes some handy new features in Action Mailer. In this brief tutorial, we'll walk through how to send emails step-by-step using these new features!

For transactional email, consider using a service such as:

For newsletters, announcements, and bulk email, consider using a service such as:

For more details, check out Action Mailer Basics and the full mail method documentation.

If you're new to Rails in general, check out our Ruby on Rails: Level I online course. You can start this course for free today and begin learning how to design full-featured Rails apps with confidence. Then take your Rails skills to the next level in our Level II course.

Thanks for watching and please feel free to leave a comment below!

How To Add jQuery and Ajax To Your Rails App

March 18, 2015

Wondering how to get started adding JavaScript to your Rails app? In this brief tutorial, we'll look at how to add some effects with jQuery and send Ajax requests in a Rails 4 app!

If any of the Rails concepts in this tutorial threw you for a loop—such as forms, partials, redirects, or other Rails conventions—check out our Ruby on Rails: Level I online course. You can start this course for free today and begin learning how to design Rails apps with confidence.

If you need a bit of help understanding Ruby blocks such as those we used with the respond_to method, give our Mastering Ruby Blocks & Iterators online course a look-see. Blocks are used pervasively in well-designed Ruby and Rails apps, and this short course will help you become a blocks master.

Thanks for watching and please feel free to leave a comment below!

How you can "feel newly empowered", too!

February 19, 2015

Thom
I really thought I had a good grasp on Ruby blocks, but I was mistaken. Thanks for taking the time to dig into blocks and iterators at this level of detail and thus saving me the time of exploring and uncovering these techniques and patterns on my own. I am NOW quite confident about my understanding of blocks, and mastery over them. I suddenly feel newly empowered!” — Thom Parkin

I love that Thom uses the word “empowered” to describe how he felt after our Mastering Ruby Blocks & Iterators course. That's exactly how I felt when I learned how to really use blocks in my own code. I'm not talking about how to write a block. Sure, understanding the basic block syntax and style is important and it's where we start in our course (free video). But using blocks effectively is about so much more than curly braces, vertical bars, and syntactic sugar.

The real sweet spot is when you start designing your own code to take advantage of the power of blocks. Indeed, well-designed Ruby code uses blocks to elegantly solve common and recurring problems, including: ...

[Continue Reading…]

"All the diagrams in your courses are total awesome-sauce!"

February 05, 2015

How do you learn new concepts best? I'm both a visual learner and a visual explainer. When it comes to learning something new, I'm a first-rate doodler. My brain engages more quickly when I can pick up a pen and draw circles, lines, squares, and all manner of arrows on a piece of paper.

The opposite is true too. When I try to explain something, I have a hard time conveying the topic with mere words. I'm compelled to draw it out. Mike, in a similar way, is compelled to code it out, as a way of explaining the concept.

MVC Diagram

It should come as no surprise then that our courses include lots of code examples and a bunch of diagrams! We don't hesitate to use squares, arrows, buttons, highlights, and whatever else it takes to help explain new concepts visually.

So we're especially delighted when we hear from our alumni that these diagrams and sketches help them really understand new Ruby and Rails concepts: ...

[Continue Reading…]

Daily course plans to help you learn Ruby or Rails in the New Year

January 19, 2015

Do you have a goal to finish your online Ruby and Rails courses soon? We know it's hard to hold fast to New Year’s resolutions once the familiar whirlwind kicks up. It can all be a bit dizzying!

Grab ahold of our daily course plans to help you stop the spinning and chart a realistic, incremental path for meeting your learning goals.

Download a plan, print it, and use your favorite-colored Sharpie to cross off the days. Each day you'll add one more facet of Ruby or Rails to your repertoire and make steady progress toward completing the course and meeting your goal. You can do this!

Guru's Reviews

January 13, 2015

"I am not sure if Pragmatic Studio guys have a 'PS I love you' sticker floating around but I would definitely put it up."

That comment on Guruprasad’s (Guru's) blog totally made us smile. Back in our early days, we did in fact have stickers!

We used to hand out these bumper stickers at the end of every public Rails courses. The stickers ended up on more laptops than actual bumpers, but by pairing them with our course evaluations as a little incentive for completing the form, we got invaluable feedback from our students.

In the case of Guru, he made up his own suggestion for a sticker and gave us a bunch of feedback! Check out his blog posts to hear more about his experience using our online courses to learn Ruby and Rails:...

[Continue Reading…]

« Older Posts