From: William Rutiser Date: 2009-09-25T00:51:37+09:00 Subject: Re: Won't Go Ill Everbe wrote: > thanks much. seems to work if i use text editor and then run from > command line. > i will also check out the ide's. > > clearly i am no pro. i need to solve complex engineering problems. i now > have 2000 lines of code in liberty basic but wind up passing dozens of > parameters into subroutines. its pretty ugly. now runs but a bit too > complex for me to debug. so i figure oop is the way to go, but > unsuppported by most basic languages. i am a bit fearful to start over > in a new language. i am thinking it is worth effort to learn ruby. > > any advice? thanks, craig. > What kind of problems for what kind of engineering? Try taking a small piece of basic code and making just the syntactic changes to get it running in Ruby. Then review the code's control structures and change them to use Ruby idioms. When you have a problem, look up the language elements that seem to be involved in a Ruby book. Check that all the paired things are where they should be( parens, brackets, braces, quotes, do's, end's etc.). When you are comfortable with straight procedural Ruby, look for groups of variables that are usually used together. Replace them with arrays, hashes, or simple data holding objects. Look for pieces of code that only involves one kind of object. Make that code into a method on the object. Explore your program and Ruby together. Every now and then you will have an an "aha" moment when everything gets smaller, clearer, and cleaner. Learn to Ruby's unit test facilities early on. Write little tests for everything and run them after each change to your code. Good luck and have fun. --Bill