NotarySojac's Profile User Rating: *****

Reputation: 53 Whiz
Group:
Contributors
Active Posts:
428 (0.25 per day)
Joined:
30-September 10
Profile Views:
45,352
Last Active:
User is offline Nov 25 2014 10:46 AM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Opera
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
50
Icon   NotarySojac I love it when UI bugs crop up that are preferable to the intended design

Posts I've Made

  1. In Topic: Small Program FeedBack

    Posted 8 Jul 2013

    I 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.

    https://github.com/t.../tree/thenotary
  2. In Topic: Small Program FeedBack

    Posted 8 Jul 2013

    View Poststeve.v, on 01 July 2013 - 11:34 AM, said:

    Hello 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.

    https://github.com/thenotary/rps

    Spoiler


    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.

    http://net.tutsplus....n-with-bundler/
    http://stackoverflow...-to-write-a-gem

My Information

Member Title:
D.I.C Regular
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Programming Languages:
C#, Ruby, Rails, js, css, AutoIT, vbs

Contact Information

E-mail:
Private

Friends

Comments

Page 1 of 1
  1. Photo

    ATC3 Icon

    13 Dec 2011 - 08:36
    Hello NoterySojac. Do you mind if I add you as a friend?
Page 1 of 1