Author Topic: Third Routine - Working Progress  (Read 12320 times)

0 Members and 2 Guests are viewing this topic.

bchapman

  • Guest
Third Routine - Working Progress
« on: February 02, 2013, 11:14:54 PM »
I didn't know C# or .net less than a week ago (though am fairly strong with lisp and web-based coding like active-script), so don't hassle me to much. I'm going to go back and do the introductory stuff from Autodesk...might go through the labs.  Having trouble understanding why I have to keep re-defining junk as other junk... this language seems incredibly inefficient...though I am guessing there are ways to skip all that. FYI if you reply with experienced c# coder terms... I'll likely have no idea what you're talking about... I still think of the code below in "lisp" terms...setting variables, etc.

Thanks!


Updating code...will repost soon!
« Last Edit: February 03, 2013, 07:30:10 AM by BC_in_NV »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Third Routine - Working Progress
« Reply #1 on: February 03, 2013, 12:13:00 AM »

Just running past.
Frankly, the CAPITALS make me want to keep running :(
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

bchapman

  • Guest
Re: Third Routine - Working Progress
« Reply #2 on: February 03, 2013, 03:21:15 AM »
Sorry... still learning... I'm using them to help me see the differences from variables and command junk. Easier for me to read than what I see everyone else write so I think I will keep doing it that way.
« Last Edit: February 03, 2013, 03:52:03 AM by BC_in_NV »

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Third Routine - Working Progress
« Reply #3 on: February 03, 2013, 03:57:02 AM »
Hi,

About capitalization convention in .NET, you can see this:
http://msdn.microsoft.com/en-us/library/vstudio/ms229043%28v=vs.100%29.aspx
Speaking English as a French Frog

bchapman

  • Guest
Re: Third Routine - Working Progress
« Reply #4 on: February 03, 2013, 06:48:29 AM »
Thanks! I read through it but don't quite understand it all... still at 101 level.  I did see the comment about all caps making it confusing for a programmer to tell the difference between a property and class... fortunately I'm writing this stuff for myself and those I choose to share it with (otherwords its not my day job). I may have to keep the all caps for a while until I can understand it better... guess only those who really want to help will help anyway...others can troll away.

Much appreciated!

TheMaster

  • Guest
Re: Third Routine - Working Progress
« Reply #5 on: February 04, 2013, 11:32:48 AM »
Thanks! I read through it but don't quite understand it all... still at 101 level.  I did see the comment about all caps making it confusing for a programmer to tell the difference between a property and class... fortunately I'm writing this stuff for myself and those I choose to share it with (otherwords its not my day job). I may have to keep the all caps for a while until I can understand it better... guess only those who really want to help will help anyway...others can troll away.

Much appreciated!

I won't bother to read code that's all caps.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Third Routine - Working Progress
« Reply #6 on: February 04, 2013, 12:00:33 PM »
All caps in code is generally reserved for constants ... generally ...

Depending upon who you talk to, and there is alot of dissention in the subject, you should use camel case, hungarian notation, descriptive variable and function names etc.

As far as I am concerned, the particular "standard" you choose to use depends upon many different criteria.

1) Is it easily understood by those who didn't write it?
2) Is it consistent throughout the code?
3) Is the code in-house or is it shared with outside organizations?
4) Is there an existing standard in place?

These are but a few of the examples that one should consider ... but you should remember that in some programming languages, compilers are case sensitive .. so Point, point and POINT are all different.

Remember, it really only matters what "standard" you choose to use to the degree that others (and you) can read and understand what is being coded. If you are the only programmer, and your code will never be seen by those outside your group ... code it how you like. Your product is the compiled code, not the source.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

TheMaster

  • Guest
Re: Third Routine - Working Progress
« Reply #7 on: February 04, 2013, 07:54:41 PM »
All caps in code is generally reserved for constants ... generally ...

Depending upon who you talk to, and there is alot of dissention in the subject, you should use camel case, hungarian notation, descriptive variable and function names etc.


There isn't much dissention on the question of whether all caps is reasonable. Most humans have a hard time reading all caps, whether it is code or just about anything else that's written.

The bottom line is that I and probably lots of others who might be willing to help, will not bother to read code that's all caps. 

That's the bottom line for someone that is here lookng for help.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Third Routine - Working Progress
« Reply #8 on: February 04, 2013, 10:46:11 PM »
You misunderstood what I said ... certainly there is no dissention on the use of all caps, it is certainly difficult to read ... the dissention is on what constitutes the "correct" standard by which one should write code.

I have written code for alot of companies ... everyone seems to have a different "standard" that I must adhere to ... I don't like it, but it pays the bills. Thankfully, none of them have ever been all caps!
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

bchapman

  • Guest
Re: Third Routine - Working Progress
« Reply #9 on: February 05, 2013, 05:51:22 AM »
Sorry TT I pulled the code cuz it was screwed up... I should clarify that not the entire code was in CAPs... but I was using the caps to help me identify the difference from what I could set myself, or what I would call a "variable" in Autolisp which is where I come from, versus what was being done by computer, which was regular case. I'm hoping to get good enough to read the code and understand it the way ya'll do. Frankly though, sounds like help will not be provided in this forum if I continue my current efforts... Considering that, I am wondering if help would be provided even if I did or if some other formatting issue would be found to give reason for others to move on.  It's a good thing there are lots of forums out there... bound to find some that will help regardless.
« Last Edit: February 05, 2013, 06:06:52 AM by BC_in_NV »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Third Routine - Working Progress
« Reply #10 on: February 05, 2013, 08:16:01 AM »
< .. >  guess only those who really want to help will help anyway...others can troll away.

Much appreciated!

Well I won't comment on your CAPITALS again. if that's what you want.

.. a troll is the nicest thing I've been called all week :-D
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

bchapman

  • Guest
Re: Third Routine - Working Progress
« Reply #11 on: February 05, 2013, 08:48:19 AM »
Sorry Kerry... I am taking your advice to heart... it will be a difficult transition but should break the habit right-away.

TheMaster

  • Guest
Re: Third Routine - Working Progress
« Reply #12 on: February 05, 2013, 11:32:49 AM »
Sorry TT I pulled the code cuz it was screwed up... I should clarify that not the entire code was in CAPs... but I was using the caps to help me identify the difference from what I could set myself, or what I would call a "variable" in Autolisp which is where I come from...

Most of us here are from the same place, in case you didn't know.

Back when I wrote the AutoLISP chapters of Maximizing AutoCAD R13, I wrote a code editor for LISP (called LispPad, written entirely in Borland Delphi), which was included on the CD that shipped with the book. It had a few features (like data tips and dynamic help) that predated most similar features in today's IDE code editors, that made it extremely useful for writing and debugging LISP. Of course, it's nothing like the Visual LISP IDE which didn't exist back then, but was still much more useful than plain ole Notepad.

In any event, Visual Studio's syntax highlighting is how we distinguish different types of code elements, and is much more effective at solving that problem than using upper-case identifiers.
« Last Edit: February 05, 2013, 11:38:36 AM by TT »

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Third Routine - Working Progress
« Reply #13 on: February 05, 2013, 11:38:46 AM »
^+1
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: Third Routine - Working Progress
« Reply #14 on: February 05, 2013, 11:39:42 AM »
BC,

At the risk of being perceived to be a member of the male genitalia I'd like to offer my protest to your thoughts of leaving the swamp.

IMO:

The swamp is the best place on the net for AutoCAD programming.  You're a fool to not utilize it.

You need to forget your ego.  I've read several times about how you're learning and you're new, but frankly I don't care.  I get the impression that you're used to knowing what you're doing and this step into unknown muddy waters is a little scary (especially with the potential ogres [yes at the swamp I like to think of them as ogres rather than trolls {hope that's ok with you kerry}]) but it's wasting everybody's time reiterating that you're learning.  Instead of telling me what you don't know, I'd like to see you tell me what you're doing, what you know (or think you know) , and what you need to know.

These guys do want to help you, they've gone as far as telling you what they want from you to minimize the time they have to spend looking through your code (they are doing it for free...) to understand what you're trying to do, considering you don't provide any explanation or comments.

That said, I suggest you suck it up and stick it out.  I don't want to see you quit, this is a very powerful application and you've made the right choice in stepping beyond lisp.  Stop complaining about what is being provided for free help, these guys know everything, you want them to be able to read your code.

If it's helpful, I spent a lot of my very early time on through the interface.  It took about a year of working on cad customizations before I came across anything really unique that I couldn't find in another post somewhere, so I didn't have any need to post any questions or comments until recently.  I was disappointed to get very little criticism, so it really irritates me to see you getting good critical input and not appreciating it.

Cheers