1. Post #1
    Tautika's Avatar
    January 2010
    143 Posts
    Ok so I have a question for you guys. Next year I'll be attending university and following Computer Science. I'm really excited, even more since I started lurking this forum (specifically WAYWO, it's awesome) so I wanted to start doing programming stuff already. They will be teaching Java next year (at least the first semesters, later on also Pascal and C and some other stuff) So I thought I'd find some nice tutorials and just go with it and get started. (are these any good http://eclipsetutorial.sourceforge.n...beginner.html? Also found 'thenewboston' on youtube, how are those tutorials?)

    Anyway, suddenly I found out about Udacity, so I thought, Awesome! and enrolled right away. But they teach you Python which seems a lot different.
    So my question is, what would be a smart choice? Go with Udacity, follow the Java tutorials or do something completely different?

    I don't really have any previous programming experience, except for some HTML/CSS and Javascript knowledge.

  2. Post #2
    Gold Member
    12voltsdc's Avatar
    June 2011
    1,601 Posts
    I always found Youtube tutorials hard to follow, And hard to keep concentrated when there is so much going on. Try out educator.com, Great website for a small fee, The only downside is they only do a small variety of Languages.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 2 (list)

  3. Post #3
    pkt
    pkt's Avatar
    May 2008
    577 Posts
    I've not much experience but I tried javascript a few time and after messing with python a bit it made more sense. I think it's because I understood more of how to put things together. I'd say for any language look up it's documentation along with tutorials and get familiar with the words that get thrown around and it's syntax and start small and build up from there.

  4. Post #4
    The smart choice would be C - it's easy and very flexible.
    Reply With Quote Edit / Delete Reply Russian Federation Show Events Disagree Disagree x 8Agree Agree x 4 (list)

  5. Post #5
    flayne's Avatar
    January 2011
    1,628 Posts
    I agree, C or C++ is a good language to start. Personally, I would recommend getting a book like C++ for dummies all in one (that is what I read and it worked out really well).
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Disagree Disagree x 7 (list)

  6. Post #6
    I agree, C or C++ is a good language to start. Personally, I would recommend getting a book like C++ for dummies all in one (that is what I read and it worked out really well).
    C++ is very hard thing. Don't even try.
    Reply With Quote Edit / Delete Reply Windows 8 Russian Federation Show Events Dumb Dumb x 14Agree Agree x 1Funny Funny x 1 (list)

  7. Post #7
    Gold Member
    Darwin226's Avatar
    January 2009
    4,126 Posts
    You'll start with Java and then move to pascal? That's bound to kill peoples will to program.
    Reply With Quote Edit / Delete Reply Croatia Show Events Agree Agree x 4 (list)

  8. Post #8
    sim642's Avatar
    July 2010
    1,039 Posts
    C++ is very hard thing. Don't even try.
    I'd consider C harder than C++, because even though C has less features, but it requires much more code to do tasks that C++'s STL already has. In C you can't get around pointers, but in C++ you don't need them most of the time as references are usually enough.
    Reply With Quote Edit / Delete Reply Windows Vista Estonia Show Events Disagree Disagree x 1 (list)

  9. Post #9
    Gold Member
    PvtCupcakes's Avatar
    May 2008
    10,900 Posts
    C++ is a steam piling of garbage.
    The only good thing it does is Strings, and that it (more or less) does C.

    If your'e just going to use C++ to write C, then use the real C.
    If you want something with more features then use Python.
    Reply With Quote Edit / Delete Reply Linux United States Show Events Agree Agree x 5Dumb Dumb x 3Disagree Disagree x 1 (list)

  10. Post #10
    Tautika's Avatar
    January 2010
    143 Posts
    Ok I decided to go along with the Udacity courses, it seems like a good starting point. And I enjoy their way of teaching.
    So C++ seems like a sensible choice to begin with afterwards? But wouldn't it be more difficult to switch to Java later on when I start university, or is their syntax similar?

    You'll start with Java and then move to pascal? That's bound to kill peoples will to program.
    O wait I messed up, they will teach scala, not pascal

    They will use Scala, JavaScript and C in the 3rd and 4th semester to teach more advanced concepts (or something like that), Java in the first 2.

    anyway, thanks for all the feedback.

  11. Post #11
    Gold Member

    March 2005
    3,028 Posts
    C++ is a steam piling of garbage.
    The only good thing it does is Strings, and that it (more or less) does C.

    If your'e just going to use C++ to write C, then use the real C.
    If you want something with more features then use Python.
    I wouldn't say C++ does strings well. It's marginally better than C, but that's only because C is absolute shit for any sort of string manipulation.

    For compiled, statically-typed languages, I think Go is the only one that handles strings well.

  12. Post #12
    T3hGamerDK's Avatar
    January 2011
    2,551 Posts
    I wouldn't say C++ does strings well. It's marginally better than C, but that's only because C is absolute shit for any sort of string manipulation.

    For compiled, statically-typed languages, I think Go is the only one that handles strings well.
    I agree with this. So much, in fact, that I decided to write my own string class instead, utilizing only parts of <cstring>

  13. Post #13
    Eudoxia's Avatar
    July 2009
    6,009 Posts
    D is also a pretty good language.

    C++, I think, is not much more than syntactic abstraction over some common C things. Polymorphism and type polymorphism are basically "Hold this in memory, and whenever it's called, write a new function, replacing these template placeholders for the actual types". But when I need to pick between C and C++, I generally go for C++, but for no real reason other than "strings are marginally easier" and what not.

  14. Post #14
    pkt
    pkt's Avatar
    May 2008
    577 Posts
    This may sound a bit dumb or a more understated thing here but it all kinda depends on a lot of factors. I mean there's like libraries to do just about everything in just about any general programming language from accessing the net to making binary files. You could write in C or something like it if you needed to make drivers and such but for most tasks the language choice isn't always the biggest factor. I code in python and javascript and a little C and C++ but for me it's all like pretty similar at this point. Look up the documentation, learn the syntax, plan out logic, write the code, test for errors and such like that...

  15. Post #15
    Icedshot's Avatar
    April 2010
    2,343 Posts
    D is also a pretty good language.

    C++, I think, is not much more than syntactic abstraction over some common C things. Polymorphism and type polymorphism are basically "Hold this in memory, and whenever it's called, write a new function, replacing these template placeholders for the actual types". But when I need to pick between C and C++, I generally go for C++, but for no real reason other than "strings are marginally easier" and what not.
    I smell a troll, or your post is filled with the most wonderful stupidity i've seen in a while
    Reply With Quote Edit / Delete Reply Windows Vista United Kingdom Show Events Dumb Dumb x 4 (list)

  16. Post #16
    evil-tedoz's Avatar
    October 2007
    129 Posts
    I smell a troll, or your post is filled with the most wonderful stupidity i've seen in a while
    What's up with the random name calling ? Would you explain why you think what he said is stupid ?
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Agree Agree x 1 (list)

  17. Post #17
    Der Führer
    Quark:'s Avatar
    January 2011
    4,083 Posts
    i started with c# - it is awesome and very easy to get started with.
    Reply With Quote Edit / Delete Reply Windows XP Professional x64 United States Show Events Agree Agree x 3 (list)

  18. Post #18
    Icedshot's Avatar
    April 2010
    2,343 Posts
    What's up with the random name calling ? Would you explain why you think what he said is stupid ?
    People tend to say C++ is C with classes to annoy other people. I've seen this person around the programming forums occasionally now, and i find it unlikely that he genuinely thinks that C++ is C with strings. It seems like something deliberately said to incite anger

    I apologise if i'm wrong, but that's my personal take on the situation at the moment
    Reply With Quote Edit / Delete Reply Windows Vista United Kingdom Show Events Dumb Dumb x 1 (list)

  19. Post #19
    Eudoxia's Avatar
    July 2009
    6,009 Posts
    Classes are not a trivial feature to add, I didn't mention them in the other post because, well, I forgot. Then again, classes could be added to C if it had syntactic abstraction capabilities. I mentioned polymorphism being not much more than a syntactic abstraction because, well, it is. Consider.

    template <typename T>
    T from_string(string datum)
    {
      stringstream stream(datum);
      T out;
      stream >> out;
      return out;
    }

    The template function is held in memory until this happens:

    //code
    double tmp = from_string<double>("5.6e-5");
    //some more code
    

    And so the compiler does this:

    double from_string__d(string datum)
    {
      stringstream stream(datum);
      double out;
      stream >> out;
      return out;
    }
    
    //code
    double tmp = from_string__d("5.6e-5");
    //some more code
    

    C++ also has a lot of incredibly useful features (The STL, basically) that on C would have to be implemented using unsafe void pointers and what not. Really, though, my opinion is not that C++ is "just" C with classes, but that these languages are too limited by their syntax. If they'd been designed with extensibility in mind, you'd have a more powerful macro system, or the possibility of writing specialized "source transformation functions" that the compiler would compile first then load into memory to transform the rest of the source code -- Basically Lisp macros, making the language as extensible as Lisp. Then it would be trivial to write macros for object orientation, polymorphism, etc. since entirely new programming paradigms would be just another library to load.

    If C had had those features, or if someone had designed a compiler that supported them, then it would not have taken ten years to go from C to C++; C++ would be a library of these "source transformation functions" that could be imported into a program and would do, for example, what I showed above with polymorphism.
    Reply With Quote Edit / Delete Reply Windows 7 Uruguay Show Events Friendly Friendly x 1 (list)

  20. Post #20
    T3hGamerDK's Avatar
    January 2011
    2,551 Posts
    What you mentioned, Eudoxia, is actually QUITE a good idea for a programming language. If such a language does not already exist?

  21. Post #21
    Gold Member

    March 2005
    3,028 Posts
    Are you guys talking about metaprogramming?
    Doesn't D have this?

  22. Post #22
    Eudoxia's Avatar
    July 2009
    6,009 Posts
    What you mentioned, Eudoxia, is actually QUITE a good idea for a programming language. If such a language does not already exist?
    The language I'm working on would support those, but other than that I don't know. Besides the Common Lisp implementations I don't know of any other JIT compiled language that does this.

    Edited:

    Are you guys talking about metaprogramming?
    Doesn't D have this?
    Metaprogramming is kind of a vague term. Different languages support metaprogramming to different degrees.

  23. Post #23
    zzzz's Avatar
    October 2011
    1,747 Posts
    Is it possible to do a figure it out as you go along sort of thing with a language? Because reading books about all of the different terms and things used in programming without any exercises wherein programs are actually made annoys me a lot. I just want to figure out the language by making things, similar to how you can learn a spoken language by actually going to a country and being around people that speak the language instead of just reading a texbook about grammar

  24. Post #24
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    Is it possible to do a figure it out as you go along sort of thing with a language? Because reading books about all of the different terms and things used in programming without any exercises wherein programs are actually made annoys me a lot. I just want to figure out the language by making things, similar to how you can learn a spoken language by actually going to a country and being around people that speak the language instead of just reading a texbook about grammar
    "Today I want to make a tic-tac-toe game"

    It'll be a lot harder and you'll probably be relying on Google A LOT at the beginning, but if you have enough determination you'll be able to finish these small projects and start new ones. Part of learning this stuff is knowing that it's okay to fail multiple times before you arrive at the right answer. You'll be learning either way as long as you analyze your failures to see how and where you messed up.

  25. Post #25
    zzzz's Avatar
    October 2011
    1,747 Posts
    I just literally have no idea where to start

  26. Post #26
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    I just literally have no idea where to start
    Start by splitting up a large task into smaller tasks that are easier to achieve. Eventually you'll get to a point where you can turn those tasks into code. Going off the tic-tac-toe example:

    You can turn "I need to make a tic-tac-toe game" into:

    -I need a way to store the tiles.
    -I need a way to display the tiles.
    -I need a way for the user to place an X or an O.
    -I need some AI to play against.
    -I need a way to check if someone has won or if it's a tie.

    From there you can break it down into concrete steps needed to make the game:

    -I will store the tiles as a 2d array of ints.
    -I will draw the tiles to the console after every turn
    -I will ask the user for a number 1-9 to place their next turn.
    -I will randomly select an unused tile as AI.
    -I will check all the ways to win after each round.

    From there you should be able to start coding your tic-tac-toe game. And remember that you won't be able to write it all in one go, so you should work in iterations, making sure everything works before you move on to the next iteration. Maybe you'll first start by storing the tiles and letting the user place Xs and Os in any unused tile. Then you might choose to draw the tiles after each round. Then you could add in the AI to replace you playing as both players. After that you can figure out when the game is over.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 1 (list)

  27. Post #27
    Please waste more of your money changing this title again.
    Gmod4ever's Avatar
    August 2005
    6,784 Posts
    I just literally have no idea where to start
    Well, going with the "tic-tac-toe" example, the first thing you should always do when going to make something is plan out what you need.

    In the case of a tic-tac-toe game, you first need some way of keeping track of the individual tiles. You could use a two-dimension, 3x3 array for it, or you can use a one-dimension, 1x9 array, and just keep in mind that 1-3 = first row, 4-6 = second row, 7-9 = third row. Either way works.

    Once you have that array down, you then need to develop a system for putting a cross in a tile, putting a naught in a tile, and then making sure that a cross or naught can't be placed in a tile already occupied.

    Then you need to consider a system for "turn-taking" between two players in some way.

    Once you have all that done, you just need to plan out how you intend to do the graphical user-interface.

    Once you've got it all planned out, you know exactly (read: roughly) what you need to do, and then you can get your nose down in the documentation / tutorials / Google to see what you need to know to get started.

    That's how I would recommend going about it, anyways.

    Edited:

    Start by splitting up a large task into smaller tasks that are easier to achieve. Eventually you'll get to a point where you can turn those tasks into code. Going off the tic-tac-toe example:

    You can turn "I need to make a tic-tac-toe game" into:

    -I need a way to store the tiles.
    -I need a way to display the tiles.
    -I need a way for the user to place an X or an O.
    -I need some AI to play against.
    -I need a way to check if someone has won or if it's a tie.

    From there you can break it down into concrete steps needed to make the game:

    -I will store the tiles as a 2d array of ints.
    -I will draw the tiles to the console after every turn
    -I will ask the user for a number 1-9 to place their next turn.
    -I will randomly select an unused tile as AI.
    -I will check all the ways to win after each round.

    From there you should be able to start coding your tic-tac-toe game. And remember that you won't be able to write it all in one go, so you should work in iterations, making sure everything works before you move on to the next iteration. Maybe you'll first start by storing the tiles and letting the user place Xs and Os in any unused tile. Then you might choose to draw the tiles after each round. Then you could add in the AI to replace you playing as both players. After that you can figure out when the game is over.
    Rated your post funny because I find it humorous that you and I posted almost exactly the same thing, at the same time.

  28. Post #28
    zzzz's Avatar
    October 2011
    1,747 Posts
    I've been trying to figure this whole array thing out and I just have no idea how to do it

    Edited:

    I just don't know what to do, and with absolutely no (memorable) experience whatsoever in this subject, I find it much too difficult to create this tic tac toe game without somebody helping me out

    Even when googling for help, all of the pages are so convoluted and rely on so much other knowledge that I lack, that even using those pages for help is extremely difficult.

  29. Post #29

    April 2012
    30 Posts
    I've been trying to figure this whole array thing out and I just have no idea how to do it

    Edited:

    I just don't know what to do, and with absolutely no (memorable) experience whatsoever in this subject, I find it much too difficult to create this tic tac toe game without somebody helping me out

    Even when googling for help, all of the pages are so convoluted and rely on so much other knowledge that I lack, that even using those pages for help is extremely difficult.
    If you don't know what an array is or what the point of one is, you're at a level where you're trying to learn a language without knowing its alphabet. A variable in programming is like a variable in algebra, except that you typically give them names that are more descriptive than a single character. An array is like a variable with a subscript, or a linear series of variables with one name and an index that ranges from 0 to the element at n-1, where n is total size of the array you've declared. For tic-tac-toe, you could declare 9 different variables to represent the 9 cells of the board, or you could declare a single array with 9 elements to do the same.

    Because there are only 3 possibilities for a cell, you could have 0 represent empty, 1 could represent X, and -1 could represent O. At the start of a game you would initialize all the values of your to start empty. In C/C++, that would look like this:

    int cell[9]
    for (int i=0; i<9; i++)
    {
    cell[i] = 0;
    }


    The first line declares an integer array named 'cell' with 9 elements
    The second line is a 'for' statement. This creates a loop that will run nine times, with integer variable 'i' starting at 0 and increasing by 1 until it reaches 8.
    The next line is a curly bracket which marks the beginning of the loop.
    The fourth line sets one element the array cell to 0.
    The last line marks the end of our loop.

  30. Post #30
    zzzz's Avatar
    October 2011
    1,747 Posts
    Well how do I specify what the program needs to do, then, if a single element of an array is changed? What if I need to specify that if something happens to element 5, for example, that the program is to do something in response (add an x over that element for example)?

    Edited:

    And you're right, I do not know the alphabet. I was going in here hoping someone would recommend me a book for beginners to a language (particularly c#) that would, instead of having lengthy explanations of every aspect of the language, give examples of code and explain each part. That way, instead of memorizing each fact in a detestably boring manner, I would be 'figuring out' the language.

  31. Post #31

    January 2012
    68 Posts
    Well how do I specify what the program needs to do, then, if a single element of an array is changed? What if I need to specify that if something happens to element 5, for example, that the program is to do something in response (add an x over that element for example)?
    When someone play, you will check the array position with an 1 or a -1, IF the position is 0.
    Something like

    i = "position where the player will put a X or O"

    if (cell[i] == 0) {
    cell[i] = 1; // or -1, you will need a functin checking who is the player
    }
    then before every play, you will need to check if someone won the game or if its a draw.

    something like

    if ((cell[1] == cell[2]) && (cell[2] == cell[3])) {
    the winner is the guy who puts his X or O in the cell[1] (or cell[2], cell[3]...
    }
    in the end you will need to check for a DRAW, if all cells are occupied and there is no winner, its a draw.

    int i,flag=0;
    for (i=0;i<9;i++) {
    if (cell[i] == 0) { flag = 1; }
    }
    if (flag==0) { DRAW! }

  32. Post #32

    August 2009
    6 Posts
    C++ is a steam piling of garbage.
    The only good thing it does is Strings, and that it (more or less) does C.

    If your'e just going to use C++ to write C, then use the real C.
    If you want something with more features then use Python.
    I don't even know where to start correcting you.
    Dear God, that hurt to read.

  33. Post #33
    Gold Member
    TrueNash's Avatar
    March 2006
    386 Posts
    I'd always advocate starting with C or Assembly. Believe me when I say, if you're doing a CS degree, starting at a foundation language that forces you to understand what you are actually doing in the process of programming will aid your understanding of the subject enormously.

    The C++ vs. The rest of the programming world clusterfuck could go on indefinitely. C++ is like anything else; it has problems and strengths that charm some people, and repulse others. No need to be aggressive about it, on either side.
    Reply With Quote Edit / Delete Reply Windows 8 United Kingdom Show Events Agree Agree x 1 (list)

  34. Post #34
    Gold Member
    Kirth's Avatar
    July 2009
    429 Posts
    Assembly
    I couldn't agree more. It's véry important to understand how computers work.