[ARCHIVED THREAD] - Visual C++ vs Visual C# (Page 1 of 2)
Posted: 10/28/2005 7:56:16 PM EDT
| Ok, I've traditionally programmed C/C++, using Visual C++ as my IDE. Now that Visual C# is out there and seems popular, what say you programmer types on migrating over? I'm just a hobby programmer, I like to screw around with Windows and make random stuff. |
|
Think of visual c# as another layer up from the hardware. Things are easier to do for beginners and harder to do for advanced stuff. It is microsoft's plan to make everything seem easier to work with and it is, as long as you want to do what they think you will want to do. Personally, if your a hobby type it might be fun cause it will be easier to write simple apps. 2.0 is comming out very soon also, so maybe you could jump on that boat. |
|
If you already can write C code to create effective windows apps, then you may or may not be impressed with C#. I agree that Java is the next big thing. C# is MS's attempt to usurp the role that Java plays, namely platform independance. C# is a bastard blend of Java and C. Personally, I like it. I love C, and I don't hate VB but it's too 'chatty' of a language for me. I prefer: int i = 0; Over: Dim i as Integer i = 0 My VB might not be right, but you get the idea. The thing I DO love about VB is the ability to quickly create a windows interface without having to deal with the code aspect. C# is perfect for me. It combines the windows forms design of VB with the ability to apply alot of my C++ skills while learning some Java concepts. I like C#, but what I should really be doing is teaching myself Java. Shrug. Oh, and right now you can get Visual Studio 2005 Beta from MS for free...a 365 day trial. It's pretty slick, I'll definately be buying myself a copy when they finalize it. |
|
I spent the last four years as a J2EE programmer but recently started using C# and so far, I like it. At first I didn't like it as much as Java but it's growing on me. We are currently using ASP.NET 2.0 for our client side stuff, C# for our middle layers; business components, Data Objects, Data Access Layer, utility components, stuff like that. If you have any specific questions fire away but so far, so good on this end. |
I love VB for the same reasons, and don't mind the excessive wordiness of it either ![]() |
The place I work at now has some very powerful software that has a big VB component. I think all the various high-level math functions are written in C and wrapped as a DLL file(s). That's how I'd do it. I'll admit that I was very suprised that any of the software was done in VB. Have you ever done I/O stuff in VB? Or web-based stuff? |
I've done I/O. Nothing web-based. Learned the basics, did databases mostly. I wish it wasn't such a pain to do OOP in VB though |
I was programming in C long before the PCjr, and we're still talking about programming in a variant of C. I run some of those programs every day that are older than the PCjr. He hasn't missed much.z |
Got it. Database stuff is ridiculously easy to do in VB. I had to do a VB app that did read/write/sort of a Access DB for a school project. I haven't had the same luck with C#. Actually, I've been trying to figure a way to do DSN-less transactions with C# to no avail. I ended up just using my own file I/O routines to read/write plain text files. Simple but effective. It's reliant on the code to keep things in order, but it's a real simple application and it works for what I want. Anyway...yeah, I still like the way classes are built in C. C# isn't too bad, but the whole type-safe scene it has going on can be a pain. I think it took me a good 12h to figure out how to instantiate a class in C#...once I did, tho, it was pretty smooth sailing. But you VB guys...I think you just like hearing yourself type |
|
Not to get off subject or anything, but I have a question. I am in the military, AF computer programmer. At my shop I basically have the opportunity to get involved with VB 6.0, VB.net, Java and HTML, C++, lots of database projects, and some really really archaic assembly shit. So far I have only done VB 6.0 database projects, and that's where most of my formal classroom instruction has been. We get to take non-military classes and shit too during work hours if we are not coming up on a big release, depending on what type of projects we will be working on. Plus we get the tuition assistance anyway for classes outside of work which I will start taking advantage of soon. Well my question is what area do you think I should focus on to get the experience that I need in order to get out and get a decent paying job in four years (I'm in for six)? I've got some say in what i work on based on what teams for what projects I ask to be put on. (We get moved around periodically so that we get as much experience as possible.) sorry if I hijacked... |
VB.net is different enough to give you some transitional difficulties. I started learning VB.net first, then had to back-track to VB6. There are things that are real easy to do in VB6 that are difficult to do in VB.net, and vice versa. Mostly to do with the Common Runtime Language of the .NET framework and the security structure that MS is introducing with it. Quick example: Listbox1.Add(Value) <--this or similar with VB6 Listbox1.Items.Add(Value) <--this or similar with VB.net Some I/O functions are going to make you jump through hoops for security too. Also if you're going to school to learn something to make you cash, here's some advice: Look at current job postings. On careerbuilder or similar. You'll see alot of .NET stuff, and also alot of demand for people that know VB AND C++. I think this is the void that MS is trying to fill with C#. You can't go wrong learning Java. Alot of hardware drivers are being built on Java, and some Universities (including the one I'm starting in) think Java is going to be where it's at so much that they don't teach anything else. Also, programming is strongly conceptual. The only thing that really changes is some syntax and usage. For example, C# is type safe, which means you can't just convert a char value into an int value implicitly like you can in C. You need to write a function that explicitly defines how to convert one data type into another (or use one of the built in functions to do it). It also means that every variable must be initialized with a value. I would recommend learning C/C++. If you can learn, understand, digest, and use C++, you can teach yourself any other language on the market. C++ is the only ANSI standardized language that I know of, which means you can download good free compiliers (I recommend Bloodshed DevC++), and libraries and anything else. All the current languages were built using C, so it can get gritty and archaic, but like I said...if you can learn everything going on in C you can learn any other language no problem. C is hardcore coding, and OOP types say it is the world's prettiest assembly language. C will teach you programming logic using tough love. There's no friendly debugger like in VB, you need to WRITE the code to help you debug your C code. If your programming logic is broke, you'll know when you program locks into an infinite loop, doesn't loop, or throws crummy values at 100Hz. If your math or flow logic is off, there isn't a way to step through each step of the program to find where its going wrong (unless you write the code to do that!). C tough love makes good coders. Learn C. |
You may think it is archaic, but it is the most powerful "language" available to you. It allows you to get deep into the nitty gritty of the computer to make it do whatever you want. Knowing assembly means you know the computer, and knowing the computer means you will be a better programmer. What's unfortunately (or fortunate in some cases) is that a lot of the higher level stuff today protects you and buffers you from the system and the hardware. I remember writing code for the Soundblaster and knowing everything about the damn board. Now, you don't really need to, with DirectX and such. |
I started with QBASIC. Then I learned C. C has to be the most powerful low-level language out there, next to straight-up assembly. Like you said, it will force you to become a good programmer. BASIC, either in the old school form or the VB form, can create lazy programmers. C forces you to make tight code if you want it to work right and work fast. I learned Windows programming using straight C and Win32 API. Talk about knowing how the Windows system works. |
I can, I used to be pretty proficient with the Win32 API. Unfortunatley Microsoft is making that go away. From what I've seen of C# though, it seems to make Windows writing much easier and faster. LOTS of overhead and admin stuff with C Win32. |
If I'm doing "databaseless" storage in an app, I tend to use XML files for it. |
I can read and write C, but I never got very far into the Win32API--I guess I lacked the discipline to sit down and really learn it. I always figured I'd use C to create some DLLs that would hook into a VB app. That was until I found C#. My bag is the RAD concept. I like making lightweight, useful hobby apps. Many times I'll take a lot of lightweight apps I've created and tie them into a final, larger app down the road. I even did that alot with C, going as far as to create my own DOS-text menu class to facilitate navigatinging through the mini-apps I made. Pretty fun stuff! |
Charles Petzold's book Programming Windows 95 is how I learned Win32 API. It is the BIBLE. It's a great book. I wonder if there is a updated version for WinXP and the new technologies. Anyone know? |
| What's this Java is the next big thing crap? Java has been around for a while and was the "next big thing". C# is powerful. It takes the best of C++ and Java. Right now Java is attempting to catch up. Web development is far more advanced in C# and the ASP.NET framework. C# was built with XML in mind which is another plus. .NET 2.0 is supposed to be three times as fast as the current version. Knowing C# is a highly marketable skill... |
|
I never understood pissing matches between software languages. IMO, once you learn *how to program* using an object oriented language like C++, Java, etc., learning how to write in another language is not that hard. The hardest part is learning how to read the API documentation, but once you understand that, it's just a matter of referencing things as you write it. The only exception to that is VB. VB is so weakly-typed and so downright "easy" that it provides training wheels of sorts that can prevent a beginner programmer from learning anything of substance. Programmers tend to come in two flavors - those that "get it" and those that don't. Unfortunately, most programmers in the workforce and enjoying gainful employment today *don't* "get it". That's a large part of why EVERYONE (generally speaking from a business standpoint) sucks at software development. It's an incredibly inefficient process that results in buggy code at best and shit that just plain doesn't work at worst. It's like software programming amateur hour out there, all the time. It's ridiculous. That's why I don't work in software development. |
Remember when you didn't have to patch your software? |
No, actually. If there was such a time, it was before I got into IT. I'm a little upset today, because I was trying to get a predictive dialer up and running for a client today (yes, I know pure evil, but what can I do.) This piece of shit software company that wrote it actually has the fucking stones to put in their manual to ignore *specific* errors. In other words, they know it's a problem, but they don't know how to fix it, or don't care enough. Just ignore it, the rest of the software works. Oh, and BTW, your total for licensing our shit that we can't make work and won't fix comes to ONE BEEELEON DOLLARS. My rule - if it's something you have to put in your manual "oh that's nothing, don't worry about it" then you should take the time and fix it. I mean, seriously, what the hell? ETA: My favorite was the menu option that the manual describes as "Feature currently beta testing. DO NOT USE." Uhh, then why is it in my software that I paid out the ass for? Was the "GUI Specialist" not in that day that you couldn't remove it from the fucking menu in time before this release? |
|
Java is overhyped IMO. It has its purposes and is good at some things, but this whole 'java is the next best thing everywhere for every purpose' stuff has to stop. No programming language is perfect, and certainly not Java. There are plenty of places where Java just makes no sense IMO, no matter how much Sun wants to hype it to be the be all end all of programming languages. In most cases Java is a needless added layer of abstraction that is completely unneccesary and not exactly beneficial when compared to the speed and optimization benefits of a fully compiled language. Java is in a niche between the high performance compiled languages like C++ and the completely portable scripting languages. IMO it can not take over either of the ends of that spectrum effectively and never will. Java is only popular because it is great for lazy programmers that don't want to have to learn multiple languages, that don't want to have to optimize for different platforms, test on different platforms etc. It's the ultimate for lazy programmers cause they can write once, test once. Who cares if it's slower? Not the lazy programmer. Anyway, learn how to program, and the language is merely a formality. If you know how to program, learning new languages is cake, especially if you have a good IDE. It takes time and experience to get used to the ins and outs of each programming language, but it's not all that hard. |
| I am taking a class and using java swing to do gui work and I want to tear my fucking eyes out. I refuse to use eclipse because it sucks so for concurrent, operating systems, networking and gui I have been programming java in notepad and compiling at the command line. I would take C# and .Net any day of the week. I fucking hate java. The api is shit and their ides all fucking blow. Microsoft did something right with .Net, but like all languages its good for certain stuff and bad at other things. Its a good tool to have in your belt, but its not going to do everything. I hate it that people have such a hard on for java. |
|
I kind of like Eclipse. I think as a framework, .NET provides more helpful tools than Visual C++ + MFC + <put your favorite ActiveX control set here>. It is true that C# is the bastard child of Java, but it appears to be a good language. If you're a hobbyist, then use whatever you like. No one is forcing you to jump on the .NET bandwagon. As far as careers, I cannot speak for the entire US, but in the SF Bay Area where I live, Java and J2EE have taken over the corporate IT market. Companies that once relied on mainframes, minis, AS/400s, etc., are quickly moving to Linux + J2EE. They seem to think it's a good deal because Linux and Apache are open source, J2EE is free, and there are several J2EE application servers (such as Tomcat) that are also free. So, they think they save a lot of money there. Of course, J2EE is a sort of beast, and there is a learning curve for all this BS. I won't even go into CM and builds, but let's just say it can be a nightmare in J2EE land. Other than ASP.NET for web sites, .NET does not seem to have the edge over J2EE here. But it's regional thing -- from what I understand other regions of the US are all over .NET. I think I will eventually adopt C# and .NET for most of my work, both front and back end. The biggest obstacle to .NET at this time is redistribution of the .NET runtime. It is very large, and if you distribute applications via web download, it can hurt your business. For instance, you tend to lose dial-up users once they see they need to download 30 megs. just to run your little app. This will become less of a problem as MS includes the .NET runtime with new releases of Windows. But for now, it’s a real problem. |
They both exist - what is your problem? If you want notepad (or even vi), it's available. K&R C can be had for free in many places. |
It actually goes back about 5 years or so. I had not programmed in a few years, and had some apps that I figured would be easier to write than try to customize something off the shelf. I went out and bought C++ figuring I could just whip out a few quick programs. It said it was ANSI compatible, but that was a damn lie! Nothing I wrote would compile, and the IDE kept trying to insert a bunch of crap into my code. So, I dug up some of my old code that I know works perfectly. It was 100% ANSI standard and K & R compliant. Guess what.... It would not compile either. I know there are some freeware compilers and such, but at the time I did not want to take the time figuring out what I need and then learning them. The box said it would do standard C, but I spent more time trying to bypass the stinking IDE and compiler than writing code. They spent so much time making it "easy to use" that it didn't work worth a darn. The whole ++ and # thing is there to force people to use good technics. I write good clean code, and don't need some freaking code nanny getting in the way. |
Amen.
Preach it, brother! Learn the OO methodology, and you can write in any language (even those that are not native-OO). |
Configuration management and builds can be a PITA when you must rely on a lot of open source code as part of your system. This is common in Linux/J2EE land. It's not so much of an issue when you use a unified environment such as .NET, because almost everything you need is included in the framework. |
My bigger issue is working with Gigantic Ego filled assholes who think they are the only ones who know how to program, and that everyone else "sucks" at software development. As a real time s/w guy and sometimes lead engineer, I've learned to keep loose reigns on other people's styles, as long as it works and is understandable by other engineers. This has worked for me for almost 20 years, with maintainable software that's stayed reasonably in budget. |
I don't agree with this. Any more, software apps are so huge and complex that finding each and every bug before the app is published is a herculean task. It can be done, sure, but it really holds up development, and there is still a chance that an errant bug will be discovered down the line. I think MS pushes out software way too quick before alot of major kinks are worked out and they take well deserved heat for it. MS has gotten better but being an 'early adopter' of any MS tech seems to be a bad move--the concensus I've heard from IT guys that run MS software is to adopt 6mos to a year after the early adopters have lost money waiting for patches for unhandled exceptions or security or other bugs/flaws. That being said, I go back to my original statement that programs become so huge and complex that there could be a hidden vulnurablitiy in class 92, function 10, line 202 that could take years to surface. Even some of my relatively 'simple' hobby apps have 10-20 class objects with anywhere from 1 to 10+ members of a class. |
Tinfoil hat = true; In school, I didn't have room on my old notebook PC for the bloated VC6 install, so I found a good free compilier so I could do my class work and projects on my notebook PC (instead of relying on school lab PCs). I found Bloodshed DevC++ which I use for C to this day. When I got my new notebook PC I ordered my copy of VS8, and loaded the whole couple gig install on my PC. I started using the MS C compilier that is part of that suite and found it to be the most awful, akward POS C compiler I ever used, much worse the VS6's C compiler/IDE. I went back to using DevC++. My theory is that this is intentional: I'm sure the VS8 C compiler is one of the best out there for those that care to learn to use it. Those that don't will be pushed down towards easier to use MS products like C# or VB.NET. There it is. My big MS conspiracy theory. |
You can do that with .NET's SDK and use their command-line compiler, but why you'd want to torture yourself with Windows Notepad, I don't know. For those out there that use Visual Studio, check out CodeRush. I've been using it about a year and a half and love it. It's an add-on for the IDE that has tons of built-in templates and keyvboard shortcuts for creating and working with code. |
I figured that is what you were talking about. We use alot of thrid-party jars, etc in our product*. I can, potentially, be a problem. We use ant as our build environment which allows us to tweek the exec order, classpaths, etc so that the pain is only felt once when the third-party item is initially integrated. * We use java for both a front-end J2EE-type environment using Tomcat and for a proprietary backend distributed file processing engine. Therefore, it gets complex really quick - thank [deity] for Ant. |
