Jump to content

New To Programming


David_J_Rogers
 Share

Recommended Posts

It will teach you too much for now. It's more important that you learn various ways to structure your code (like the object-oriented model) than learning about the specific details of different compilers. You'll have to learn those details later to write fast code. But you'll first have to write readable code. If you code something, check it again after a week, and see how much you still understand, even understanding a small program that's badly written will be hard.

I suggest you look for an introduction to object oriented programming in your favorite language. You can also look for different methods (procedural, functional, logical...), but object oriented is used most.

The language doesn't generally restrict your coding style to a specific method. But some languages are more suited for some methods. Like Haskell is mainly for functional programming, JS can be used for functional and object oriented programming, Java and C# are mainly for object oriented programming...

Link to comment
Share on other sites

What we want to say, is:

  • You have to learn to think like a machine. (you can hide instructions from machines using /* a comment */ or //right of these slashes is hidden, so even the bracket, because it's on the same line right of the slashes-->)
  • Break the code down into single commandos:

    e.g. the one Sander posted:

    for (i = 1; i <= limit; ++i){  /*do something here every loop: calculate. store. process.*/}
  • Each characters (e.g. i or limit above) are your brain. They store something somewhere on your machine (memory).
  • Machines start at 0, not at 1 !! So usually you find such loops (instead of the above):

    for (i = [b]0[/b]; i <[u][b]=[/b][/u] limit; ++i){  print "I am a string. It's the " + i + "th pass of the loop. Break over to a new line -->\r\n"  ; /*<-- each commando has to be separated somehow to tell when a new instruction starts. This can be \r\n or ;  ... it depends on how it was defined!! it's human-made! */}
  • I prefer writing the above loop this way:

    i = 0;                    // start with 0howOftenShallILoop = 1;    // loop only once (so essentially you could leave out the loop in this case.while (i < howOftenShallILoop){    i = i + 1;}
The last loop broken down into pieces is:
  • I have a 0 in memory (i could tell you where exactly but you're not interested in it for now as you have enough free storage space left:)!).
  • As long as i is < howOftenShallILoop we execute this operation:

    i = i + 1
    which is the core of our program (leaving this out would make your program never stop!! it would loop and loop and i would always stay < howOftenShallILoop. :/ No chance to stop your program than other than ... well .. you know ... to 'kill' it, say, hey, no more energy for you no matter what you're doing currently (could be fatal). So better ensure your loops always find a way to stop.
  • The i = i + 1 means: Take what we stored in i (our 0) and increase it by 1. Then store it back. So essentially at least three operations in one.

    For this there exists a short form, because it's used so often:

    ++i
Edited by Hephaestion
Link to comment
Share on other sites

My friend back in Arizona is in the same program as I am. But he already knows how to write scripts and stuff in Java and C++. I can never get a hold of him though. I'm trying to see of my university has some books I can get early. They usually have the latest books on writing code.

Edited by David_J_Rogers
Link to comment
Share on other sites

Actually, it can sometimes be good to be a rookie when starting on a uni course, because you won't be bringing any bad habits with you.

This guide might come in useful later: http://www.codeproject.com/Articles/22769/Introduction-to-Object-Oriented-Programming-Concep

But first, you will have to learn the basic concepts: how variables and control structures work, and then how to create more complex data structures and some standard algorithms.

For C#, these should get you started:

http://www.slideshare.net/introprogramming/1-introduction-to-programming

http://www.pvtuts.com/csharp/csharp-introduction

I think C# is a good idea for a beginner. In Java, data input/output is a pain. In C++, strings are a pain.

Mind, I haven't used any of these guides myself, I just DuckDuckGo'ed them.

Link to comment
Share on other sites

I see. Thanks for helping me guys. All of your inputs really open up my mind. I got a lot of sources to look up now. I've taken some notes on a few tutorials and there are a few books in my University store to check out on the topics too. I should be able to help you guys in no time.

I'm excited. :)

Since I am a student, I am lucky to have access to Microsoft Visual Studio for free. Oh yeah! :P

Edited by David_J_Rogers
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...