Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > run code run!

Reply
Thread Tools

run code run!

 
 
Eugen Ciur
Guest
Posts: n/a
 
      09-09-2010
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)








 
Reply With Quote
 
 
 
 
Louis-Philippe
Guest
Posts: n/a
 
      09-09-2010
[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.

 
Reply With Quote
 
 
 
 
Ben Giddings
Guest
Posts: n/a
 
      09-09-2010
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Code in a Separate Thread Have to be in a <run()> or Called by a <run()>? KevinSimonson Java 7 10-18-2010 06:39 PM
I could use some help making this Python code run faster using only Python code. Python Maniac Python 24 09-23-2007 05:48 PM
Can't Run 'RUN' Windows XP Home Luke O'Malley Computer Support 2 09-01-2005 11:38 PM
can run javascript can't run vbscript - WHY duncan ASP .Net 2 10-27-2004 09:31 AM
Anybody remember, Run Buddy Run and Second Hundred Years? Tom McCafferty DVD Video 5 10-02-2004 09:15 PM



Advertisments