Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 2nd, 2007, 1:49 PM   #1
commodore
Programmer
 
Join Date: Nov 2005
Location: Estonia
Posts: 97
Rep Power: 0 commodore is an unknown quantity at this point
Why is everyone .NETing?

I see people using .NET languages all the time. Why are they so popular? Is it because .NET is so good? Or Microsoft's propaganda? Or because they teach them in schools? Why do they use .NET for teaching programming?
commodore is offline   Reply With Quote
Old Jan 2nd, 2007, 1:59 PM   #2
Ravalon
Newbie
 
Join Date: Dec 2006
Posts: 3
Rep Power: 0 Ravalon is on a distinguished road
I use .NET because it's better for Windows development than any of the alternatives. Yeah, there's propaganda, but the reality is that .NET is a great platform to work with. I'm not sure about teaching though. I thought schools were still into the Java craze.
Ravalon is offline   Reply With Quote
Old Jan 2nd, 2007, 2:00 PM   #3
BinarySurfer
Programmer
 
BinarySurfer's Avatar
 
Join Date: Dec 2006
Posts: 53
Rep Power: 0 BinarySurfer is an unknown quantity at this point
My programming teacher taught VB.NET because it was easy to develop the GUI and it had good debugging tools and stuff. I guess it made programming easier for others to understand and it practically codes itself as you type. I didn't like it, so I'm an exception.
BinarySurfer is offline   Reply With Quote
Old Jan 2nd, 2007, 2:55 PM   #4
Tim
Unverified User
 
Join Date: Dec 2006
Location: Bristol UK
Posts: 19
Rep Power: 0 Tim is on a distinguished road
I believe that Microsoft it pushing .net as the number one platform to develop windows apps on, so its is probably a good idea to have a basic understanding of what it is.

It abstracts the programmer away from the complexities of low level programming that C++ allows. This is its main advantage and disadvantage. It is nearly impossible to cause a buffer overrun or to have a memory leak in a .net app. On the down side the execution speed is reduced slightly and significantly significantly on the first run. This is due to the JIT compilation of the .net assemblies, whereby the first time a method is called it is converted form MSIL to x86(or whatever). If you call that method again it will be already in x86 machine code so will run nearly as fast as C or C++. Also there is the non-deterministic nature of the garbage collector. You can never tell when it will sweep unless you explicitly cause it to run. So it is defiantly not suitable for real time applications.

The other advantage is that .net assemblies can work together no mater what language they were written with. So you can use a class written in VB.net in a c# app. As long as your .net compiler outputs assemblies that are correct and conforms to the common language specification (CLS) you code will work seamlessly with any other .net language.

There is also the fact that the .net base class library is very rich. Even if functionality is not there it is very easy to call a native C function such as Beep. This is one area that Java lacks horribly. When java was originally designed they thought that by creating a rich set of standard libraries people would never want to call C code, and this is not the case. It is not very simple to use JNI(the system to call C code form Java) and is the source of some very subtle bugs.

Also there is the fact that C# was designed by Anders Hejlsberg, the same person that wrote Turbo Pascal and designed Delphi. c# is a very easy to learn language that is very expressive. I personally prefer C# over Java or VB.net for RAD programming.
Tim is offline   Reply With Quote
Old Jan 2nd, 2007, 3:33 PM   #5
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Tim View Post
It abstracts the programmer away from the complexities of low level programming that C++ allows. This is its main advantage and disadvantage. It is nearly impossible to cause a buffer overrun or to have a memory leak in a .net app.
Not quite true. You can define a block of code or a method as "unsafe", allowing you to use pointers and play around with memory in the VM, allowing the unwary to unintentionally make their applications vulnerable to the buffer overflows you see in C. However, I've never found a need to use the unsafe keyword, and I suspect most other programmers don't, either.

Quote:
Originally Posted by Tim View Post
Also there is the fact that C# was designed by Anders Hejlsberg, the same person that wrote Turbo Pascal and designed Delphi. c# is a very easy to learn language that is very expressive. I personally prefer C# over Java or VB.net for RAD programming.
It's not bad, especially if you're using the later versions where you get to play around with anonymous delegates (AKA higher level functions) and generic typing. Unfortunately, at work I'm still stuck with .NET 1.1, so C# seems a little less rosy to me.

That said, C# still has some legacy cruft it's dragged from C++, and its type system is rather primitive. All static languages lack some flexibility when one compares them to dynamically typed languages, but this can be mitigated with a sufficiently advanced type system, which C# rather lacks.
Arevos is offline   Reply With Quote
Old Jan 2nd, 2007, 3:48 PM   #6
milot
Programmer
 
milot's Avatar
 
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0 milot is on a distinguished road
I really agree with Tim, and the .NET is where the money is, I think that all of us are studying, learning to make money, and .NET is coming in the scene because .NET can be perfect in data driven application that can be used to create a very large business applications, and you can create them fast because it allows everyone to design their forms not _write_ forms, but of course its not as easy as it looks at the first sight because it has its own complexity, because you must write what will go on behind a button, form load etc. Also .NET allows C/C++ programmers to write unmanaged code in their methods, properties, classes etc. using unsafe keyword.
milot is offline   Reply With Quote
Old Jan 2nd, 2007, 3:58 PM   #7
Tim
Unverified User
 
Join Date: Dec 2006
Location: Bristol UK
Posts: 19
Rep Power: 0 Tim is on a distinguished road
Competly agree Arevos.

One thing that really gets me is that MS tie a .net release to a version of Visual Studio. This means if you want to develop .net 2.0 apps using Visual Studio you have to upgrade to 2005. I can see the business sense behind this but it does not help developers migrate to newer versions of .net.

One thing that saddends me is that there is this move away from programming native (as MS call it) code. If you teach someone java or some .net language they dont have to worry about the complexities of the platform. There is no need to teach about memory management or pointers(though in c# pointers are still present). This is all brought about though the use of a managed runtime. This is all great but the memory and cpu overhead it produces makes me want to cry.

In Delphi(win32 version) I can create a VCL app that when running uses about 5MB of ram, but when the same app is ported to .net it consumes over 25MB of memory and is noticably slower. There are some people that say that this memory overhead is the price we have to pay for RAD and secure programs, but Delphi can do RAD and it is possible to create secure programs easily using it, yet it is fading away.

I dont understand it, is it just because some people believe the average programmer is completly incompetant and cant be trusted with pointers and memory management? Or is it just the marketing departments of companys such as MS and Sun telling us to use these technologies?
Tim is offline   Reply With Quote
Old Jan 2nd, 2007, 5:05 PM   #8
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Tim View Post
One thing that really gets me is that MS tie a .net release to a version of Visual Studio. This means if you want to develop .net 2.0 apps using Visual Studio you have to upgrade to 2005. I can see the business sense behind this but it does not help developers migrate to newer versions of .net.
Yep, it's not really very helpful of Microsoft, and I suspect it's slowed down .NET 2.0 adoption by a significant amount.

Currently, I have to put up with this:
c# Syntax (Toggle Plain Text)
  1. string[] ParseFields(string line)
  2. {
  3. string[] fields = line.Split(delimiter);
  4.  
  5. foreach (string field in fields)
  6. fields = fields[i].Trim();
  7.  
  8. return fields;
  9. }

Whilst in 2.0 I could do this:
c# Syntax (Toggle Plain Text)
  1. string[] ParseFields(string line)
  2. {
  3. return line.Strip(delimiter).ConvertAll(delegate(string field) {
  4. return field.Trim();
  5. });
  6. }
And in 3.0, this:
c# Syntax (Toggle Plain Text)
  1. string[] ParseFields(string line)
  2. {
  3. return line.Strip(delimiter).ConvertAll(field => field.Trim());
  4. }

It's still got some way to go before it gets to the same level of expressiveness as Haskell, however:
parseFields = map trim $ split delimiter


Quote:
Originally Posted by Tim View Post
One thing that saddends me is that there is this move away from programming native (as MS call it) code. If you teach someone java or some .net language they dont have to worry about the complexities of the platform. There is no need to teach about memory management or pointers(though in c# pointers are still present). This is all brought about though the use of a managed runtime. This is all great but the memory and cpu overhead it produces makes me want to cry.

I dont understand it, is it just because some people believe the average programmer is completly incompetant and cant be trusted with pointers and memory management? Or is it just the marketing departments of companys such as MS and Sun telling us to use these technologies?
There are a number of reasons for doing this. It makes programs easier to port across architectures, and allows programs to be backward compatible without littering the operating system with legacy cruft. I suspect the latter reason is one of the main reasons why Microsoft are pursuing it; they spend a huge amount of money trying to ensure backward compatibility, and virtual machines make that a lot easier.

The other reason is ease of use. Computers are used to do all the tedious mental tasks that we don't want to do. We use spreadsheets to add up changing columns of numbers rather than add them up by hand, and databases instead of filing cabinets to keep track of large amounts of data. Higher level languages are merely an extension of this ideal. Why should I have to worry about memory management, pointers and primitives when I can let my computer deal with it? If you think about it, letting computers handle memory management and other low level concepts is little different to letting computers compile code into executables, rather than writing the machine code ourselves. Sure, a clever assembly hacker might be able to write assembly more efficiently than a compiler could, but a compiler saves time, and allows us to write larger and more complicated programs than we otherwise could.

Abstraction is a trade off between efficient use of the programmer's time, and efficient use of the computers time. Computers double in speed about every two years, whilst humans do not. Thus, it would seem to me as if computers would be the more logical choice to deal with any efficiencies, rather than human programmers.
Arevos is offline   Reply With Quote
Old Jan 2nd, 2007, 6:24 PM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
Abstraction is a trade off between efficient use of the programmer's time, and efficient use of the computers time. Computers double in speed about every two years, whilst humans do not. Thus, it would seem to me as if computers would be the more logical choice to deal with any efficiencies, rather than human programmers.
This is bottom-line, hit-the-nail-on-the-head territory. My current PC has 12,000 times as much memory as my first PC. It clocks 24,000 times as fast. I have 80,000 times as much mass storage. It cost 1/4 the bucks.

I can do more, faster, with much less effort. Sure, I despise ugly, crappy, inefficient code, when better is merely a matter of additional thought. I bitch about slugs at the keyboard, not at the machine or its languages. The trade-off is too valuable.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jan 2nd, 2007, 8:30 PM   #10
bulio
Hobbyist Programmer
 
bulio's Avatar
 
Join Date: Jul 2004
Location: Location
Posts: 140
Rep Power: 5 bulio is on a distinguished road
I like using C# and .NET 2.0.

This is because C# is the only programming language (besides PHP) that I can actually accomplish projects in. I have tried almost every language under the sun, and have had trouble developing decent applications.

In C#, I was able to complete a full GUI program that allows a user to fill out forms, and then writes the form data to a .txt file. The file was then sent to an e-mail address using System.Net.Mail.

Despite building the GUI parts in Visual Studio, I wrote the mail and file writing features. Just by looking at the code, I can see how it works quite easily.

It also helps that Visual Studio has excellent documentation, even while you are writing code (The auto complete feature allows me to browse what I'm looking for right away). I have yet to find an IDE like this in python.
bulio is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:18 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC