Jump to content

Learning .NET


BlackBox

Recommended Posts

^^Is there anything you can't do?

 

Lee - I've often wondered the same... do you develop for AutoCAD using .NET at all?

 

I've heard you mention, discuss, etc. C/C++ before, but I've not seen code per-se.

 

Just curious, given that I'm teaching myself C#/VB.NET now :whistle:.

 

Cheers! :beer:

Link to comment
Share on other sites

Lee - I've often wondered the same... do you develop for AutoCAD using .NET at all?

 

I'll be honest, I think I've outgrown LISP. I have good intentions to start developing with C#.NET and have been studying the structure of C# (namespaces/classes/methods), but, as always happens when starting something new, without complete dedication and constant practice I find myself repeatedly slipping back into the comfortable world of LISP, then having to re-learn everything again.

 

I've heard you mention, discuss, etc. C/C++ before, but I've not seen code per-se.

 

I've studied C/C++ as part of my mathematics degree and am familiar with the syntax and various other concepts (such as pointers), but having not recently practiced writing programs in these languages, again I feel I would have to go back and re-read much of what I have learnt.

 

In the great scheme of things, I consider myself a very small fish in a very large pond. Only being profficient with a high-level language such as LISP and only being able to customise a specific software package, I am an amateur compared to those who are profficient with C++.

Link to comment
Share on other sites

I'll be honest, I think I've outgrown LISP. I have good intentions to start developing with C#.NET and have been studying the structure of C# (namespaces/classes/methods), but, as always happens when starting something new, without complete dedication and constant practice I find myself repeatedly slipping back into the comfortable world of LISP, then having to re-learn everything again.

 

I can relate, especially given that I am self-taught (with the help of others, of course!).

 

If you don't already have a copy, you might find the C# Bible handy (

 

While I've not yet mastered LISP development (IMO - hell I don't even understand DCL!... yet), between work load and cross training on Microstation :eyeroll: :spit:... I'm finding it very difficult to dedicate time learning the .NET API, let alone that of ARX (C++). Thankfully, I'm getting some awesome help from Swampers (Dgorsman, Gile, Jeff H to name a few). My goal is to transition to .NET for my primary development platform, as this will benefit me with both CAD platforms.

 

I'd really like to go back to college for a Computer Science degree... maybe take some extra programming classes. :wishfulthinking: That way, I wouldn't be relegated to working with CAD at all.

 

Anywho... thanks for sharing, Lee.

Link to comment
Share on other sites

Gentlemen .

 

First I am sorry to interfere into the discussion , but I have some points need to be clarified . and you can ignore it with no harm if it is a matter of curiosity .:)

 

- How difficult it is to learn VB.net for someone who do not have any background with it at all ?

- Is it flexible as best as Lisp and Vlisp to deal with it as a self touch without a master ?

- Finally the C++ , what is the relationship between this programming language and Autocad , and the difficulty of learning it individually .

 

Best regards.

 

Tharwat

Link to comment
Share on other sites

Oh! Before I forget... if you opt for Visual Sutdio Express (I use Visual Studio 2010 Express), and would like to enable the Debug functionality for either C#, or VB.NET projects (i.e., launch AutoCAD, step through breakpoints, etc.)... just let me know. 8)

 

Cheers! :beer:

Link to comment
Share on other sites

Oh! Before I forget... if you opt for Visual Sutdio Express (I use Visual Studio 2010 Express), and would like to enable the Debug functionality for either C#, or VB.NET projects (i.e., launch AutoCAD, step through breakpoints, etc.)... just let me know. 8)

 

Cheers! :beer:

 

I am new to what you are talking about , so the idea is not that clear to me to give a word about it. :sweat:

Link to comment
Share on other sites

Gentlemen .

 

First I am sorry to interfere into the discussion , but I have some points need to be clarified . and you can ignore it with no harm if it is a matter of curiosity .:)

 

- How difficult it is to learn VB.net for someone who do not have any background with it at all ?

- Is it flexible as best as Lisp and Vlisp to deal with it as a self touch without a master ?

- Finally the C++ , what is the relationship between this programming language and Autocad , and the difficulty of learning it individually .

 

Best regards.

 

Tharwat

 

First, I'm no expert, so correct where I may be wrong.

 

As I understand it, .NET is the Framework on which Windows is build, and all applications must operate with. This framework has different versions, for example the current .NET framework available is 4.0, but AutoCAD 2009? - 2012 products use .NET framework 3.5 version.

 

 

The .NET API can be used to develop applications in three languages (unless I am mistaken?):

 

 

  • C-Plus-Plus (C++.NET)
    • Also known as ARX (with regard to AutoCAD)

    [*]C-Sharp (C#.NET)

    • This seems to be the most popular

    [*]Visual Basic (VB.NET)

    • Although similar in syntax, this is NOT Visual Basic for Applications (VBA), which is now dead/dying

Also, these may help, Tharwat:

 

 

What is .NET?

 

What is Visual Studio?

 

What is Common Language Runtime (CLR)?

Link to comment
Share on other sites

Perhaps a moderator would be kind enough to split this thread into two, given the interest in the tangent discussion(s)? :unsure:

 

My apologies, OP. o:)

Link to comment
Share on other sites

Thank you so much Renderman .

 

I heard and seen lot of threads supporting and talking about VB.net and it flexibility , So would you please go back a little to my first and second

requests in post No 8 .

 

I have plans to start with it but I still in need of encouragement to see if it would be helpful to my aims in programming with Cad.

 

Appreciated a lot.

Link to comment
Share on other sites

If you don't already have a copy, you might find the C# Bible handy (

 

Thanks Renderman, another to add to the toolbox.

 

Thankfully, I'm getting some awesome help from Swampers (Dgorsman, Gile, Jeff H to name a few). My goal is to transition to .NET for my primary development platform, as this will benefit me with both CAD platforms.

 

The guys at theSwamp are awesome - IMO its definitely the best place for programming advice & tuition, with so many clever programmers all gathered together in one place.

 

Oh! Before I forget... if you opt for Visual Sutdio Express (I use Visual Studio 2010 Express), and would like to enable the Debug functionality for either C#, or VB.NET projects (i.e., launch AutoCAD, step through breakpoints, etc.)... just let me know. 8)

 

Am using MSVS2010 Professional 8) I'll keep that in mind though, thanks!

Link to comment
Share on other sites

I hath moved to it's own thread in .NET forum.

 

I need to get back to my .NET studies. :ouch:

 

Thank you so much for dividing the thread .

 

But my last post still there . :)

 

Appreciated a lot .

Link to comment
Share on other sites

DAMN DAMN

 

I hate it when I hit Reply to Thread button when I mean to post and it erases all of it.

 

I will make a post later where I actually spend the time to make a good complete with good grammer about questions asked.

 

Some points

 

Most .NET developers have never looked at or heard of the AutoCAD .NET API

 

Windows was not built on .NET I will go in more detail later and google it for lots of resources.

 

The ACAD .NET API is a wrapper of the ObjectARX API

 

When you compile your C#, VB.NET, F# or what ever .NET language it is compiled into IL(Intermediate language====might see called MIL or the offical is CIL)

 

When your code executes the JIT's(Just in Time) compilers convert IL to machine code. So it has no idea if it was written in C# VB.NET

The only reason I would say learn C# is it uses terms and language that most programming references use.

 

Like I said I will spend time and post something that makes sense and is much better

Link to comment
Share on other sites

First, I'm no expert, so correct where I may be wrong.

 

As I understand it, .NET is the Framework on which Windows is build, and all applications must operate with.

 

Windows was not built on .NET I will go in more detail later and google it for lots of resources.

 

I always appreciate clarification where I am incorrect :oops:.

 

I look forward to your 'more complete' post, Jeff. :geek:

Link to comment
Share on other sites

on top of the 3 mentioned languages, i would also like to add the 2 dynamic languages which are becoming increasingly popular, python & ruby. both run under microsoft dlr service on .NET framework.

 

There is a implementation of each for .NET

IronPython

http://ironpython.codeplex.com/

 

IronRuby

http://ironruby.net/

 

Microsoft dropped development of each of them and now are open source

For example for python you have the python interperter installed and does not run under .NET

Link to comment
Share on other sites

From post at Autodesk .NET forums so some sentences might not make sense but about learning .NET, and is not very good kinda all over the place from lack of sleep and will probably update it

 

 

I agree with Jeff_M and Jerry Winters book is not a good book to learn about .NET programming

 

 

 

From the little knowledge I have picked up and I sure someone has a much better info

 

and examples are for info and from memory-----the CIL code is from idaslm that is not from memroy.

 

 

 

No book or great teacher can force information in your head.

 

There is no book or manual or some magical hidden reference somewhere that will teach you about .NET programming.

 

The only way to learn and become better at anything is experience and you can use those reference's to guide and aid your experience.

 

 

 

Some things that have helped me.

 

 

 

-----Gain Expirence & CODE CODE CODE CODE

 

Code, Code, Code, Code.........

 

Most important is to keep coding

 

Start by doing examples and try writing applications about things you are interested in.

 

Start coding now and write your first application with 500 lines of code and

 

482 lines of it will be if and nested if statements.

 

So what, you will learn better and more advanced techniques and come back and get practice refactoring.

 

 

 

Once you start getting more experience under your belt you will be able to start associating what you read with actual real life experiences.

 

And you will be able to read and learn new things and actual digest because of the association to actual experience.

 

 

 

-----Learn and understand the fundamentals

 

Get a book on basic programming logic that is not language specific to learn the fundamentals, most .NET books assume you understand basic concepts.

 

 

 

-----Get a basic non-detailed overview and see how it fits together

 

People put down the 'Learn C# in 24 hours' books but I think they are good for starting out.

 

For me when learning a new subject I like to get a very high level look at it so you get a basic idea of the subject.

 

The 24 hour books will not teach you to start cranking out apps but you get some general ideas, and see that you must learn these fundamentals to understand other aspects and the reason for learning them.

 

 

 

-----Learning how to find information

 

No reason to remeber anything you can look up or it is better to understand a concept and know where to find info

 

than just remeber them.

 

 

 

Join very popular .NET forums that attract a lot first year or first programming class members, and try to answer their question, and do not look at other answers until you come up with something.

 

The reason for that is by finding the answer you learning how and where to find information.

 

More experienced members will post links that add more resources to your toolset and you can compare your answer.

 

You will also see a variety of subjects and pick up what to look for or where to go when you need to accomplish a certain task.

 

For example: Some subject you are familar with you have certain links you go to for info or for a particular aspect you might use a certain book that has great info on that aspect, but you know where to go find the info you need.

 

 

 

-----Debug

 

Watching how a program executes line by line and watching how the objects change state.

 

Making the code come alive and being able to associate the code with visual experience.

 

If you do not step through code or print all steps and state change you really do not know what the code the doing.

 

You are completely blind and same as running software that you buy.

 

 

 

-----Pick certain areas to concentrate on

 

I understand that there is so much out there and you have pick and choose what to learn.

 

And with .NET it makes programming tasks easier but at the same time hides the fundamental concepts from you.

 

 

 

For example a simple set of instructions to add 2 and 6

 

C#

        int x = 2;   
        int y = 4;        
        int total = x + y;

and VB

       Dim x As Integer = 2 
       Dim y As Integer = 6       
       Dim total As Integer = x + y

 

Say you added Console.Writeline(total) to the end.

 

 

So you could understand that as

 

1. Print the total variable to console screen

 

2.Total is a lvalue which persist beyond a single expression and lvalue expression refer to memory locations.

 

So to get the value in total, Under the hood it does 3 steps

 

gets the address for total

 

get the 32 0's and 1's at the address and the following 3 address locations since it is a int32(32bits 4 bytes==4 locations)

 

Run the algorithm to express the 00000000000000000000000000000110 as integer value and print to screen

 

In C++ the first 2 steps are like

 

int address = &total

 

*address

 

 

 

3. Not that I would never write it this way or fully understand it

 

(Side Note you cannot create global fields or members in C# but you could with CIL)

 

 

 

Here is another way to write the program

 

To really understand how that really works you need to understand the code

ldc.i4.2  //Load Constant int32 2
//--- Push 2 on stack as int32
stloc.0   //Store into local Variable 0 
//--- Pop value from stack into local variable 0
ldc.i4.4  //Load Constant int32 4 
//--- Push 4 on stack as int32
stloc.1   //Store into local Variable 1
//--- Pop value from stack into local variable 1
ldloc.0   //Load local varaible 0 onto evaluation stack
//--- Load local variable 0 onto stack
ldloc.1   //Load local varaible 1 onto evaluation stack
//--- Load local variable 1 onto stack
add 
//--- Add 
stloc.2    //Store into local Variable 2
//--- Pop value from stack into local variable 2
ldloc.2   //Load local varaible 2 onto evaluation stack
//--- Load local variable 2 onto stack

 

 

 

or go another level deeper and write it as

 

0x18  //ldc.i4.2
0x0A  //stloc.0
0x1A  //ldc.i4.4
0x0B  //stloc.1 
0x06  //ldloc.0 
0x07  //ldloc.1
0x58  //add     
0x0C  //stloc.2 
0x08  //ldloc.2 

 

 

 

or go deeper to point where you try to watch voltage change at memory locations.

 

 

 

That is tough where to decide how deep you need to go for a understanding required to meet you needs.

 

 

 

 

 

----Final points

 

You have to enjoy it and have the drive to learn

 

Start doing Crystal Meth or get a prescription to a amphetamine so you can stay for days coding---just joking

Link to comment
Share on other sites

IronRuby and IronPython, until November 1, are Microsoft-supported and .Net-targeted versions of the Ruby and Python dynamic programming languages. After November 1, they will belong to the community and won’t be Microsoft properties any longer.

 

http://www.zdnet.com/blog/microsoft/microsoft-offloads-ironruby-and-ironpython-languages-to-external-developers/7790

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...