run code run!

Discussion in 'Ruby' started by Eugen Ciur, Sep 9, 2010.

  1. Eugen Ciur

    Eugen Ciur Guest

    Hi,

    What is the best practice to code writing cycle for a typical ruby
    project? What are you using most often ?

    Here are two possibilities that I can think of

    A) Run code as frequently as you can

    1) Think about design
    2) Write little bit of code (code in small steps)
    3) Go to check for API documentation to make sure I use API correct
    4) Run code (with or without UT)
    5) Fix errors
    6) Start from 1)

    B) Run code as late as you can

    1) Think about design
    2) Write down code mixed with a lot of comments and to do's
    3) Continue 1) and 2) until you think problem is solved.
    4) Run Code
    5) Fix Errors
    6) Check API
    7) Continue 4), 5),6) until problem is solved (all UT pass)
    Eugen Ciur, Sep 9, 2010
    #1
    1. Advertising

  2. [Note: parts of this message were removed to make it a legal post.]

    would probably be close to A) but with automated testing injected in the
    loop.
    Louis-Philippe, Sep 9, 2010
    #2
    1. Advertising

  3. Eugen Ciur

    Ben Giddings Guest

    On Sep 9, 2010, at 08:41, Eugen Ciur wrote:
    > A) Run code as frequently as you can
    >
    > 1) Think about design


    1.1) write unit tests based on that design

    (Look at the API before you write code:)

    > 3) Go to check for API documentation to make sure I use API correct


    > 2) Write little bit of code (code in small steps)


    3.1) make sure that the code you've written is covered by some test
    3.2) run unit tests and make sure that all the ones that used to pass
    pass, and hopefully some new ones pass as well.

    > 4) Run code (with or without UT)
    > 5) Fix errors
    > 6) Start from 1)


    The main problem with just running the code (and not unit tests) is
    that the way you test the code, you might not use all the
    functionality. Unit tests should cover it. It's a good idea to run
    the code as a real user too, but if that's all you're doing, you might
    never actually test the code you've written that covers atypical
    operations.

    The other thing you might want to throw in here at step 7 or so is
    "refactor". Every once in a while, maybe once you've added a big
    functional chunk, go back over the code and say to yourself "What do I
    have here that I don't need? Do I have any repeated code? Could I
    simplify any of this?"

    Ben
    Ben Giddings, Sep 9, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=

    Fire Code behind code AND Javascript code associated to a Button Click Event

    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=, Feb 10, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    21,222
    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=
    Feb 11, 2004
  2. duncan
    Replies:
    2
    Views:
    6,081
  3. keithb
    Replies:
    1
    Views:
    907
    Bruce Barker
    Mar 29, 2006
  4. Python Maniac
    Replies:
    24
    Views:
    774
    Matt McCredie
    Sep 23, 2007
  5. KevinSimonson
    Replies:
    7
    Views:
    349
    Screamin Lord Byron
    Oct 18, 2010
Loading...

Share This Page