• 0

Wanting to program again...


Question

I havent programed anything since VB6 back in 2004/5. I'd like to get back in the game again but where should I start? Pick up with VB.net or start clean witn C# or C++? I've played with C++ before but never really got into it like I did with VB.

Any opinions?

Link to comment
Share on other sites

Recommended Posts

  • 0

I prefer C# over VB for a few reasons :

1) No legacy functions and very little language-specific crud, just plain .NET

2) Looks and feels like clean Java or very clean C++

3) Supports XNA

Nonetheless, VB is just as powerful as C# and almost identical in semantics, and it's specifically targeted towards VB6 users and hobbyists. It's a fun and friendly environment. Among its advantages :

1) Background compilation = find errors in your code more quickly, never wait for a recompile

2) Looks and feels like previous versions of Visual Basic (for those used to that syntax)

3) Better code snippets, editor visually separates routines, VB.NET namespace for quick access to commonly-used .NET classes instead of having to dig through the framework

C++ IMO is not something you want to work with unless you have to : embedded development, high-performance engineering or scientific computing, commercial-grade 3D engine design, or anything involving high-performance processing of lots of data or direct access to hardware. I currently work in embedded systems so I do C++ all day, but when I program for my pleasure it's always C# :heart: . C++ forces you to consider a thousand questions completely irrelevant to your real problem each time you want to do the simplest things, it's just a pain to work with. Should I make my constructor explicit? Should I make my destructor virtual? Should I redefine operator=? Or make it private perhaps? Should I #include or forward-declare the class? Should I make this or that method const? What about its arguments/return type? Should I pass by pointer or reference? Should I initialize my members using an initializer list or not? Should I use iterator or const_iterator to iterate a list? Should I printf() or cout<< ? Somehow, you never have to ask these questions in C# (or VB, or any other programming language I can think of), and yet you get to make fully functional, correct programs with pretty damn good performance nonetheless.

Edited by Dr_Asik
Link to comment
Share on other sites

  • 0
I prefer C# over VB for a few reasons :

1) No legacy functions and very little language-specific crud, just plain .NET

2) Looks and feels like clean Java or very clean C++

3) Supports XNA

Nonetheless, VB is just as powerful as C# and almost identical in semantics, and it's specifically targeted towards VB6 users and hobbyists. It's a fun and friendly environment. Among its advantages :

1) Background compilation = find errors in your code more quickly, never wait for a recompile

2) Looks and feels like previous versions of Visual Basic (for those used to that syntax)

3) Better code snippets, editor visually separates routines, VB.NET namespace for quick access to commonly-used .NET classes instead of having to dig through the framework

C++ IMO is not something you want to work with unless you have to : embedded development, high-performance engineering or scientific computing, commercial-grade 3D engine design, or anything involving high-performance processing of lots of data or direct access to hardware. I currently work in embedded systems so I do C++ all day, but when I program for my pleasure it's always C# :heart: . C++ forces you to consider a thousand questions completely irrelevant to your real problem each time you want to do the simplest things, it's just a pain to work with. Should I make my constructor explicit? Should I make my destructor virtual? Should I redefine operator=? Or make it private perhaps? Should I #include or forward-declare the class? Should I make this or that method const? What about its arguments/return type? Should I pass by pointer or reference? Should I initialize my members using an initializer list or not? Should I use iterator or const_iterator to iterate a list? Should I printf() or cout<< ? Somehow, you never have to ask these questions in C# (or VB, or any other programming language I can think of), and yet you get to make fully functional, correct programs with pretty damn good performance nonetheless.

You're just making C++ sound impossible to use...

I know math, and a little bit of algebra and I can make descent programs.

Edited by Yoma
Link to comment
Share on other sites

  • 0
You're just making C++ sound impossible to use...

LOL!

Anyway, to elaborate on Dr_Asik's point a bit, it's a lot like driving a manual transmission vs. automatic transmission car. Manual transmission requires more attention and action by the driver, it's harder to learn, and most drivers feel that the level of control afforded by a stick shift is unnecessary, annoying, unwieldy, and overall something that makes driving thoroughly unpleasant. And there are some people who relish that level of control and who love driving manual transmission cars. Likewise, there are people who hate unmanaged code and think that it just "gets in the way", and there are people who love "unmanaged" code because they feel lost without that explicitness. Yes, there is a lot more that you have to worry about in C/C++, but some people (admittedly, not that many) actually like the micromanagement control, and if you've used it enough, it doesn't seem like much of a burden.

But the correct answer to any "which language?" question depends strongly on "what am I trying to do?". If you want to compete in an auto race, then you want to use manual transmission (automatic isn't even an option!), but if you are driving a short distance in stop-and-go traffic, then automatic might make more sense. If you're just doing casual hobby "fun" programming, then C# might fit the bill more. If you want to do simple or "disposable" programming, then you'd probably want to look at a scripting language like Perl. For performance-sensitive stuff or things for which you want maximum deployability (because there is no better way to turn people away than to require them to download a 300MB .NET framework just to run to widget), then go with native code.

(BTW, I hate manual transmission cars. But I do like native code, to the point that I get frustrated and feel like I'm being put into a straightjacket when I use managed code.)

Link to comment
Share on other sites

  • 0

The auto/manual analogy is a good one. Ask whether you are more interested in getting down & dirty with the intricacies of the code, or are you more interested in algorithms and getting cool stuff working. If it's the latter, and you are serious about programming, I think it's C# & .NET if you are Windows focussed, and Java if you are Linux, or cross-platform.

Link to comment
Share on other sites

  • 0

Having been jobhunting recently, I take this to be worthy of note:

More jobs asked for C# than any other language.

As a C# programmer with varied experience in VB6, VB.net, Java, and server side languages such as PHP - I find C# to be elegant, clean and yet powerful enough.

Link to comment
Share on other sites

  • 0

It is true that manual memory management directly add complexity to C++, when compared to a managed language like C#/VB/Java/etc. However, C++ also suffers from a few terrible design decisions, most importantly keeping the C model of compilation, with header files, a model that interacts awkardly with classes and horribly with templates. As a result, it's quite a mess. D and even plain C show that a native language doesn't need to be insanely complex. See http://yosefk.com/c++fqa/defective.html for details.

Link to comment
Share on other sites

  • 0
As a result, it's quite a mess.

Yea, C++ tries to occupy that weird space of trying to be a "modern" language while maintaining a transparent nativeness and compatibility with C (as you are aware, C++ was designed as an addon to C: C++ compilers converted code to C which were then compiled by a regular C compiler). I personally avoid some of C++'s uglier bits (e.g., templates) whenever possible and use it more as "C with classes and some extra syntactic sugar". And unfortunately, I think that at least some of the disdain for unmanaged code comes (unfairly) from the historical baggage of C++'s design.

(Oh, and something I forgot to mention in my manual/auto analogy: learning auto after learning manual is much easier than learning manual after learning auto, and the same applies to native/managed.)

Link to comment
Share on other sites

  • 0
Having been jobhunting recently, I take this to be worthy of note:

More jobs asked for C# than any other language.

What kind of job were you looking for? Where I work, C# simply doesn't exist, or at best it's "Microsoft's Java". :pinch:
I find C# to be elegant, clean and yet powerful enough.
Amen.
Link to comment
Share on other sites

  • 0
I havent programed anything since VB6 back in 2004/5. I'd like to get back in the game again but where should I start? Pick up with VB.net or start clean witn C# or C++? I've played with C++ before but never really got into it like I did with VB.

Any opinions?

I was in a somewhat similar situation as you recently. I studied Computer Systems at Uni about 10 years ago and we used Java. My current job (which I've been in since I left Uni) doesn't involved programming at all (I'm in Accounting :| ) but recently I've wanted to get back into programming. Having done Java (and a little C at Uni too) I wanted to do something different, so I went for Perl. It's probably not as widely used as it was 10 years ago, but it's interesting to see what kind of things I can do with it. Perhaps you should do the same and try something completely different. I'm not suggesting Perl, unless you really want to try it, but perhaps Python or Ruby might be up your street. But, coming from a VB background you're probably after quick visual results (i.e., GUI's) so may C# is right for you.

Link to comment
Share on other sites

  • 0

+1 for C#

but if you liked VB, then give VB.NET a go.....download the Express Editions and pick up a few example projects and have a go!

GE

Link to comment
Share on other sites

  • 0
Once you learn C++ pretty good, you'll find it to be quite easy to use. It's just learning it that can be pretty hard.
There's nothing easy about C++. Except shooting yourself in the foot. Any language I can think of is easier, excluding binary and esoteric languages like brain**** or malbolge.
Link to comment
Share on other sites

  • 0
The auto/manual analogy is a good one. Ask whether you are more interested in getting down & dirty with the intricacies of the code, or are you more interested in algorithms and getting cool stuff working. If it's the latter, and you are serious about programming, I think it's C# & .NET if you are Windows focussed, and Java if you are Linux, or cross-platform.

I actually think the analogy is pretty poor, you will be able to go to the same places with an automatic car vs manual BUT there are things that can only be done in C/C++ (or ASM)

Link to comment
Share on other sites

  • 0
I actually think the analogy is pretty poor, you will be able to go to the same places with an automatic car vs manual BUT there are things that can only be done in C/C++ (or ASM)

Eh, there's no such thing as a perfect analogy. :p But I thought my analogy (sorta) covered that: automatic transmission vehicles don't even exist in the world of professional auto racing. And just as it is rare for someone to do auto racing, it is relatively uncommon for someone to need native.

Link to comment
Share on other sites

  • 0
There's nothing easy about C++. Except shooting yourself in the foot.

I beg to differ. It's easy to shoot yourself in the foot in any language that you don't fully understand; the main advantage that C# has here is that it's easier to learn, but there are still footguns. And there are even some ways in which it's easier to shoot yourself in the foot with C# (e.g., exceptions).

Edited by code.kliu.org
Link to comment
Share on other sites

  • 0
It's easy to shoot yourself in the foot in any language that you don't fully understand; the main advantage that C# has here is that it's easier to learn, but there are still footguns.
The problem with C++ is that it's almost impossible to fully understand it. Even the compiler often gets confused.

As for exceptions, you have me a bit puzzled. Exceptions make much more sense in a garbage-collected environment than in the native world; in C++, they are a never-ending source of memory and resource leaks. Also, the only way you can catch any exception in C++ is by writing catch(...) which doesn't allow you to check what the exception was. :rofl:

Link to comment
Share on other sites

  • 0
As for exceptions, you have me a bit puzzled. Exceptions make much more sense in a garbage-collected environment than in the native world; in C++, they are a never-ending source of memory and resource leaks.

Garbage collection can only save you from a memory/resource leak; it can't save you from things being left in an inconsistent state, and latter is generally a much more serious bug than the former. I'm not saying that C++ exceptions are that much better--the constraints on when they can be raised makes them a bit more manageable, but exceptions, in general, are a bad programming model. It's one of the most misguided "innovations" in the history of language design (because, in the name of "clean" code, they obfuscate the exit points of the control flow) (my other hated "innovation" is the use of references instead of pointers because, in the name of "clean" code, they obfuscate the locality (or the lack thereof) of a variable, whereas pointers make it pretty darn explicit that what you are changing can affect other code paths).

My beef with C# with respect to exceptions is that, although C++ supports exceptions, they are really not that widely used in C++. Whereas in C#, they are the norm, they are everywhere, and people are expected to use them in C#.

But my original point still stands: you can shoot yourself in the foot in any language, including C#.

(PS: There is nothing wrong with "clean" code, but "cleanliness" should always be secondary to correctness.)

Edited by code.kliu.org
Link to comment
Share on other sites

  • 0

I can't really argue on the usefulness of exceptions due to my inexperience, although I know a lot of respectable figures in Java, .NET and C++ have recommend using them instead of error return codes. I can definitely see where they are dangerous, but I'm not sure there's any better alternative.

I agree that you can shoot yourself in the foot in C# and Python and even TI-83 BASIC, I do it all the time. :p But in C++, it's like an order of magnitude easier. Just managing #include directives in order for your build to compile, you can shoot yourself in the foot right there (cyclic dependencies), and it's not even C++ code, it's just preprocessor directives, you haven't even started writing actual instructions.

Link to comment
Share on other sites

  • 0

Just to clarify :

(my other hated "innovation" is the use of references instead of pointers because, in the name of "clean" code, they obfuscate the locality (or the lack thereof) of a variable, whereas pointers make it pretty darn explicit that what you are changing can affect other code paths).
As you're certainly aware, although references are often advocated as a way to eliminate asterisks and arrows, that's not the reason they were introduced in the language (it would have been very lame; not any more than header files, but I disgress :p). References exist because they enable operator overloading. From the C++ FQA :

"FAQ: You can assign to the return value of a function. This is useful for operator overloading, as in array[index] = value; where array is an object of a class with overloaded operator[] returning a reference.

FQA: Exactly - and that's why references exist.

C++ references are essential for supporting C++ operator overloading. That's because C has no facility for assigning to the result of a function call (a function can return a pointer and you can assign to the pointed object, but you need to use an asterisk for dereferencing the pointer, which is different from assigning with the built-in operator[])."

http://yosefk.com/c++fqa/ref.html#fqa-8.3

Link to comment
Share on other sites

  • 0
Eh, there's no such thing as a perfect analogy. :p But I thought my analogy (sorta) covered that: automatic transmission vehicles don't even exist in the world of professional auto racing. And just as it is rare for someone to do auto racing, it is relatively uncommon for someone to need native.

Yes they do, many 6-8second drag cars use a Auto tranny, ever try shifting 3-4 times in 6 seconds?

Link to comment
Share on other sites

  • 0

Dr_Asik: Funny, because I use C# at work, and then sometime use C++ in my free time. I guess I do it to keep my mind sharp.

OP: I would look into C# or Java.

Link to comment
Share on other sites

  • 0

I think it really depends on the type of programmer you are. I started programming in VB.Net back during my sophomore year of high school. I then switched to Java when I enrolled in AP Comp Sci A/B during my senior year. Honestly, I really liked the switch from VB to Java because I felt like I was actually programing and not having the IDE do everything for me. During my freshman year of college, I learned binary and assembly for the LC-3 ('Fake' learning computer that is 16-bit). Out of all the languages I learned, including playing around with C# in the summer, I found Assembly to be my favorite. While I wasn't able to make a useful program (The final assignment was to make a number guessing game), I highly enjoyed having that level of control.

So you never know - some people like sticking with languages like Visual Basic that handle all the hassle for you so that you can focus on the program, while others like dealing with that hassle. You have to find what is right for you.

Though, I will say, when you have procrastinated a programing assignment that is in binary, you haven't learned Assembly yet, and you forgot a line of code near the start of your program and you just finished a long program, you will want to kill yourself while you recalculate all your PC Offsets >.<

Link to comment
Share on other sites

  • 0
Dr_Asik: Funny, because I use C# at work, and then sometime use C++ in my free time. I guess I do it to keep my mind sharp.
C++ may keep your mind sharp, but C# keeps your mind C-sharp.

:huh:

... ok, lame joke, it's one o'clock here and I couldn't resist.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.