Online Ruby Code Challenge with built in testing - ruby

I came across this link yesterday: http://toys.usvsth3m.com/javascript-under-pressure/
Its a javascript code challenge with integrated testing.
I have 2 questions about this:
Does anyone know of something similar for ruby?
How would you approach building something like this?
I would love something like this to help sharpen my ruby skills. And I think it would be very useful for many people learning ruby. If it doesn't exist, I may like to try building it.

That is a awesome website that am definitely going to start using. As for Ruby I know
one website which is not exactly the same but it's pretty cool.
Its called exercism.io and it was built by my teacher from Jumpstart Labs. You should
check it out as its a great way to learn how to write great code in ruby and various
other languages.

Related

Collaborative Ruby resources for novices

I am very much a Ruby newb - hoping to migrate to Ruby on Rails (although I have walked through Mike Hartl's Tutorial, which was excellent). I just want to solidify my Ruby knowledge first.
I am working on a hobby Ruby project to help me learn. I am pretty happy with how far I have got so far, but wanted to discuss/share it with other like-minded novice/beginner programmers.
Can anyone point me to a 'community' that promotes collaboration, critisim and discussion on code (ideally Ruby, obvs)?
If such a community doesn't exist, does anyone have any advice on how to find other like-minded programmers working on small-scale scripts/programs?
I have an account on Github, and on here (obviously!). Whilst Github is great for navigating around, cloning and looking at people's code, I don't feel anywhere near the level where I can start to actually contribute to anything and likewise request people look at my code. Maybe I am just being a wuss and I should just jump in the deep end? Perhaps I am not using GitHub correctly as a 'social network'.
Also, from what I can see, StackOverflow is not the place to send out 'Hey, check this out and let me know what you think' type requests either.
Not meant to be a discussion - just whether anyone knows if such 'networks' exist.
It depends on where you're located, but hacknights (Ruby or otherwise) are probably up your alley. There are different flavors (Are you solving a stated problem? Working on something general?) but usually you can work with others in a collaborative and low-stakes environment. I'd suggest searching for "hacknight" in your area and look at any past or upcoming nights.
As an example, see http://www.meetup.com/torontoruby/events/53887372/
RailsCasts - very interesting project for knowing ruby-technologies.
Also you can going to software-company and start working, and you get criticism, discussions and collaboration :)

Can you use ruby for web pages other than ruby on rails?

Is Ruby primarily only used in ruby on rails? Is it used on the server side for general work like php is? Also, I haven't seen a lot of hype about rails anymore. Is Ruby and/or RoR dead or fading away?
I ask because I was interested in RhoMobile for building mobile apps, but I didn't want to get into using an antiquated language.
Thanks.
edit: Can i use Ruby for web pages if I don't want to use rails? (I do not mean another framework. I mean like php.)
Regarding your question about Ruby and/or RoR dead or fading away, look at the job trends
There are many web-frameworks for Ruby, not just Rails, Sinatra being one of them.
You shouldn't be deciding to use a language or technology, because there is or there is not a hype around it.
If a product is able to solve your problems, then you should use it. I know people building stuff in Smalltalk nowadays (who would have thought, right?), because it's great and it works.
Take a look at Sinatra, for example.
Also there is a lot of tools written entirely in ruby.

Learn Ruby Without Poignancy

I suppose this is two very closely related questions:
Everyone says to start with Why's (Poignant) Guide to Ruby, and I can't stand that book; what's another good starting point for an experienced programmer that has a more serious tone?
If I'm not the sort of person who appreciates _why, should I skip Ruby because the community will not be to my taste?
I'm currently rolling through Programming Ruby: The Pragmatic Programmer's Guide. So far I think the concepts are well-defined by the authors, and the examples provided help clarify any misunderstandings. The book is available for free online or you can order a copy:
http://www.ruby-doc.org/docs/ProgrammingRuby/
Update: More current version of book (Thanks bgporter)
http://pragprog.com/titles/ruby3/programming-ruby-1-9
The only problem with the online version is that it is a little outdated. I don't know Ruby that well yet so I can't say how much of the book is still valid in all cases, but the examples have worked for me so far when I run them. Note that the book available for purchase is up to date. It's hard to beat free, so be sure to check this guide out.
That being said, I don't think you should skip out on Ruby just yet. I've had a blast learning the language so far, and I'm looking forward to doing some full-fledged web development with Rails soon. At the very least give the language a chance; I think you'll find it a joy to work with.
I bought a lot of books learning ruby, the Well Grounded Rubyist was hands down the best.
And while we aren't really a community of _whys, we are a community of people who appreciate creativity and cleverness in code. If you are the sort of person who thinks there should only be one way to do something, and that way should be the clearest and most straight forward possible, python is probably for you. If you are the person who likes to push the language as far as it will go to create interesting and clever APIs, ruby is probably for you.
The Ruby Programming Language.
Programming Ruby would be my choice. It's also known as the Pickaxe book because of the cover:
It's a great introduction to Ruby. Why they still have the huge API reference in it in this day and age escapes me, though. It makes it thick as a brick, which is its only fault.
You can also find it online, although I think it's the first edition, which is well dated: http://ruby-doc.org/docs/ProgrammingRuby/. The third edition is the one in print now, it was updated just months ago and covers Ruby 1.9.2, which is the latest version of Ruby at this time.
I don't particularly like _why either. He created some great libraries, but I can't stand the Poignant guide, nor any of the talks he made. You don't have to like him, or be like him to belong in the Ruby community.
Ruby Koans are great for learning those small things that make Ruby unique.
It's basically set of excercises that show you how things work. Each excercise is in form of a failing test, and you have to make sure it passes. And they're fun! :)
If you're going to do them all, I also suggest enabling autotest, so you won't have to run them manualy. This article explains how.
Not everyone says start with Why's book, for instance, me.
Here's a quick list of my on-disk Ruby books and references. You can search for their individual titles on the interwebs. Some are commercial, and some are free. I linked the ones that are part of an app's documentation that I saved as PDFs so I'd have them on my laptop.
Agile Web Development with Rails
Programming Ruby
Ruby Best Practices
Sequel cheatsheet
Sinatra Book
The Ruby Cookbook
The Ruby Programming Language
The Ruby Way
The Well Grounded Rubyist
Why's book is worthy, but reminds me of Hunter S. Thompson trying to write a programming book, complete with Ralph Steadman drawings, which really disturbs me.
Also, don't overlook using ri, which is the on-disk reference to Ruby's libraries and gems. Also, the core library and standard library docs are really useful.
I was in your position this summer. Why was not for me, but I did find an excellent online resource: http://railstutorial.org/. It is actually for learning Ruby on Rails, but you can use it to learn Ruby as well. I'm not very experienced but I believe you can be part of the Ruby community without appreciating Why :-).
http://railsforzombies.org/ is a nice one , although it is not a book
Chris Pine's Learn to Program It's very straightforward. I started learning right away. It was very encouraging.
My colleague has written an excellent post summarizing starting points, books to read and paths to follow when learning ruby at http://www.jasimabasheer.com/posts/meta_introduction_to_ruby.html
I'd recommend taking a look at it, it has a wealth of information.
To add more info to the answers above, not really a book to learn ruby but a some companion resources for the learning process:
Ruby Language Quick Ref
Essential Ruby Refcard

Is there a Perl equivalent of the ruby koans project?

Is there a Perl equivalent to the ruby-koans project?
When I was starting to learn ruby a few months ago I stumbled across ruby-koans and it was a huge help for learning the basics of the language.
I now need to poke at some Perl code, and while I've hacked together a few Perl scripts in the past I've never really learned the language, and every time I have to refer back to older scripts I wrote for even simple things. I have a feeling that something like koans would make it much easier for me to learn and retain knowledge of Perl.
Does anything like that exist?
Two possible options in absence of 100% identical alternative:
A mid-point between perldoc and ruby koans is O'Reilly's Perl Cookbook.
It offers working "how to solve this particular task" examples.
As a DIY perl koan, how about perusing "perl" tag on StackOverflow and trying to answer the questions (without peeking at answers)? Not 100% the same but a great way to learn by doing.
One great resource that I use to quickly move between languages is RosettaCode. Its not tutorials, but a wide assortment of simple programming tasks done in many languages. I find that if I know one or two languages on the page, using them, I can usually figure out how an unfamiliar language on the page works. The Ruby, Python, and Perl sections are even close alphabetically, making jumping back and forth easy.
Perl happens to come with great documentation that is more than just a list of API functions, parameters and return types.
Those tutorials include a lot of code samples that show what to do and what not to do.
In my experience, one needs to read ALL of the bundled documentation at least once before seeking other sources of wisdom.
I don't know of anything exactly like the koans.
The standard docs have lots of example code--especially the tutorial and cookbook style articles.
Some other resources:
Perl Advent Calendar
The Perl Cookbook
PLEAC - Programming Language Examples Alike Cookbook
Here is a repo on GitHub that provides a good number of koans:
https://github.com/forcedotcom/PerlKoans
Try reading "Learning Perl" (not earlier than 4th edition) or "Beginning Perl". Both has exercises.
Still in its infancy but this is a start.
https://github.com/maio/perl-Koans
I just recently came across the Perltuts project. It has a similar feel to Codecademy.

How to get started with Ruby programming language with Java background?

I am intermediate in java but as one of the company requirements they are looking for JAVA+RUBY programming language..
Can anybody help how to get started with Ruby I need to get it done in next one month so that I can crack the interview of the company...
I wanna know how does Ruby work like compiler, is it platform independent or how does byte code generated..
I must be able to write the small level programs in Ruby..
Like in java First I need to download JDK den getting started with programs..
How about Ruby what all I need to install in my computer..
Thanks..
To Ruby From Java
To Ruby From Other Languages
Download Ruby
The Pickaxe book
Why's guide
Kind of surprised no one has mentioned JRuby yet.
One of its strengths is the ability to natively call Java classes, so you can use a lot of the frameworks from Java that you're already familiar with.
Downloading the Ruby Koans is another great way to learn
http://github.com/edgecase/ruby_koans
Pragrog books are always good:
http://pragprog.com/titles/fr_j2r/from-java-to-ruby
Start here:
http://tryruby.org/
Once you do the 15 minute walk-through, go here:
Programming Ruby: The Pragmatic Programmer's Guide
To Ruby from Java:
http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-java/
That is the official site for Ruby and will be able to point you to language downloads and other resources.
How about the Ruby language web site: http://www.ruby-lang.org/en/
Also, I would advise you not to try and come across as a ruby expert in the interview after only playing with it for a month. It's better to err on the side of honesty, because a good interviewer will be able to tell when you are faking it... or worse, it will show when you start working.
Ruby is a cool language... have fun!

Resources