Author Topic: Putting it all together...  (Read 6508 times)

0 Members and 1 Guest are viewing this topic.

AWW

  • Guest
Putting it all together...
« on: November 30, 2011, 05:34:45 PM »
In my short time of learning lisp, I've come to terms and understanding of functions and their uses...somewhat. I think that the bigger thing for me, is putting it all together into a program so I can understand it as a whole and not just individually. Even when I think about what I want a program to do, I can't quite figure out what all it needs to work.  So I was wondering if there was anything out there that focused on that, an e-book or something? I guess a more curious question is... how did it "click" for you?

nivuahc

  • Guest
Re: Putting it all together...
« Reply #1 on: November 30, 2011, 06:54:35 PM »
There was supposed to be a click?  :?

The things that have helped me, most of all, when it comes to Lisp are (in this order);

1. Reading this forum and looking at the work of the many (extremely talented) programmers here.

2. Reading the (AutoLSIP Reference) help files. Seriously. Sometimes just out of boredom.

3. Asking questions, even if they seem stupid (yes, stupid to me, the guy about to ask) before I ask them, because I just don't get something.

4. Occasionally having off-line conversations with one of the most brilliant developers I know, talking in big pictures, fleshing out ideas, and then going back to my computer to try and make those ideas happen.

And that's really it.

Though I really cannot stress how helpful #3 and #4 up there are. One of the things that troubles me, and I've seen other people struggle with, is that I often get blinders on when I'm looking at a problem and trying to come up with a solution. For eaxample I get it set in my mind that in order to get result A I need to do process B... so how do I make process B work in this situation? Having another person look at the same problem is likely to give you ideas for tackling that problem that you'd never consider on your own.


The only 'click' that I can think of for me was regarding VisualLISP. I saw this one day

Code: [Select]
(vlax-dump-object (vlax-ename->vla-object (car (entsel))) T)
And then I read about vlax-get-property and vlax-put-property in the help file.

After that I got 'hold of the Visual Lisp Developers Bible and started reading it from page 1.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Putting it all together...
« Reply #2 on: November 30, 2011, 08:00:44 PM »
Even when I think about what I want a program to do, I can't quite figure out what all it needs to work. 
Start with simple lisp goals and build your knowledge.
Use pseudo code to define your objective clearly in plain language.
Convert the pseudo code to actual code.
Don't be afraid to show your work here. You will get lots of help if you do.

For learning look for well commented code and try to understand what it is doing.
Ask if you get stuck.
Then look for undocumented code & try to understand what it is doing.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

hermanm

  • Guest
Re: Putting it all together...
« Reply #3 on: November 30, 2011, 09:22:43 PM »
Dive in, AWW.

There is no substitute for "stubbing your toes" on practical problems of your own design.

LISP, or any other programming language, is just a skill, like any other.

You will fail. But you will also achieve proficiency, via sustained effort.

Do keep at it.

There are many brilliant people here who will help you unstintingly.

Do not be afraid to ask questions.

No one will think you are stupid.

The only definition of stupidity is *not* asking for help when you really need it.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Putting it all together...
« Reply #4 on: November 30, 2011, 09:54:17 PM »
LISP wasn't my first programming language (I programmed in other languages as a hobbyist for many years: Turbo C, Turbo BASIC, Quick BASIC, Professional Development System BASIC, wrote articles for a computer magazine, then went on to work as a professional programmer, designing and programming water treatment plants), and to be honest, I didn't care for LISP at all. "Meh, what's with all the ephing parenthesis, jeez!" I had toyed with it and wrote some simple programs, e.g. freeze a layer by pick was one of my first efforts, but nothing particularly complex, and certainly hadn't recognized it's hidden power or elegance. That was 1988.

But then in 1990 I had to master LISP as a matter of necessity -- as fast as I could -- as a GIS project I was working on was based on truck loads of LISP code by a third party, and said code was frequently buggered. Basically I had to master the language AND fix someone else's code as fast as possible, as well as author my own solutions. I remember being under a lot of pressure. On the plus side, the third party code was written by professional programmers, and their code was written and documented very well, even by "today's standards", so even though I was fixing the code, I was learning tons from it. By the time I finished the project I had edited thousands of pages of their code and written enough of my own code to fill a 4" binder++; compressed print (and another full of SQL code, but I digress). I recall that we started referring to the project in terms of pounds of code instead of pages, it was such an unbelievable amount of code. Anyway, by the time that project was complete I felt very comfortable programming LISP and had even come to appreciate its expressiveness and elegance. Said project was only about 8 months long, but it seemed like forever, then poof, we were done.

A couple years later I decided that of all the programming I had done to date (1981 forward) I had enjoyed AutoCAD development the most, and decided to make that theater my primary focus, even though I had planned to become an uber water treatment plant designer / programmer and had invested 5 years in same. 16 years later I have no regrets about the unplanned career tangent.

To summarize, you learn to walk a thousand miles by walking a thousand miles, one mile at a time. "Aha" moments will come more frequent as you progress on your journey, book ended by sobering realizations of the vast amount you don't know, and the increasing awareness the journey isn't a thousand miles after all, but infinite. Like any art form, you will never fully master it, there is always something new to learn, always some skill that can be refined, improved, perfected ... similar to being a musician ... and why it's such a joy. Worry not about "the click" -- anticipate drum rolls -- they will come.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

BlackBox

  • King Gator
  • Posts: 3770
Re: Putting it all together...
« Reply #5 on: November 30, 2011, 10:16:47 PM »
Well said, MP.

Aside, I'd be very interested to speak with you about breaking from design, and pursuing programming. I feel that I am now in somewhat of a similar situation. Only if you're up for it.

* Edit - Apologies to OP for the tangent.

Cheers! :beer:
"How we think determines what we do, and what we do determines what we get."

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Putting it all together...
« Reply #6 on: November 30, 2011, 10:23:06 PM »
Well said, MP.

Aside, I'd be very interested to speak with you about breaking from design, and pursuing programming. I feel that I am now in somewhat of a similar situation. Only if you're up for it.

* Edit - Apologies to OP for the tangent.

Cheers! :beer:

Sure, start a new thread, but I can summarize the gist of what I'll share in that thread: Do what you love, for you will do it better than anything else, and the quality of that work will bring you ... work, money, satisfaction. Questions?

PS: Or fire me a private email if you prefer.
« Last Edit: November 30, 2011, 10:27:50 PM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

BlackBox

  • King Gator
  • Posts: 3770
Re: Putting it all together...
« Reply #7 on: November 30, 2011, 10:33:16 PM »
Sure, start a new thread, but I can summarize the gist of what I'll share in that thread: Do what you love, for you will do it better than anything else, and the quality of that work will bring you ... work, money, satisfaction. Questions?

Much appreciated.

PS: Or fire me a private email if you prefer.

... Will do. 
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Putting it all together...
« Reply #8 on: November 30, 2011, 10:41:18 PM »
So I was wondering if there was anything out there that focused on that, an e-book or something? I guess a more curious question is... how did it "click" for you?

While I agree with the life-long learning process mentioned; my "aha" moment came from reading David M. Stein's "Visual LISP Developer's Bible"... then the 2003 edition, now the 2011 edition. I've read both, and the new eBook is only $6.99 from Amazon.

There's tons of starter / beginner threads, I know Lee has posted some well written tutorials, etc. also.

HTH
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Putting it all together...
« Reply #9 on: December 01, 2011, 12:05:44 AM »
1. Read Structure and Interpretation of Computer Programs
http://mitpress.mit.edu/sicp/full-text/book/book.html

2. Learn a good text editor.
I recommend either Vim or Emacs. TIP: If you like Lisp, the language to extend the Emacs editor is "Emacs Lisp". *hint-hint*
http://www.gnu.org/software/emacs/emacs-lisp-intro/
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

AWW

  • Guest
Re: Putting it all together...
« Reply #10 on: December 01, 2011, 08:28:13 AM »
Thanks for the response and guidance.

I've had alot of downtime lately, so I've been looking into the difference API's avaliable. From what I can tell, VB/VBA is out or almost out. And I'm guessing that ARX & .NET (as well as DCL) is the future and the way to go.

I've mostly just dealt with notepad & vlide. As it works with autocad. But haven't programmed in .NET or ARX, unless ARX is an extension of Active X or vice versa? One question I do have is, are those API's avaliable to code with vlide or do I need another editor like the EMACS Seven mentioned?

Again, thanks for the feedback. I guess we all have been where I am at one point or another.


« Last Edit: December 01, 2011, 09:15:44 AM by AWW »

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Putting it all together...
« Reply #11 on: December 01, 2011, 10:27:18 AM »
Fair warning: ObjectARX is *not* a good place to start.  Thats balls-to-the-wall, full-on AutoCAD application programming in C++.  Very heavy duty stuff which requires stepping away from AutoCAD and getting very proficient at C++ first (by which time, AutoCAD has released several versions and now is a somewhat, if not completely, different API animal).

Something that always helps me is this: code is the end product, not the starting point.  If I start with code, then I end up getting shoehorned into various programming corners trying to make this bit work, that bit work, then throwing away a week of work because the entire concept was a bust.  Instead, I work out what data is required, where its required, when its required, how it gets there, etc. at the start and use that a framework to construct the code around.  Turns out it also works well when working with object-oriented programming as well as LISP.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Putting it all together...
« Reply #12 on: December 01, 2011, 10:32:29 AM »
... I guess we all have been where I am at one point or another.

yep, no worries.

As far as all those API's go, I think you are in the situation where you can't see the forest through the trees. Don't focus on that right now. List a solid goal and reach it. List another and reach it. ...A question you should ask yourself is: "Is lisp a stepping stone or not". To me AutoLisp was nothing more than a stepping stone, I moved on to C++ and am moving on to C++ and Qt (totally not related to AutoCAD or even Microsoft Windows. Weird path I know and I didn't think I wouldn't ever want to NOT write programs for AutoCAD but here I am and that's what I want to do).

No matter if lisp is a stepping stone for you or not, a good Text editor (Wikipedia that) is a necessary tool like the shoes on your feet are. Plain and simple: Vim is the best editor but has a steep learning curve. Emacs is the second best but not a lot of Integrated Development Environments (Wikipedia that) emulate Emacs...   So, learn a text editor (a good one).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BlackBox

  • King Gator
  • Posts: 3770
Re: Putting it all together...
« Reply #13 on: December 01, 2011, 10:42:05 AM »
I agree with everything mentioned above... I'd only add that *IF* learning LISP is included in your goals, then the VLIDE should be included in that process.

This is not meant to remove the correct importance of learning other good text editor(s) at all - simply put, IMO the best way to learn LISP is through VLIDE for the simple purposes of being able to Debug.

Short of using Visual Studio 2010 (which can launch ACAD at debug), the VLIDE at least offers the ability to test your code, establish break points, watch variables, etc.

AFAIK (and Se7en, Dgorsman, others?... please correct me where I am wrong here), the text editors, even the good ones, are NOT a full IDE that can launch ACAD (I think, no, I'm sure, now wait, I think), right?
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Putting it all together...
« Reply #14 on: December 01, 2011, 10:52:43 AM »
Mostly, no. My text editor is just that a text editor. I have the ability to do all things related to text files (up down left right) but i can not "debug an executable" (those kind of tasks) in my editor like you can in an IDE. There are some grey areas though. Vim has the ability to "use" the CLANG Compiler to provide code completion like in an IDE.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org