Author Topic: Learning AutoLisp--NOT For automating AutoCAD  (Read 3604 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
Learning AutoLisp--NOT For automating AutoCAD
« on: June 18, 2011, 07:11:01 PM »
I know the title does not make much sense and course it would be used for AutoCAD.

Asking any of you programmers if AutoLisp is a good language to learn for making you a better programmer?

Has it added much insight and better thought process to your software development. (AutoCAD or non-AutoCAD)?

Basically my intrest is not so much the automation of cad but picking up a range of valuable programming skills.

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #1 on: June 18, 2011, 07:19:22 PM »
I found this quite amusing, shared on another forum.

LE3

  • Guest
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #2 on: June 18, 2011, 07:34:51 PM »
If you are asking about AutoLisp or Visual Lisp then:
Do not waste your time.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #3 on: June 18, 2011, 07:57:00 PM »
Warning: If you fall in love with LISP other languages may become ugly to you.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #4 on: June 18, 2011, 09:19:52 PM »
I found this quite amusing, shared on another forum.
LOL
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

JohnK

  • Administrator
  • Seagull
  • Posts: 10659
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #5 on: June 18, 2011, 10:10:57 PM »
Learn Scheme instead but i warn you, if you go down the Scheme route you had better put on your big boy pants because Scheme is more like a language of academia (the language attracts some BIG fish, like language designers, professors and what not).

*Lisp is fun partly because its such a high level language (not much required as far as creativity goes) and the last reason its fun is because there is some assembly required (a lot of stuff isn't there so you find yourself building small helper apps a lot).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #6 on: June 19, 2011, 02:11:45 AM »
Asking any of you programmers if AutoLisp is a good language to learn for making you a better programmer?

I am not convinced it will make you a better programmer, but not because you will not learn skills, but rather because the skills you learn might well be limited to interaction with AutoCAD.

Has it added much insight and better thought process to your software development. (AutoCAD or non-AutoCAD)?
Basically my intrest is not so much the automation of cad but picking up a range of valuable programming skills.

Now, the thought process portion on the other hand, I think is quite interesting.

I started programming over 30 years ago using simple Basic. The syntax was straightforward and the execution was linear. For the purpose of the programming I was writing, it was good enough. I picked up lisp around '93 and was quite confused because while it appeared to be a linear structure, the code is actually written in an inside-out fashion. It forces the programmer to consider the order of operation instead of thinking in a straight line conceptual theater.

Lisp also introduced me to the first real concept of datatypes, although they are not declared as such i.e. a variable can be a string, integer, list, real number etc. it can also be reused as a different data type on the fly. Because of the flexible nature of variable usage, one must be keenly aware of the variables used, what type of data is in each variable and whether or not the variable is initialized. In most high level languages simply defining a variable initializes it to the default datatype value (i.e. 0 for an integer or "" for a string). This is useful to the programmer just throwing together a bit of code, but in lisp, the programmer will have to think about the variables and what they contain at any point in the code.

Another habit that it will help instill is the explicit nature of terminating functions and code segments. For example, in C# code segments are bound by curly braces and VB uses context strings. The proper closing of parenthesis' will force the programmer to consider the code wrapped up in the code segment. Long functions become untenable and the lisp programmer will certainly break it down into smaller bits of reusable code, if for no other reason than to make the code easier to understand ... after all it is Lost In Stupid Parenthesis. ... ultimately, you will choose to utilize smaller code segments and will build libraries of functions.

Error handling in lisp is limited to simply quitting the code execution if something goes wrong. In many higher level languages, the error is merely ignored (VB's On Error Resume Next comes to mind) or an error isn't thrown at all. In lisp though, most errors will result in catastrophic failure of the entire code. There is no "Resume Next" in lisp. The programmer will have to consider how to handle every conceivable error and write copious amounts of code in many instances, simply to handle something as simple as an incorrect datatype. This leads to the practice of checking variables before acting on them. Interestingly enough, my .NET instructor in college used to get upset because I wouldn't utilize Try Catch blocks on simple bits of code. If you can code around a known or expected error, why not? Seriously, if you know that a variable could be null at a particular point and could cause a problem, simply check for its value before acting on it instead of acting on it and then trying to figure out what to do then.

In the end, I don't think it necessarily makes you a better programmer for having learned lisp, but the simplicity of it makes it a quick learn and the crux of your question is whether or not you can gain anything useful from learning it ... I say yes

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

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #7 on: June 19, 2011, 04:24:41 AM »
Warning: If you fall in love with LISP other languages may become ugly to you.
1+
Speaking English as a French Frog

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #8 on: June 19, 2011, 04:54:24 PM »
From the perspective of a C++ and .NET programmer who knew nothing about LISP six months ago,  It's a painful process to migrate existing LISP routines over to .NET. The code is so confusing and cryptic, I don't see how learning LISP could have any benefit over learning any other mainstream language first. Now, the benefit to using it for AutoCAD is that the API is much better documented than the .NET API.
Revit 2019, AMEP 2019 64bit Win 10

JohnK

  • Administrator
  • Seagull
  • Posts: 10659
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #9 on: June 19, 2011, 05:35:59 PM »
Scheme has the ability for .net. I had a few other thoughts before/when i made my suggestion like: good book, easier to step down to AutoLisp, not tied to AutoCAD, etc..
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Learning AutoLisp--NOT For automating AutoCAD
« Reply #10 on: June 20, 2011, 12:43:39 PM »
No
James Buzbee
Windows 8