Thread: What are pointers for?

  1. #31
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Are you trying to troll with the HTML comment? Collect all programming languages (and no, HTML isn't one) and you'll see that abstraction in all of them forms a smooth spectrum, with assembly on one end and functional languages on the other. Each goal has an optimal abstraction level (if it's small enough, if it's larger you need to break it down to subgoals) and you'd best use the language that is closest to this abstraction level. Obviously you're not going to implement a JVM in Java.
    But you're using libraries in C, are you not? You're using the stdio library, because it does complex and OS-specific tasks such as writing data to the console for you. Think of the JVM as that: a library. A big library, written in C(++?), only that you write the code with a slightly different syntax.

    I'd love to see some of those first year students have a look at the JVM and the ubelievable usage of pointers its said to make use of.
    To what effect? The people who wrote the JVM had years of programming experience. What could any first-year CS student do with their code?

    Have you looked at JAVA 5?
    I have. What's your point?

    Java is good for what it is, a dumbdowned version for RAD.
    Java is good for what it is, which is not what you say it is. So is every language, or nearly so. Languages are written with a purpose, and since there are many purposes there are many languages that fit the purpose.

    How did we end up talking about Java anyway? We were talking about different aspects of C++.

    C++ is no exception - regardless of of the extra libraries and data structures B.S. used to make it "simplier".
    No, it's used to make it more abstract. Believe it or not, there's a difference.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  2. #32
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by caroundw5h
    The point is C (and more importantly the understanding of pointers in C) gives you unbelievable power and advantage when coding.
    In C, there are no alternatives to learning pointers in the beginning. When learning C, you should learn pointers as fast as possible.
    That is the reason pointers are generally taught so early in C++. C++ books begin by teaching the whole C language (replacing printf with cout) and then moving on to C++-specific stuff.

    Note that I'm not saying that pointers are hard to learn or anything. They are extremly simple, you just have to get the syntactic weirdness for declaring, dereferencing and taking the address of an object.
    It just better to learn to use STL before learning pointers.
    Quote Originally Posted by caroundw5h
    C++ is no exception - regardless of of the extra libraries and data structures B.S. used to make it "simplier".
    When you make statements like this, I'm beginning to doubt you know C++ that well.
    I'd love to see some of those first year students have a look at the JVM and the ubelievable usage of pointers its said to make use of.
    You are using pointers much more in Java than in both C and C++. References in Java are equivalent to pointers, except that you cannot use pointer arithmetics like + and -.
    To say Java is simpler because it lacks pointers is plain wrong. Java is simpler for other reasons, but if you don't understand pointers, you should try C++ instead.
    Last edited by Sang-drax; 10-14-2004 at 04:08 PM.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #33
    Registered User
    Join Date
    Oct 2004
    Posts
    30
    pointers are important and only when u get involved in programming with different approaches for the same problem you will come to know of the difference between the approaches.....
    all the guys out there...i suppose i am right.........
    Syra
    Amateur's urge to master C/C++

  4. #34
    Teenage Mutant Ninja Nerd MMD_Lynx's Avatar
    Join Date
    Aug 2004
    Posts
    65
    do we have *two* discussions/arguments about pointers and references? check the other one...and u'll see that people think it's funny that we have two posts on pointers going on....
    Stupid people are useful. You can make them do all the mindless tasks you are too lazy to do yourself.

    Sphynx cats are just bald and wrinkly, like old people, and we don't reject them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using pointers to pointers
    By steve1_rm in forum C Programming
    Replies: 18
    Last Post: 05-29-2008, 05:59 AM
  2. function pointers
    By benhaldor in forum C Programming
    Replies: 4
    Last Post: 08-19-2007, 10:56 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 01:18 PM