Reputation: 53 Whiz
- Active Posts:
- 428 (0.34 per day)
- 30-September 10
- Profile Views:
- Last Active:
- Jul 23 2013 08:37 PM
- Who Cares
- OS Preference:
- Who Cares
- Favorite Browser:
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Who Cares
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 8 Jul 2013I couldn't resist creating a branch and refactoring a bit which you can see in a new branch of the code I've created. Specifically note how I'm using a function called 'puts' which automatically puts a \n at the end of the string. It's pretty handy. I'm often guilty of placing lone puts statements just to create new lines, rather than using the \n embedded in my strings, though that creates more lines.
Also notice, I used symbols in a manor that I found humorous and 'lucky', though realistically that approach isn't very flexible.
Posted 8 Jul 2013Hello Community,
I have just created my first ruby program and I would like some feedback on it. I am very excited about learning this new language and have come to learn many things about it these last couple of days. I am coming from a basic/intermediate level C++ and C# background and I am just expanding my knowledge to learning other languages.
First off, the code looks pretty good for a new user. I'd like to mention that one of the most amazing things about ruby is gems (package, application, and dependency handling infrastructure), have you heard about gems yet? It's easy to make this into a gem, nah! trivial if you use commands like bundle gem rps. Also, another powerful tool that rubyists use is git. This code would look really beautiful on github... in fact (*alt tabs for 25 seconds into terminal) now it's on git, check it out.
From there you'd probably like to see about turning it into a gem so your ruby program is quick and easy to deploy on any PC in the world running ruby (just type `gem install your_gem_name` and gem pulls it down from the Internet and installs it). It's also good to figure out how programs are split into multiple files to make them more clear (ie, the presentation code should be in a seperate file from the logic code). Feel free to ask any follow up question (or just leave remarks on your reactions as you find time to study what's been discussed here, this forum is kind of a slow one that really doesn't get too many "help vampires" as they're sometimes called).
After looking at your code in github, I felt like having that method named "gameResult" was misleading. It isn't returning a result, it's a method that "calculate_winner". (btw, we use underscores to separate words in variables and method names because it's easier to look at our code casually). And as others have mentioned, you've given that method too many responsibilties, not only is it responsible for calculating something, but it's also responsible for presentation. That kind of refactor will really come in handy if you go the extra mile and start unit testing this code too, which I highly recommend you do before you move on to the next language to explore.
Posted 31 May 2013Coming from the world of .NET controls, Ruby has several libraries/plugins of open source controls, are there any recommended plugins that are commonly used for web development
I'd be interested in hearing more about the world of .NET controls with regard to web development. I've only done WPF and Winfroms and didn't find myself breaking into the world of web dev via .NET for some reason.
In the ruby world, HTML 5 is the big deal, and Flash tends to be shunned quite a bit. Canvas, dom element manipulation is often favored. Also jquery tends to be used heavily. I personally don't use any of those widget frameworks, but that's just because I can never find the time to do hello world tuts for them.
HTML 5 is coming out with something called "Shadow DOM" which a lot of us ruby devs are pretty excited about for rapidly building reliable, reusable widgets using plain HTML 5 http://www.html5rock...ents/shadowdom/
Rails developers will probably use (for any given project):
Devise (user logins)
MySql/ postgres (database gems)
Nokogiri (XML parsing)
Twitter bootstrap (for UI being done automatically)
For specific tasks, it's likely that the ruby world of gems will have exactly what you need if you search for it.
for a beginner what IDE would you guys recommend.
I found Aptana Studio 3 to be a comfortable IDE after switching from Visual Studio in making desktop apps. Vim is handy to know too, the IDEs aren't quite as helpful (or necessary) in dynamic languages such as ruby, but it sure is nice to be able to use Aptana to Ctrl+click a method call and have the IDE take you right to the declaration without having to sort out C-tags like vim makes you do.
P.S. the rails framework is so, so vast that it's hard to get a good feel for what it is without reading a massive tutorial, such as http://railstutorial...s-tutorial-book I strongly recommend going through it.
Posted 8 May 2013Just to make this thead a little more classy, I'll update with what I've settled into doing.
To rapidly generate a new prototype gem, I've installed ore which sets up the skeleton for me.
$ gem install ore
Now when I want to create a new library (typically I see the need for a new lib when I'm smack in the middle of another project) I just need to invoke ore on the commandline.
$ cd ~/dev/ruby $ mine app_name
It consults the defaults specified here:
bundler: true gemspec_yml: true rubygems_tasks: true rspec: true standard_prototype: true
The ensures that the project has a Gemfile, rspec testing files and a decent Rakefile. Also ato the bottom it says standard_prototype: true. That's a template I jotted up today. I cached it on github and can installed it on the commandline with the below command.
$ ore install https://github.com/TheNotary/standard_prototype
That template adds a bin folder and allows the gem to be called on the command line via gem_name blah which just puts the word blah to the screen.
Posted 8 May 2013I started playing around with google to configure bundler for this, and that lead to a gem called ore which does pretty much exactly what I need (though I'd like to tweak the rakefile it generates and the docs are a little iffy on how templating works).
$ gem install ore $ mine project_name --rspec --bundler
- Member Title:
- D.I.C Regular
- Age Unknown
- Birthday Unknown
- Programming Languages:
- C#, Ruby, Rails, js, css, AutoIT, vbs