Programming: getting started

VirusType2

Newbie
Joined
Feb 3, 2005
Messages
18,189
Reaction score
2
I want to learn one or more programming languages as fast as possible. I use a Windows PC, but I have also considered making apps for smartphones. (my brother is a programmer on 3 major platforms)

I've always liked programming. At certain points in my life, I have messed with some form of Basic over a period of 25 years. In other words, I am no good, and don't know anything useful. But... I completely understand how its done and I believe I could hit the ground running if given the right learning material.


1) What languages should I learn?

At first I was going to learn C++, but I think now I'm going to start with VB.NET and/or C#. Does that sound smart? I want to start a career in this field (hopefully video games, but possibly fall back on databases and web sites)


2) Do you recommend a particular IDE?

I was thinking of starting with MS Visual C#.


3) Do you know of any great resources to learn these languages for free?

For example, a web series or videos with a step by step 'tutorial program' perhaps with examples. I know that some colleges have had free online courses in the past, and I know there are tutorials on Youtube. Do you know anything in particular? Thanks.
 
I have messed with some form of Basic over a period of 25 years.
It's these types of facts that you state that remind me that you're not as young as myself and I wonder: wtf?

Also, tried Python and failed, I have no grasp of programming beyond very basic html.
 
Do C#. You can learn it fast(relatively) and as you get more advanced it can do more advanced things for you, and in my opinion it opens yourself up well to learning C++ later down the road too if you wanted to.

It's not free, but personally I would recommend the 3DBuzz XNA course which teaches XNA as well as many important concepts in programming. I personally loved it. You could either buy the courses seperately or do a member sponsorship which would get you access to that including way more videos for other programming languages such as C++ and 3d modeling and other cool things.

I'm not trying to pimp 3dbuzz out, it's just that from my experience they are the most amazing teachers I have ever seen... and I've watched shitloads of tutorials before.

You could also go the ebook route like I did. That's what I did in the very beginning.
 
Have you looked into Google Code University? I have heard excellent things about it. No registration needed and all materials are free to use.
This is great. I just want to jump in and get started. This is essentially a proper class, I just have to read instead of listen.

Thanks everyone. I need to spend some time researching these suggestions.

It seems I just missed my brother on the phone; I expect he'll have some good advice for me as well.
 
Have you looked into Google Code University? I have heard excellent things about it. No registration needed and all materials are free to use.

Wow. Google just never stop being awesome, do they? I've been trying to teach myself C++ on and off for a few months now, this will surely come in handy.


@Virus:
If you're hoping to get work programming games, I think C++ is the best bet. Or if you're looking for any many other kinds of programming work; C++ is pretty industry standard. You might want to look into Python as well though - it seems pretty trendy these days, it's used a lot for network/web programming and its syntax is about as simple as it gets, so you'll probably learn it pretty quickly.

http://en.wikipedia.org/wiki/Game_programming#Programming_languages
 
Hi, once you figure out what language you want to use, you can use the problems at Project Euler to have some way to learn.
 
I would download Unity and go through some tutorials. You can use Javascript and C# with it.

If you are a complete beginner then I'd start with RPGMaker VX or Game Maker to learn the basics (variables, conditionals, etc) because they have an accessible GUI that visualises the code.
 
I managed to get the example program to work. :cheers:

Just trying to figure out the damn setup was more complicated than I expected. I remember when it was just a blank screen and a flashing cursor.

>_


It's these types of facts that you state that remind me that you're not as young as myself and I wonder: wtf?
I'm 35.
Son.
 
Learn C#, get one of those books from wrox or something, and make sure you have micrsoft visual studio 2010 on your system, they probably support more smartphone os..
 
Learn C#, get one of those books from wrox or something, and make sure you have micrsoft visual studio 2010 on your system, they probably support more smartphone os..

Yeah I just jumped into C++ using the tutorials on the Visual C++ 2010. They are a bit long winded but if you're willing to spend some time reading they give you a fairly comprehensive start.
 
Personally I think that AJAX is the way of the future. More and more things are going to be "web apps" as time goes on. For that you need to know HTML/Javascript and a server side language such as PHP. The nice thing here is you don't have to compile any code, don't have to manage memory, and can hit the ground running right away.

CBT nuggets has a nice PHP lesson set which if you don't want to pay for I'm sure you can find in other ways.

As far as a career goes I think this is where you will have the best shot at finding work, the job market is saturated wth these type of jobs.
 
Yeah I just jumped into C++ using the tutorials on the Visual C++ 2010. They are a bit long winded but if you're willing to spend some time reading they give you a fairly comprehensive start.
I haven't found a good tutorial for it. There must be some prerequisite. I know at first I thought they did, but it turns out they don't explain a damn thing on the Google codebase, and they pose problems for you to figure out, when you don't know any commands.

1) Find a way to generate a random number.

This is so elementary to me, it's insulting, but they haven't explained how to do it yet. INTEGER RANDOM (10)+1 or something. I learned that 25 years ago, but Google codebase doesn't tell you the language. That's all I need to learn is the damn language. Found it elsewhere. Int (integer) in C ... forget the rest.

Anyway, I've got several languages installed, but I'm messing with Visual Basic at the moment. Microsoft has a really nice step by step example program on MSDN. Maybe that's what you are talking about :p

Javascript
From what I read, Javascript is basically C, but each of these derivatives has it's own unique features that aren't compatible with each other.
Yeah, I've heard that is the one in highest demand.

If I want to be a game programmer, I think I'm going to need to learn something based on C, usually.
 
Yeah, if you want to do game programming web based languages aren't the best way to go. But if you are looking at this as a career opportunity there are going to be far more jobs available on the web front than the gaming front.

Pretty much any scripting language you learn will give you a better understanding of other scripting languages. Just from my experiance with Javascript and PHP I've successfully worked with PIC chip programming (using C), LabVIEW programming (actually certified in it), and programming C based test set ups on both linux and windows. But I don't think it's fair to say any one of these is bascially the same as another, they are all unique. If you are programming for the web it is much different from programming for a windows console program even if the synthax for C and javascript look similar. So you might want to play around with all but find the one you want to do the most and concentrate on developing your experiance in that.
 
Personally I think that AJAX is the way of the future. More and more things are going to be "web apps" as time goes on. For that you need to know HTML/Javascript and a server side language such as PHP. The nice thing here is you don't have to compile any code, don't have to manage memory, and can hit the ground running right away.

CBT nuggets has a nice PHP lesson set which if you don't want to pay for I'm sure you can find in other ways.

As far as a career goes I think this is where you will have the best shot at finding work, the job market is saturated wth these type of jobs.

You mention Ajax then you go on to mention javascript/PHP but you don't mention ASP.NET?

SCREW YOU MAN, SCREW YOU!
 
You mention Ajax then you go on to mention javascript/PHP but you don't mention ASP.NET?

SCREW YOU MAN, SCREW YOU!

I don't like IIS, I think apache on linux is a better and more widely used solution. But I don't hate on ASP.NET, I just never really used it for that reason.

I've made a website before, but I didn't enjoy it at all.

Your code kind of sucks but if that is your first website that is a pretty damn good job. It all depends on what you like to do. For me when I see a website interacting through javascript with my program on a server I get a major hard on. One project I am working on now is controlling large numbers of power supplies for laboratories in real time through a web browser. I can open this up on linux, windows, or on my android phone and it works on any platform that has a standards compliant web browser. All the information is updated in real time without having to refresh the page. To me this is the coolest thing ever but it might not float your boat as much. Just keep in mind building web applications isn't really the same thing as building websites.

I was remembering this article wrong: http://www.eweek.com/c/a/IT-Management/10-Programming-Languages-You-Should-Learn-Right-Now/

I just wanted to make this correction: they aren't numbered by demand, they are just ... numbered.

(I had only skimmed it, since I'm completely overloaded with information right now)

PHP is by far the most widely used and by far the most flexible. You can run it on virtually any webserver and since it's open source you have thousands of different extensions and frameworks available to you. But ASP.NET is very popular in the job market, as is Java. In the end all these achieve the same goal and if you know one you can probably be trained on the other very easily.
 
Your code kind of sucks but if that is your first website that is a pretty damn good job.
Lol, I'm sure it's a joke. My goal was to make it look decent and make it working as quickly as possible and then stop working on it. (I got paid for the task and not the time spent)
Just keep in mind building web applications isn't really the same thing as building websites.
Yeah, that's true.
PHP is by far the most widely used and by far the most flexible. You can run it on virtually any webserver and since it's open source you have thousands of different extensions and frameworks available to you. But ASP.NET is very popular in the job market, as is Java. In the end all these achieve the same goal and if you know one you can probably be trained on the other very easily.
Right now I'm learning C# because it's designed for fast deployment and has a lot of nice features to make things easier. But my ultimate goal is C++. It can compile to machine language (apps/games run at full speed), and there is an abundance of information/tutorials/help on the internet.

I would also consider learning other languages (for Apple and Android), but right now, I think I'll stick with Microsoft, since they have Phone/Desktop OS/Game Console (and are supposedly working on a tablet OS as well), and because I use a Windows machine.
 
Lol, I'm sure it's a joke. My goal was to make it look decent and make it working as quickly as possible and then stop working on it. (I got paid for the task and not the time spent)
I was actually serious. For a first website that's a very good job. But your code does suck which is normal for new HTML coders. You can eliminate about 80% of your code and the site would still look the same while functioning much better. But obviously it's up to you if you want to take the time to learn proper HTML/CSS techniques. I think it's a great skill to have but it you found it borning might not be for you.

Right now I'm learning C# because it's designed for fast deployment and has a lot of nice features to make things easier. But my ultimate goal is C++. It can compile to machine language (apps/games run at full speed), and there is an abundance of information/tutorials/help on the internet.

I would also consider learning other languages (for Apple and Android), but right now, I think I'll stick with Microsoft, since they have Phone/Desktop OS/Game Console (and are supposedly working on a tablet OS as well), and because I use a Windows machine.

I've worked on simple C applications but that's kind of one of my goals in the future as well. I would really like to learn the windows API. But as far as mobile devices ago I truly believe in the next decade most of the apps will all be HTML/Javascript using a server for all the processing. The reason I say that is that it simply makes sense. If your app is HTML based it will work exactly the same on an android, and iphone, blackberry, palm os, whatever. Obviously certain things such as gaming can't be done well using this method but things like calendars, calculators, online banking, email, etc, etc, etc can.
 
All I know is that on one website article, it said that C# was just Java with a MS badge on it. So, hopefully, most of what I can learn in C# will be useful for learning Java as well.

EDIT: Sorry, I misread. Java is not the same as Javascript. So that doesn't relate to what you were saying. I just don't really have an interest in developing for the web, web games, web apps.
 
I don't know about that but I wouldn't say that Microsoft has any ownership over C or C++. You can program everything from linux to mac to pic chips using C/C++ and I don't believe Microsoft ever really played a role in the development of C.

On edit: quick search on wikipedia shows the bell labs actually developed it for Unix.
 
I don't know about that but I wouldn't say that Microsoft has any ownership over C or C++. You can program everything from linux to mac to pic chips using C/C++ and I don't believe Microsoft ever really played a role in the development of C.

On edit: quick search on wikipedia shows the bell labs actually developed it for Unix.
You are misunderstanding.

C# (pronounced "see sharp")[6] is a multi-paradigm programming language encompassing imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed by Microsoft within the .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270). C# is one of the programming languages designed for the Common Language Infrastructure.

C# is intended to be a simple, modern, general-purpose, object-oriented programming language.
http://en.wikipedia.org/wiki/C_Sharp_(programming_language)

If you know C#, you can develop for anything Microsoft. (AFAIK)
 
I'd learn Javascript, not because it's a good language because it's not (not terrible either, but it has some major WTFs), but because it's going to be very, very important in the coming decade. It also has a fairly nice combination of procedural and functional programming features (well, honestly it's mostly a procedural language, but its first class functions go a long way towards functional programming). Having the knowledge on how to use functions as objects is also valuable baggage to have as it provides amazing power and the concept can be carried over to other languages that support first class functions. It also looks like functional programming languages will also become more popular in the future. Javascript is available on every platform, making it perhaps the most ubiquitous language around.

Personally though, my heart is still with C#. It's just a wonderful language to write and has relatively few quirks. It has a progressive development path as well, evolving quickly, not afraid to tread into entire new paradigms, unlike Java which has sat still for like 5 years now. Because of Javascript's flaws and because one language can't possibly be a good fit for every problem out there no matter how good, I still hope for Microsoft to push Silverlight (well, CLI + the CLR + XAML) as a web standard, integrating it into IE and work with Novell to put Moonlight into the other browsers. This will not only give you C# supported natively in the browser (plus XAML as an alternative to HTML/CSS), but every language that is CLI compatible (F#, Python, Ruby, Boo, etc), giving you both flexibility and choice and performance. I would hate a HTML+CSS+JS only future..

I see that you want to learn C++, if that's because it personally interests you or if you actually want to pursue a job as an engine developer, then that's fine. But don't think you need it to develop games, that can be done in any language and performance is unlikely to be a concern to a lone developer on hobby projects. In fact, unless you know exactly what you're doing, you're more likely to write better performing C#.

All I know is that on one website article, it said that C# was just Java with a MS badge on it.

That was true about 8 years ago, but it has long moved past it. It's much more elegant to use than Java, honestly.
 
I see that you want to learn C++, if that's because it personally interests you or if you actually want to pursue a job as an engine developer, then that's fine. But don't think you need it to develop games, that can be done in any language and performance is unlikely to be a concern to a lone developer on hobby projects. In fact, unless you know exactly what you're doing, you're more likely to write better performing C#.
All good information, thanks. This part was really helpful.
 
Note that .NET is deemed fast enough for intensive 3D games on a mobile device with limited battery life (XNA on WP7), so that puts it comfortably in "fast enough for nearly any purpose" category. To talk numbers, a naively programmed C# program will most likely be faster than a naively programmed C++ program. Well optimized C# will range from half as fast to just as fast as well optimized C++ and in extreme cases C++ can be 4-10x faster, but then you're talking very specific micro-optimization that C++'s low-level capabilities are well suited for.

Important here too is to know that games are mostly GPU-bound anyway, the speed of code executing on the CPU is less important. The potentially large speed difference I mention above will only show in a CPU-bound program. Another thing is that the game itself, the logic, are always written in a higher level scripting language, often Lua. UnrealScript is another example. Using the same high-level managed language that you used for the engine here, which will be faster than the scripting language, will allow you to get back a little bit of performance in this area.

Earlier you said that C++ compiles to machine language, which is true, but so does C#. Before any code gets executed it gets Just in Time (JIT) compiled to machine instructions. The performance of this compiled code is mostly limited by the fact that a JIT compiler needs to be really fast and can't spend too much time optimizing, whereas a ahead-of-time compiler is allowed to take minutes or even hours. Another factor is that a managed language gives you less low level control, but C# does allow direct memory manipulation, but admittedly more limited than in C++.

A combination of those two is what causes some C++ to be dramatically faster than C#, as the .NET JIT compiler does not generally generate code that uses your CPU's SIMD capabilities. That stands for "single instruction, multiple data", SSE being the most common implementation of this on AMD and Intel, meaning that with SSE your CPU can apply the same instruction to multiple pieces of data, up to 128 bits at the same time, or four 32-bit numbers, which makes it up to four times faster on 32-bit numbers (which you'll find in games and such) than code which does not use these SSE instructions. This is called vectorization of code and while I've never done it, I've understood it's pretty hard. The JIT compiler has no time for that and even C++ compilers aren't very good at this. Which is where C++'s low level abilities come in, allowing you to talk to the hardware directly. Compilers like GCC and VC++ also give you things called compiler intrinsics, slightly higher-level ways of calling these SIMD instructions, but from what I've seen it's still pretty messy and hard. Mono, .NET's open source implementation, has some built-in types that receive special treatment by the JIT compiler, and get turned into decent vectorized code, so that's probably one way to fix this problem for managed, high-level code. Those things aside, a simple loop adding a bunch of numbers together will perform just as well in C# as in C++.

I'm no compiler writer, but potentially a JIT compiler should be capable of generating better code than a AOT compiler, since the JIT compiler has more information about the hardware it will run on. It can also look for slow or often executed parts of your code while your program is running and spend more time on optimizing those, which .NET doesn't do but the HotSpot compiler of the Java Virtual Machine does. It doesn't look like we're there yet, perhaps when we have so many cores on our CPU that we can just dedicate an entire core to optimizing your code constantly.

Remember that Minecraft was actually written in Java, which while not a very graphically intensive game (but again, that happens on the GPU) is pretty CPU heavy I imagine. So it's definitely possible and I very much doubt that the performance characteristics of the language will ever be a limiting factor for you, that can only be true after you've optimized everything there is to optimize, use the perfect algorithm for every calculation and multithreaded the hell out of it. Then and only then you can say that you actually need C++. Not that I'm against using C++, many people love it and it's very powerful, but performance should not be the primary motivation unless you've established that it's your choice of programming language that's holding your program back.
 
This is really helpful. Thanks again.
To talk numbers, a naively programmed C# program will most likely be faster than a naively programmed C++ program.
Is this a botched comparison, in bold? Could you clarify this? It seems to contradict the message that followed.

Natively programmed/ Optimized. Hmm, maybe I just misunderstand what you mean. I thought native C# would mean that the program was designed on C#, and you meant to compare it to some kind of port to C++?
 
This is really helpful. Thanks again.

Is this a botched comparison, in bold? Could you clarify this? It seems to contradict the message that followed.

Natively programmed/ Optimized. Hmm, maybe I just misunderstand what you mean. I thought native C# would mean that the program was designed on C#, and you meant to compare it to some kind of port to C++?

No, like so:

Say you have a class like this:

Code:
class Foo
{
  // implementation here
}

And this loop:
Code:
for(int i = 0; i < 1000000; i++)
{
  new Foo();
}

Aside from the issue that the compiler will eliminate the loop because it sees it doesn't do anything, it would most likely be faster in C#. Why? Because allocation through 'new' in C# is really fast, thanks to the garbage collector. All memory in .NET is one big contiguous chunk, when you allocate memory, it can just add it to the end of the chunk. When the garbage collector deallocates that memory again, it compacts the memory heap again, ensuring no gaps are left. In C++ however, when you allocate something through 'new', it has to "walk the heap" because it does not know where it can allocate sufficient memory. To illustrate:

|***|**|*****|

That is the heap in C#, where objects denoted by the '|' and the '*' is space they occupy in memory.

I now "new up" an instance of Foo, which is four * large. The garbage collector will make it look like this:

|***|**|*****|****|

Now, the second object gets deallocated, before compacting, it will look like this:

|***|__|*****|****|

Then the GC compacts the heap, making it look like this:

|***|*****|****|

A nice contiguous chunk again. Creating another instance of Foo just ends up at the back.

Now C++ however, basically holds a list of free slots in memory and allocates memory in slots that are sufficiently large to hold the requested amount. Initially, it might store the new Foo at the back as well, like this:

|***|**|*****|****|

Now, again, the second one gets deallocated, but it doesn't get compacted, making it look like:

|***|__|*****|****|

Now the C++ memory allocator knows that it has a free slot of size two and more at the back (but to allocate more at the back it might have to ask the OS for more memory). When I now create a new instance of Foo, it first has to "walk the heap" across the free slots and check if Foo fits in any. Here, it doesn't fit anywhere and has to go in the back (hur hur). After allocating another one, it looks like this:

|***|__|*****|****|****|

The memory becomes fragmented, littered with potentially useless holes in it and as a result, uses more memory and every hole slows down allocation as well, because the memory allocator has to check the holes if it can fit it in there (hur hur).

Now, this is preventable, you can write your own memory allocator or use a specialized one depending on the circumstance, but that's what I mean with writing your C++ naively. But you can just do this in C#, no problem. Of course, garbage collection and compacting isn't free either, but usually still cheaper.
 
This is really helpful. Thanks again.

Is this a botched comparison, in bold? Could you clarify this? It seems to contradict the message that followed.

Natively programmed/ Optimized. Hmm, maybe I just misunderstand what you mean. I thought native C# would mean that the program was designed on C#, and you meant to compare it to some kind of port to C++?


he said "Naively programmed c#" i.e programs that are written without any optimizations.
 
he said "Naively programmed c#" i.e programs that are written without any optimizations.
OOOOHHH

I thought that was a typo for "native", but he actually meant a programmer who doesn't know better.

Thank you. And thanks for clarifying, PvtRyan.
 
Back
Top