Let's Design and Build a (mostly) Digital Theremin!

Posted: 6/22/2016 7:40:57 PM
oldtemecula

From: 60 Miles North of San Diego, CA

Joined: 10/1/2014

I made some changes in my several thousand lines of VB code and now finding it a bitch to isolate a bug. It beats the Stock Market and seems to be evolving into its own life form.

The same as I don't Model, in code I have never used a flow chart. It is all in my head and I just hack away. Where we may differ is I can demonstrate results. lol

Cowboy coding comes so easy to you, do you run code or just think up little snippets and drool over it?

Christopher

Posted: 6/23/2016 11:53:02 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I made some changes in my several thousand lines of VB code and now finding it a bitch to isolate a bug." - Christopher

I've been pretty lucky with the Hive simulator code, but I did some floor planning up-front.  Structures that encapsulate functionality and data together are C++ objects.  The main memory is an obvious object, with private and public functions that read and write, copy sections, parse hal and mif files, etc.  There are 8 threads so I decided to make them objects as well, which drastically reduced redundant coding.  The core creates the memory and threads and is itself an object, so I could instantiate a multi-processor sim pretty easily.  I'm comfortable with the OO approach because it is very similar to the component approach hardware description languages employ.

But, yes, I sit around writing out small critical snippets until I feel they're pretty well nailed down before actually coding.  That makes me a slow coder, but I think I spend a lot less time tracking down bugs.  The sim code is getting a bit ungainly at this point, but I don't think I'll be adding much more to it.

VB is one of the worst languages I've used, but you're kind of forced to if you want to do anything fancy in Excel.  It's clunky, overly verbose, slow as a snail, and not very readable.  I pretty much loathe it.  C and to some extent C++ make a lot of sense to me, but some of this may be my familiarity with them.  C very clearly targets real processor hardware, and that's the best starting point for a language IMO.  C++ would benefit from a whole lot of stuff being removed, particularly most of the class and inheritance crap.  And pointers in both drive me crazy, I hate pointers and I hate the lame syntax they picked.  Pointer arithmetic is just asking for it IMO, and I think that's what makes these languages so unsafe.  If you want to indirectly reference a bunch of items instantiate them as an array.

You must be logged in to post a reply. Please log in or register for a new account.