Programming Advice

Alpha

New Member
Hello Burning Storm Studios Friends,

First I'll start with an introduction of myself: My name's Matt, and I'm a fairly active member here (even though I don't have many posts), mainly in the Odyssey discussions (I found out about your company/group through the Odyssey part of your site). I check the forums nearly everyday, just to see what's new and see if anyone needs help with Odyssey stuff, and help out where I can.

Anyways, the real reason I posted this topic is, as you may have deducted from the subject, I am a novice programmer and I want to learn more. I've always wanted to be an adept programmer, and my first programming language was Visual Basic 6 (VB6) with some old Wolfgang Odyssey Source my friend gave me a few years ago. I was intrigued but never really got far with the source since it was pretty messed up and I had little to no clue what I was doing.

After I gave up on working on that source, I decided I should really start learning VB6 from the beginning. I learnt a bit from a few tutorial sites, and started making some basic programs. I took a break from programming for about a year or so and now I'm back and I want to learn a real, modern language. My first choice would probably have to be either C# or Java. Any recommendations? C# seems to make a little more sense to me than Java does, but I still don't know either of them more than surface level.

My real reason in posting this is that I wish to seek you all's guidance on my journey. Firstly, do you recommend C# for me to start in as a newbie programmer? If so, where should I learn it from? Any tips while learning? Also while I was learning VB6, I used a control quite often called "Winsock" that basically allowed internet connections between client and server (at least that's what I used it for). While looking through C# tools and whatnot, I could not find this control, or anything like it for that matter. Is there a C# alternative for VB6's "Winsock"?

I know this is a lot of information to read, and a lot I'm asking for a fairly new member such as myself, so for that, I apologize in advance. I just know you all are good at what you do, and you've got to learn from someone better than yourself, so I thought I'd ask you all.

Thanks so much!
- Matt
 

Mycal

Staff member
Personally, I love C#. It is not as powerful as C++ being a managed language, but is still very powerful. The great thing about C# for most programmers out of school is it's similarity to Java. They have a very similar syntax and it is usually not hard for anyone familiar with Java or programming in general to pick up.

As for Java, I've expressed my distaste for the language for over a decade now. However, I think pretty much all of the reasons I hate it or no longer true. It is still a major resource hog, but this is not at all an issue anymore with modern computers. It is fairly powerful it's own sense with the only exception being built in native UI. It's still possible but not with built in support. My other big issue was very recently put to rest as well. The Google vs Oracle case was a huge problem. It basically allowed Oracle to step in and control who uses their open source language. Since they lost on every account now, this is unlikely to ever succeed in the future, so this is no longer a big issue. However, this is a major factor in why many large corporations would never choose Java as their language of choice. This coupled with the ease of access to the source has been a big issue.

This is something else I should touch on though. C#/VB.Net and Java are both VERY easy to decompile. You can use obfuscation, but it costs a lot of money and still does not totally protect source. Look at minecraft. It is obfuscated with every new release yet, there is still a large amount of mods for it released every day and even a project that completely unobfuscates the sourcecode for you. So both of these languages will have this problem. I've learned to accept it and have chosen not to even obfuscate any code of mine. To me, it's just not that big of a deal.

As for which language to choose, this is a tough one. I have said I love C#, however, all major universities have been slowly moving their programming courses to Java. I have no idea why, nor do many of it's professors. A large portion of all the companies that were at the career fair do not program in Java and instead either use C#, VB6 (believe it or not), or some combination of languages. Not to say none of them use Java, but it always made me laugh that they are teaching us a language that the majority of companies won't use. If this is something you want a career in, I personally would learn C# (and did). It is good to be pretty well-rounded so it will complement your studies in Java pretty well. If you are doing this as a hobby, then research a little bit and see what libraries are available for you to use. You may find a really nice library built in Java that you like.

If you are wanting to get into game design, the best thing I can do to get you started is the same thing Steven here did. Start with a basic Snake game. It's long, but should get you into many concepts that will help you in the future.
Develop it in this order. Start with drawing to the screen. It doesn't have to move at first and it also doesn't have to have a texture. Once you can draw to the screen and a form, move on to controlling whatever it is you drew with your mouse and keyboard. Once you get that far, add a texture to it. Next, play around with this for a little while, rotate the texture at will, shrink and grow it, flip it, and add color to it. These are all pretty advanced, but pretty easily accomplished with any graphics library. Now read up on a linked-list and implement your own, do not implement a built-in one just yet. Prove you understand how they work by building one yourself. Then use this to make your snake longer and shorter at will. Then learn how to use random and randomly place that fruit on the screen. Now the hard stuff. Learn very basic collision detection and also start keeping track of your score as you hit that fruit. Soon enough you should have a fairly complete snake game.

Now is the fun stuff. You may have already started learning about object oriented programming, but now use it for real. Make a basic entity interface (look it up it's an extremely simple interface). Inherit this interface for your fruit. If your snake isn't a class on its own already, make it one. Look into generics and make your linked-list generic (you may have done this already). Now in your snake class make this linked-list use the entity interface. Now make your fruit an interface itself and inherit it into several different fruits (grapes, apples, oranges, etc) and give each one their own score.

I guided a friend through something like this, after seeing steven make his firesnake game, and now he has a pretty good understanding of a lot of major concepts.

To answer your question about winsock, no there is not a winsock control anymore. This is a good thing though. Winsock was very flawed and had some major problems. Look into System.Net.Sockets. It is a system library to do what you want. For C#/VB.Net, this guy will be your best friend for the forseeable future: http://msdn.microsoft.com/en-us/library/default.aspx make good use of it. I also don't learn very well from books, I learn by doing. If books are your thing, go for it, but I can't recommend one. It's fairly easy to find tutorials for whatever you need (especially for the above starter guide) so don't be afraid to look them up. This is one of my favorite places for both problems and finding information on just about anything: http://stackoverflow.com/.

After you've matured in programming a little, I do highly recommend going back to this snake game and take a look at how you started. You'll probably find many ways you could have done better and you'll really see how much progress you've made. Just don't do what I normally do and think something's not perfect and start rewriting something over and over. Then you'll be in this infinite loop that I have been in for years. Speaking of which, I really need to finish that ASP page..
 

Alpha

New Member
Thanks a lot for your reply. It gave me some good information and things to think about. After doing so, I think I'll start with C#. I already have a book on it, but I haven't seriously gotten into it, but I will now. I'll also definitely be using that website, it seems like a very resourceful page.

Are you also saying that once I learn C# or Java, I'll be able to learn the other fairly quickly? If so that would be really cool since those are the two that really interest me.

Thanks again,
Matt
 

Mycal

Staff member
Alpha said:
Are you also saying that once I learn C# or Java, I'll be able to learn the other fairly quickly? If so that would be really cool since those are the two that really interest me.

In theory, this is true. I've known several people who left school with only Java knowledge who later were forced to learn C# but didn't have too many troubles. The only thing they had to get used to was the IDE and the new library calls. The syntax is identical so there's no issue on that.

If you can learn one or the other, it is typically fairly easy to pick up the other from what I've heard.

My experience is non-typical since I had several languages under my belt before I learned Java and C#. I knew both VB6 and VB.Net and was ok in C++, not to mention I had been programming in PHP for years before those. Java was an extremely easy language for me to learn and I learned it and C# simultaneously (Java for school, C# for fun). So don't totally take my word for it, but generally if you can learn any language, you should have little trouble learning a new one as well. Java and C# are just the easiest to switch between (not counting VB.Net and C#, since they are totally interchangeable), IMO.
 

Alpha

New Member
Alright, cool. Thanks a ton. I'm diving head first into this C# book and seeing if it's worth learning from.

From the start it touched on several different data types like, integers, decimals, doubles, floats, booleans, strings, etc. They also showed me logical expressions (if statements and such) and mathematical expressions in the C# language. They even taught me about 3 kinds of loops. For loops, While loops, and Do-While loops.

The chapter I just finished went much more in-depth on strings, and showing me different string (functions I guess you could say?) like ToString(), Format(), IndexOf(), LastIndexOf(), and more like those. At the end of the chapter, they had me build a program based off of Caesar's Cipher, which consisted of the form, a textbox, and 2 buttons (Encode and Decode). When text is entered, and Encode is clicked it translates each character into a 3 digit code followed by a comma.

It took me a little while to figure out how to accomplish it, but after a few attempts I got it. I held the entered text as a string and a variable integer, looped through the entire entered text and used Format() to translate the text to the Encoded version. Then simply reversed that process under the Decode button.

It was a fun little challenge, with hopefully more to come.

The project is attached if you want to check it out.
EDIT: Couldn't figure out how to add attachments, so I uploaded it to MediaFire. (Link below)

http://www.mediafire.com/?0icl2e1bq2i6pdk
 

steven

Administrator
The first language is always enough to give you the rules and understanding to easily pick up another (google for syntax) and run with it. Moving to Object Oriented Programming is a big step past throwing everything in one file and making it work. I would focus on how to send messages and talk between objects/handle objects most. Personally, I would go with Unity or another multi platform coding environment. You can use javascript/c# inside of it and it's very easy to develop in. A large amount of tools built in with a very active community for add ons ect... If it isn't offered by default someone has made a plugin for it, but after you understand how to use it you cut a lot of time out of the development process when making games.

I learned HTML first and moved onto PHP. Learned Java basics and worked on a Snake Game. Read a book on making a game with a focus on using object oriented programming to accomplish things within it. Picked up Unity, hit C# running and tackled a hand full of tutorials outlining the basics of the environment and tools - and hopefully if everything goes well I will be releasing my first mobile app this summer.

After awhile you will realize how scalable programming is...using the basics like if statements and for loops in the right way and enough times can create anything. It's really the ultimate creative outlet especially if you pair up with a good artist. Think about moving into a gaming environment soon though (Unity/Corona/any other game maker) because learning inside of one will cut down the knowledge you need if you end up using one.
 
Top