I’m installing the express editions right now. As much as I like the environment, I’m just not willing to fork over $200+ for the standard edition. If it works, Great!! Otherwise not so great, and I will cough up the money. That $600 rebate might have come in handy right now.
March 28th through 30th, I went to a 3-day training workshop to learn about Winforms progamming in C#. This training came on the heels of a 5-day trainig course in C# held the previous week. (see here, here and here for more about that). I did not enjoy this training as much as I had enjoyed the last one.
My main problem about this training was that, because there enough time between the C# language training, I had not had time to internalize everything about C#, the VC# development environment and .Net framework the way I had internalized C++, MFC, and the Win32 API. I know that if a programmer is proficient in one language, then they can easily pick up other programming languages easily. C#’s syntax was’nt really the problem here but our familiarity with the API of the .Net framework.
People often confuse that the productivity gains of using .Net come from C#. I dont believe thats the case. The real productivity gains come from the Framework classes that Microsoft has published for UI, XML, multithreading, and their tight integration with Visual Studio. Infact, I believe that C# would be a lot less powerful had Microsoft not published all those .Net framework classes that come with the SDK. <Rant>The truth is that the person who sent us to this training believe in silver bullets. Having never gotten his hands dirty with the actual working of the code, this person really does’nt understand that simply putting programmers through a grindhouse of training, does not give you productivity gains</Rant>.
All the students were expecting a classroom environment, where the instructor gave a lecture, and then the students did some excercises. But this was a workshop, where lectures were minimal and there was more hands-on programming. Hands-on programming meant the students really needed to be familiar with Visual Studio 2005, C# and .Net. Infact the course material stated that trainees need to have at least 1 year of experience of coding in C# and .Net. In our case it was like a week. Simply put, we were not ready for this training.
All I personally got from the training was a higher appreciation of Visual Studio 2005. However, I have to say this about the IDE. I think the IDE is much slower than Visual Studio 2003. Its not as responsive to commands as the previous versions were.
My week-long training in C# and .Net came to an end today. Today the main topic of discussion was Interop, some form controls that might be interesting, brief coverage of topics like the use of attributes and multithreaded.
While I’m going to give high marks to the instructor, in hindsight the course material should have been selected with some care. The impression that was prevalent in the group was that the course was actually designed for people who had been programming in VB6 and had not heard of the newer technologies. This is probably the reason why the instructor went into painstaking detail about the C#’s language constructs and ridiculous amounts of details on .Net features that seemed to be trivial.
Inspite of all that, I think I gained some information that was of value. One thing that I learnt was about data visualizers. That is something that can be really useful. One way data visualizers can be used is related to debugging intermediate steps for image processing.
Next week, its Winforms training March 28th through March 30th, 2007.
So I ‘m at the midpoint of the training. Day 2 was interesting where we learned about classes and objects, and there was some discussion of OO techniques. The one feature I really like about Visual Studio 2005 is the Object test bench. Now that is something I can really use at work.
Day 3 was about Collections, generics, Winforms, and ADO.Net. Of these the only thing that I fould interesting was generics. I actually went through the entire excercise and lab. I really like the way generics have been integrated with C# and the way the IDE is aware of them. In contrast, the Visual C++ compiler gives some of the most cryptic error messages when it comes to templates. But then templates are far more powerful than generics. I think by limiting generics for their role in collections and not expanding them to meta-programming like in C++, their use will become easier.
If I had been the one organizing this training, I would’nt have gone around doing it the way it has been done. I would have provided everyone of the developers the new Visual Studio environment, and given each of them a good C# book. I would have told them that they had exactly two weeks to learn the basics of the language. The real traing would have covered topics along the lines of
- Framework design
- UI Components/Controls design and implementation
- Use of C++/CLI to write mix-mode applications and components. This is important because most of our code is in C++/MFC circa 1998.
I think it was pretty condescending of the organizer of the training to think that we needed help in learning how to write classes and objects, when we could have learnt about it on our own.
Here is what I learn’t today. I’m a very mediocre programmer in C# because I dont know it very well. However, with the information I have so far, I have a feeling that most of the strength of C# comes from its extremely tight and very well-done integration with Visual Studio 2005. My question is this. How much of a role does an IDE play in a language’s popularity? I always suspected that it had a big role. Take me for an example, one of the primary reason why I’m still using windows is that I find Visual Studio so much easy to use compared to emacs, and I never really bothered to learn vi. And Visual Studio is a big reason why I’ve never moved to Linux as my primary desktop. Plus all my jobs have been in Windows-centric development shops.
Today’s lecture was mostly getting started with C# and familiarizing ourselves with the development environment and with the basic constructs of the language itself. They are mostly similar with C++ so did not have to pay too much attention. The instructor is funny and keeps a lively atmosphere in the classroom.
Kryzstof Cwalina has written up some rules or “Laws” for API design, which I’m going to use in a presentation at some time in my company. I thought I should link them here in just in case I need to have to refer to it at that time. They are fairly good rules that I think should be used more often.
“usability” in this context means “how easy to use the library is”.
- The usability of a namespace is inversely proportional to the number of public types in the namespace.
- The usability of a type is inversely proportional to the number of public members of that type.
- The usability of a member is inversely proportional to the number of parameters this member has.
- The usability of a framework is inversely proportional to the sum of the number of explicit constructor invocations required and the number of types whose static methods need to be invoked to implement common scenarios.
- The likelihood of an abstraction being designed correctly is inversely proportional to the number of abstract members on that abstraction.
- The likelihood of an abstraction being designed correctly is proportional to the sum of the number of members taking it as a parameter and the number of types implementing it.
- The likelihood of a virtual member being designed correctly is inversely proportional to the size of the member’s body.
- The likelihood of a virtual member being designed correctly is proportional the sum of members calling it and the number of members overriding it.
Some of the comments were very interesting.
One commentator wrote:
If I understood correctly, applying laws 1, 2 and 3, the best class library in the world has:
with one type
that has one member
with one parameter.
Or a member without parameters
or no members
or just an empty class library.
Sorry, I couldn’t resist 🙂
He had a point, which is why the original author decided to add the update, clarifying that the meaning of usability here means the “ease of use of a library”. Overall goodnes of a library is some combination of usability and functonality.
why the collections library of the .Net platform is theway it is.
Reading up on multi-files assemblies, I found these rules of thumb for integrating C++ and C# libraries, which are reproduced here
How do I mix C# and C++ code in a single assembly?
If your C++ code is not compiled with /clr:safe (i.e. it is compiled with /clr or /clr:pure), do the following:
1) compile your C++ code into .obj files
2) compile your C# code into a .netmodule, using /AddModule to reference the C++ .obj files
3) link the C# netmodule directly with the C++ object files using the C++ linker to create a mixed language assembly
If your C++ code is compiled with /clr:safe, build your C++ code as a .netmodule. You can use it just like you would use a .netmodule from any other language.
Brought to you from here.