A small complaint from nobody

I have long been a Visual Basic coder. I read C++ quite well but really struggle to write it. Primarily because nearly every "example" I try to compile, will not. This makes it nearly impossible to understand how things are put together. Most of the time I can't figure out if I am formating my code the wrong way or just don't have one of the many compiler or references set correctly.

So if anyone at Microsoft is paying attention, or cares. Would you please figure out how to make an entry level IDE for VC++, that has examples that compile right out of the box. I don't understand why this has to be so complicated. As near as I can tell, C++ is a very simple language and should be fairly straight forward to use. I have written programs in many different languages, but have never been able to really figure out Microsoft Visual C++. It seems like the people designing the IDE believe I am in their head and can figure out their intent with little effort. I don't think I am asking for too much, I just want to install the design tool and compile and walk through a few examples so I can start to understand what is going on and what the many interfaces are for. I may be a little impatient at times, but the only examples that have ever worked for me are ones that I type in from a book. This is a very slow way to learn. What good is an example if it doesn't work

As a side note, I am very impressed with VB 2005, it took a little time to figure out, nice job. Maybe someone that works on the VB IDE could lend a hand on VC

Just blowing off a little steam!



Answer this question

A small complaint from nobody

  • Bizsoft

    Thanks for your feedback!

    May be the differences are due to the fact that C++ is a more complex language in general. I don't believe the intention of using Visial Studio express edition is to make you learn the language but rather have an easy way to excercise what you can learn from starting books or tutorials.

    Nevertheless, I believe we are starting lots of effort directed onto the academic side and how to tailor the product to help understanding the language. You feedback will for sure be considered. I will personaly make sure to propagate it to the owners of the effort.

    Once more, thanks for the great feedback!

    Thanks,
    Ayman Shoukry
    Program Manager
    VC++ Team


  • KishoreK

    Thanks for the detailed feedback troy. With specifics for the example you were using, it it uses windows.h then you still need to install the PSDK since windows.h is part of it. The reason the express edition of visual studio 2005 doesn't have lots of limitations is the fact that it was designed for learners and hobiests.

    As for the 6 points you mention above, it shouldn't be different from previous versions of VC++ or even any C++ compiler. If you are trying to learn the C++ language itself then the books suggested at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=107484&SiteID=1 are a good start.

    For drawing objects and controls, you can either use MFCs, Winforms, or just direct Win APIs.  The Express Edition contains developing winform applications using VC++. New Project --> CLR --> Windows Form Application. You can drag and drop control and see the code generated for that.

    Thanks,
    Ayman Shoukry
    VC++ Team


  • Bearcats1375

    Not sure where to start. What I would really like to relate is my experience, as in what I tried to do versus what I expected.

    I should start with a little background so you have a frame of reference as to what type of user I am. I have never held any title that would lead you to believe I write software. But I have written software for about 24 years. So I have been at it a while. Currently I hold the title of Manager. My team is responsible for supporting proprietary electronic controllers for the company that manufacturers them. Currently I write and maintain “tools” that are used by designers creating application software for our controllers. The largest of these projects is a simulator. This is a VB6 program that creates a virtual controller on the customers PC. The simulator is used to test their application logic. While this tool is not for sell, it is provided to our customers for the purpose of making our product easier to design for and is in use in many countries around the world.

    Our controller has been enhanced a great deal recently and it is very apparent to me that I need to enhance this tool to keep up. Because I do not code full time, the original tool was a bit sloppy so I decided I would have to completely re-write the program. I also decided it is time for me to upgrade my design tool. I have spent at least the last year deciding what to do.

    Now for my C++ trouble. I downloaded and installed C++ Express. The first suggestion I ran into was to download the Platform Development kit. Which I did. I don’t know for sure that the kit was responsible, but the Express Help system didn’t function properly after installing it. Basically the local help was not available, making using C++ Express very difficult to use. After many hours trying to figure out why the help system was broken, I backed up my data and did a complete wipe of my PC.

    It then occurred to me that perhaps I should not install the Platform kit until I had a little better idea what I was doing. This is a very large download and puts more info and tools on my PC than I would ever need. So I went back to the C++ Express web site and followed the links under Fun. Sounded like fun to me, I downloaded the 2 game programs shown there. Neither would compile, I think I need the Platform kit for these. So I figured what the heck, this is probably way more than I really want to mess with, just sounded like fun. So, down to business. I opened the C++ Express IDE and followed the examples link, looked for what I thought would lead me to very basic examples, as it was under the heading General. It finally led me to http://msdn2.microsoft.com/en-us/library/ms236269.aspx I downloaded the calculator example. Would not compile, a little poking around and I found that it was not set to compile Win32, changed that and it still would not compile. Something about <windows.h> that it didn’t like, as I recall. So then I tried the Birthday picker. It wouldn’t compile either. Don’t remember why. At that point I became very frustrated and hence my post.

    Here is what I expected:

    1) String manipulation appears to be a bit of a trick in C++, or so many docs seem to indicate. A simple example that takes a string and re-organizes it different ways would be useful.

    2) GUI, a quick example showing how to change the appearance of a window. For example how do I change the window caption in code, how do I change button or label text or size. How do I load new labels or buttons in code. How do I iterate through a group of controls and change or read properties from them. How do I group the controls. How do I determine what windows are currently displayed.

    3) User objects. How do I define, create and destroy user objects. Generally I need to create a bunch of similar objects in a logical group, so that would be of most interest to me.

    4) File access, just a quick example of reading and writing a text file. Don’t want to read the whole thing in a chunk, I need to examine each character as it is read.

    5) Quick example of drawing graphics on the screen. Nothing too fancy, just a few lines and maybe a circle and a square.

    6) Printing, I put this one last as it is always a challenge when you are not trying to do the same thing many others do. An example that demonstrates drawing a few lines and printing some text would be great.

    Thanks

    Troy


  • bostik11

    I agree with you that using C++ might not be productive as other languages C# & VB but have you tried C++/CLI. Have you tried creating winforms application usin VC++ You can just drag and drop controls.I would for sure be interested in hearing your opinion since such feedback help us shape future versions of the product.

    Productivity is something the VC++ team has always been thinking about and we are still progressing on it. I 100% don't believe that the availability of examples would ease the issue (I would help but not the ultimate solution). The examples you are searching for are very specific to what you want to do and others will have different opinions on what kind of examples to have. What you regard as basic examples, others might not find it basic and vice versa. My personal opinion is it the nature of the C++ language. I mean when you write something in C# or C++/CLI, it is easier to write code and be more productive because the compiler and the runtime (.Net framework SDK libs & classes) does some of the code on your behalf. In C++ native, the wizard creates some of the code for you (if you use the wizard) but most of the coding is left to the progammer.

    As for the IDE, you are correct, we have done tons of improvments to help developers understand the source code basis (e.g. parsing complex structures, ...etc). For sure, a good IDE helps promoting the language as a whole.

    Just my 2 cents...

    P.S
    Don't forget trying winforms applications using C++/CLI when you get a chance.
    Thanks,
    Ayman Shoukry
    VC++ Team


  • Rob Leenheer

    C++ by its very nature as a more mathematical language than Basic (which is overall more natural language oriented) will be harder to learn for many people.

    The entire concept of pointers and references also may baffle students of the language who don't have a concept of the actual memory structures represented by the data they're manipulating (a field of study sorely lacking in many curiculums these days, especially compared to 10-15 years ago when people learned to program in assembly on DOS).

    Maybe a tutorial should include that (explain the relation between a reference, a pointer, and an object in more than glancing detail) better than is now often the case.

    Yet indeed C++ shouldn't be too hard to learn for a determined student with some time and resources to invest in the study.
    The main problems I notice among questioners in these (and other) forums when it comes to VC2005 Express are almost all at the core configuration problems (usually due to lack of the PSDK) rather than core language problems.
    Whether these are caused by not being educated in the structure of the language (expecting that the IDE IS the language, as is the case with VB, for example, a problem I also see a lot in Java forums) or misunderstanding the role of the PSDK in Windows development I can't tell, but I do find it strange that people don't install the PSDK despite it being explained on the download site for VC Express that such is required to create Win32 native applications (maybe changing that in "for anything but .NET applications the Platform SDK should be installed" would help there).


  • emkatu

    Can't believe I am writing another post. I just couldn't help myself, something was really bothering me about this conversation but I couldn't figure out what it was. I had to read back through everything then it hit me. The assertion is made that the IDE shouldn't be expected to teach me how to write C++. I actually agree with this, which means that I haven't made clear what my problem is. So let me talk about VB, something I know much better and see if I can make this clear. VB doesn't, near as I can tell, teach anyone how to write VB code. It does however, by using example code that I can complie, explain how to write a Windows based program using VB. C++ does not do this. In fact the many "real" programmers employeed at my company, by "real" I mean C++ coders, do not write software for Windows with C++. Company programs that are written for Windows use some other tool, primarily Java or VB with few exceptions. I have been told by our "real" programers that is is because Windows isn't stable enough for what they are doing. Generally they are writing for a Motorola processor or some variation of Linux. I do not believe this is true, it just what they want to believe. I believe the reason is, that our company would not spend the kind of money it would require to write a mission critical program for Windows with C++. It's just about the "turn time". When you are trying to make money, you need useful code as quickly as you can get it, and nobody is impressed by how smart you are if your program doesn't function properly or isn't finished on time.

    You now have .NET. If I use VB I am essenstially writing for a virtual machine that is the .NET platform, as I understand it. So if I want to write a program using C++ for .NET, why would it be all that different from doing it with VB Answer, unable to access documentation that filters out non .NET documents and that includes appropriate examples, that compile. Lack of a "one click" to configure the IDE for .NET (at least I don't see it).

    One more thing for you. I work for our Sales and Marketing department so I couldn't help but notice this one when I reviewed the posts. If you properly develop and promote the VC++ IDE, it is the language. If you do not, then it is just another option of many. Kind of the Kleenex vs facial tissue argument. So if people believe the IDE is C++, you must be doing something right. :-)


  • rahil

    Hi there,

    The VC IDE team is on these forums and they do actually listen. It would be great if you post one of the samples you were using and I will be more than happy to forward to the reponsible folks. I am really interested in specifics of what you are finding difficult about using the VC++ IDE. This will for sure help us tailor the product better for next releases.

    Please feel free to rely here or send me an email: aymans at microsoft dot com. Thanks in advance for your detailed feedback.

    Thanks,
    Ayman Shoukry
    Program Manager
    VC++ Team


  • xyz8994

    Troy, the attitude that Windows isn't "stable enough" (or whatever "enough") to write "real software" for it is an age-old idea many Unix programmers have.

    It's perpetuated these days by the slashdot crowd and their constant flaming of everything Microsoft as the core of all evil and Windows being nothing more than a mess of security leaks held together by code stolen from Unix.

    Sure VB makes you more productive (when writing graphical user interfaces for common business applications) in the short run but that comes at the cost of extremely tight coupling between data, business logic, and presentation.
    That makes the application hard to expand and maintain, causing far higher lifetime cost in exchange for lower initial investment.

    C++ (and Java) promote a more loosely coupled approach, making the total lifetime maintenance of the application cheaper in return for a higher initial investment (if you have a careful design of course, but at least that's possible and encouraged when using C++ in contrast to VB).

    As to code generators and wizards, I usually avoid them like the plague. They hamper the learning of the language by hiding implementation details leaving the beginner stumped about what's happening inside their applications.
    And when you gain experience you often find that their applicability to realworld problems is limited, causing you to have to write more code to get around those limitations than you would have written had you not used the wizard in the first place.


  • image002

    I think your comments about the limitations of VB are somewhat dated. I would agree that VB is more restricting than C++, but many improvements have been made in the language. It is still more limited than C++, but not to the point, in my opinion, that it can not be maintained or expaned in the future if the orginal design is properly put together. The major sacrifice in VB is control over the machine you are writing for. Which general means a performance hit that can be avoided in C++. Problem is that PCs are so fast today the performance hit doesn't really mean much, unless you are doing some really high end stuff, in which case you would not consider anything but C++ from the start. The largest of my programs, the simulator mentioned in a earlier post. Is quite large. I created the program because the estimate to create it with C++ was over $1mil and 1 year turn time. With VB, in my spare time which isn't much, I created a useable simulator in less than 6 months. I didn't do this to prove any point, I desperately needed the tool to do my job properly. Could be that I am just much faster than they are because I love to write code and I am not concerned about the time on the clock once I get started. I know they where shocked that I managed to create it, especially with VB.

    So the company tells our coders no, to most windows based C++ programs because of cost and turn time. And our coders tell themselves they didn't want to write for Windows anyway.

    Troy


  • Padraic24

    Good points. I personally don't find the structure of the language difficult, in many ways it makes more sense. But I really don't have any idea why I would choose a .NET only application or the PSDK. My decision to use one over the other would have more to do with how quickly I can get to a useable program than anything else. I do have and have read the C++ documentation from MS Press. Looking at my book shelf I believe that is 5 volumes of some very dry reading. I also have at least 5 other books that claim to teach C++ quickly and easily and multiple interactive CDs on the subject. When I tried to use C++ 6 for small engineering type applications, I found that I spent most of my time jumping from book to book trying to find the library or example I remembered reading at some point. 20 minutes of reading and 1 minute of coding is not a very practical way to create even a small program. Granted it would get easier if I stuck with it. The only thing that really holds me back at this point is examples. If I forget how to do something in VB, seems like I can always find a example, it always seems to compile just fine if I want to experiment to better understand something. So I can quickly get back up to speed on something I forgot or learn something new. With C++, forget it, if I forget something or need to learn something new, it's back to the books, something I just don't have time for. Just don't understand why providing examples that compile for C++ is a show stopper.

    Kind of funny in a way. I gave a list of some very very basic examples I would like to see and from the list the assumption appears to be that I don't have any idea how to write a C++ program. Maybe you are correct, but I appear to have a couple of executables that someone with my machine created using C++, where is the masked man. Just because I ask for very basic information, doesn't mean I don't already know it, it means I want reminders in the form of code that works, not lengthy explanations, just some code that compiles would be great.

    Troy


  • Narula

    Let's see if I can address your questions by playing a little stupid to drive home a point. How would I know that CLI is for .NET Doesn't look to me like they have anything to do with each other. C# doesn't look like C++ to me (to be honest I have never investigated C#), why would I want to spend time learning C# and what does it have to do with C++ What advantage if any would C# offer over VB

    Maybe "examples" does over simplify the issue. I think that many believe C++ is, as a language, harder than others and this maybe true. However it doesn't mean that a smartly designed IDE couldn't make it much easier than it is. Perhaps I don't understand the planning processes used when beginning the design of the average C++ program. But I would think the Designer would deliberately target a specific enviroment. Seems like you would either write a program for the PSDK or for .NET and not a hybrid, if it could be avoided. Although I am busy re-writing my simulator with VB, I did go back to C++ and tried this. File>New>Project>CLR>Windows Form Application. I didn't modify or change any thing, just hit compile. To my surprise, it compiled. So maybe there is hope for me yet. :-) I will look into this further as soon as I get a little time. Is it safe to assume that a project that is started in this fashion will use the .NET framework, unless I specifically try to do something else Wouldn't this make more sense... File>New>Project>.NET>Windows Form Application and maybe File>New>Project>PSDK>Windows Form Application


  • dsffdda

    Replying briefly so that to avoid taking from your time and mine for a longer thread

    1) Yes, winforms in C++/CLI is only managed and hence will need the .Net Framework (exactly like VB .Net) but you can do advanced programming by mixing it with native code. (look for "interoperation" in msdn)

    2) The kind of projects you are suggesting are there, win32 applications, MFC, and so on but using higher editions of Visual Studio and not the Express one.

    Nevertheless, we really value your feedback so please feel free to log such suggestions at http://lab.msdn.microsoft.com/productfeedback/default.aspx

    Thanks,
    Ayman Shoukry
    VC++ Team


  • Sree C

    I am glad you are actually reading these posts. I really only have one comment left, you can delete this entire post after you read this if you like.

    To learn how to productively use Visual Basic, all I had to "bring to the table" was a reasonable understanding of Basic itself. The examples that where provided, where enough for me to figure it out from there. I was concerned that .NET would leave me in the dust because everything changed, but again all I needed was a basic understanding of the language and the rest is fairly easy.

    I have never been able to do much of anything with C++, tried and gave up many times of the years. Some would say that is because the language requires someone that has more time than I do. I just don't believe the language requires that. You have what is supposed to be an entry level product, C++ Express. I think it is great that it is possible to do some very high end things with this package. What I don't understand is this. Since this is an entry level product, shouldn't a new user with little or no knowledge of programing be able to write useful if limited applications with in a few hours of using the tool I mean, if I have to learn the PSDK to compile a calculator example, how on earth can you call this an entry level product This has always been my problem with C++. Many of the programs I write would work better if I used C++, or so I am told, but I can't see the forest for the trees. You throw so much information at me, most of which I could care less about, I simply can't digest it. If the intent is to ensure only hard core coders use C++, your doing a great job. Reading C++ is easy, because I don't have to figure out what a library is used for or how to use it, the code tells me. Maybe I shouldn't even consider using C++ and should just stick with VB. It works for most of what I need.

    The really really odd thing is that Microsoft usually gets one thing right. People who chose their products don't generally need a PHD to use them. They pretty much teach you as you use them. Could be that I just expect too much from C++. Maybe you have already spoiled me too much. :-) I know it cost Microsoft money to maintain all these different languages, seems like you would be trying to push everyone from the novice to the expert to one tool, just to make things easier for you if for no other reason. You could easily push me to C++. But you have to want a person that isn't a pro, that is self taught and needs a tool that is intuitive (this you pretty much have), With examples that are organized from easy to extremely hard. Easy should mean I don't need to know anything except how to download the file, open the solution, and click compile. Extremely hard woud be the afore mentioned PHD level.

    Thanks for your time.

    Troy


  • A small complaint from nobody