Thread: About time Java gave in...

  1. #16
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by whiteflags View Post
    C does give you a reason to actually implement the data structures though.
    C may give you a reason to do it - because it doesn't include an implementation by default. But that doesn't mean it's the ideal language to use when learning these things. The same algorithms and data structures can be implemented using modern C++, which can be far more intuitive for new programmers.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by whiteflags View Post
    What is computer science other than this? I'm sorry but every foray into the computer science department for me was basically learning how to program.

    C does give you a reason to actually implement the data structures though. You might actually learn how they work and use them appropriately in other places, in other languages. Data structures might be language agnostic, but people sure aren't. In C++ for instance the wonder is always "why aren't you using the STL?" Personally I don't think people understand anything until they study it inside and out.
    Experience (from what I've gathered from people who teach C++; source: Cppcon) has shown that people tend to struggle less if you let them believe data structures are magical when you do intro into programming. When you've taught students the basics, THEN and only then should you venture into details. It means less scratching heads, better learning experience, students generally more happy and less giving up because it's too hard.

    The idea is teach 'em the basics first, then teach 'em the details in the more advanced follow-up courses. C can't do that because it forces you to focus on the details first because you have to explain pointers, how to implement and use a linked list, why we null-terminate strings and how we need to allocate space for strings, etc, etc. In modern languages such as Java or C# or C++, this is all done for you. It's magical. You don't need to learn the details until later when you're more ready for them. And that's why I disagree C is a good introductory language.

    If you want to learn C, do it as an advanced course, not an introductory one.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Adding a little to the discussion -- I agree with using higher-level languages first, but only if the implications of using the cookie-cutter data structures are explained. Example: you can be super inefficient if you use lists and don't know the complexity/big O time for the different operations. You don't want to learn the wrong way and then learn later when you learn C that the way you've been doing it all along is super inefficient. That's what I did by learning Lisp first....

  4. #19
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    You guys make good points

  5. #20
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I don't consider C++ and C much different in their ability to expose the type of fundamental knowledge required to make a good degree in CS. In a tutoring environment, the STL can be completely ignored and the only thing distinguishing both languages will be their semantics. I would place both C++ and C and equally valuable tools for learning programming. Except...

    Code:
    char *str = "A string.";
    C may have an edge over C++ because it more quickly and easily exposes the architectural weakness of our computers. Weaknesses that we must learn to live with. Dangerous stuff like the fragment above, open up many opportunities for a deeper understanding of how our computer languages work (*). But C++ isn't far behind.

    In addition, what makes me think that I would prefer a CS course based on C is the simplicity of the language, that allows for a larger part of the learning to be focused on the scientific aspect of programming which is the core of a CS course, rather than the engineering aspect which is represented by programming languages and their specifications. C is just easier to learn and understand. The language quickly gets off the way. It is however, like C++, an hard language to master. But that concerns only the task of coding functional and well-formed programs. Which is, generally speaking, not of interest to a CS course.

    ---
    (*) to clarify, code like the above better represent the price we pay for abstraction. It's not really teaching us about how our computers work, but why higher level computer languages come with a cost. That cost is however not a failure of the computer language, but a result of weaknesses in computer architecture that force the hand of the creators of computer languages.
    Last edited by Mario F.; 10-07-2016 at 05:29 AM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 03-08-2012, 06:12 PM
  2. my teacher gave it to us....
    By jacek in forum C Programming
    Replies: 3
    Last Post: 01-11-2010, 12:17 PM
  3. Java for real-time applications
    By zacs7 in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 08-26-2008, 06:34 AM
  4. gave it shot...it gave me an error!
    By LonelyPlanderWa in forum C Programming
    Replies: 3
    Last Post: 07-12-2002, 01:26 AM
  5. Please Heelp me ... I gave up
    By NANO in forum C++ Programming
    Replies: 14
    Last Post: 04-21-2002, 08:14 PM

Tags for this Thread