Thread: From C to Java

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Many members tend to joke about pointers in Java are called references (in other words, the pointers are the references)
    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.

  2. #17
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    API
    Framework
    Wrapper
    Library

    The terminology becomes vaguer by the day.

    I wouldn't call a C++ library that merely wraps C functions an API, but that's just me. When you think about it, it's mostly just abstraction and you can choose where to draw the line. I draw the line when the code base is less written in the native language, mostly external calls.

    Boost library, might have certain pure-C++ libraries that would be worthy of the title API.

    They could have written all those C API's in pure C++, so they'd be C++ API's, but for C compatibility reasons that's not the case. They are C API's available in C/C++, not C++ API's only available in C++.

    At the same time I tend to think of API's being the lowest level interface, interacting with an unavailable feature such as communication with hardware (opengl) or operating system (win32) in it's native language (C).

    Frameworks/wrappers being the one's that simplify (eg abstract) those API's.

    Libraries being a collection of frameworks/wrappers.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    According to wikipedia, the definitions are as follows:
    Framework:
    A software framework, in computer programming, is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality.

    Frameworks are similar to software libraries in that they are reuseable abstractions of code wrapped in a well-defined API. Unlike libraries, however, the overall program's flow of control is not dictated by the caller, but by the framework. This inversion of control is the distinguishing feature of software frameworks.
    MFC fits in this category.

    Library:
    In computer science, a library is a collection of subroutines or classes used to develop software. Libraries contain code and data that provide services to independent programs. This allows code and data to be shared and changed in a modular fashion. Some executables are both standalone programs and libraries, but most libraries are not executables. Executables and libraries make references known as links to each other through the process known as linking, which is typically done by a linker.

    Most modern operating systems (OS) provide libraries that implement the majority of system services. Such libraries have commoditized the services a modern application expects an OS to provide. As such, most code used by modern applications is provided in these libraries.
    Thus a library would be the file(s) in which the code is stored, framework or API or wrapper.

    API:
    An application programming interface (API) is a set of functions, procedures, methods or classes that an operating system, library or service provides to support requests made by computer programs.[1]

    * Language-dependent APIs are available only in a particular programming language. They utilize the syntax and elements of the programming language to make the API convenient to use in this particular context.

    * Language-independent APIs are written in a way that means they can be called from several programming languages. This is a desired feature for a service-style API which is not bound to a particular process or system and is available as a remote procedure call.
    dotNet would fit in this category. But it is language-independent and not C++ api.

    Unfortunately, wikipedia provided no good definitions of wrappers.
    Last edited by Elysia; 11-01-2008 at 11:25 AM.
    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.

  4. #19
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    I've read the definitions. I'm sure people who disagree with you have as well. I don't disagree. I do notice that they become skewed and mix matched often, according to my own perception. It's all perception. Well, not all, but a little.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Well, all I am implying that when I say there are no C++ apis, these are the definitions I go by, like it or not
    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.

  6. #21
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Quote Originally Posted by Elysia View Post
    Well, all I am implying that when I say there are no C++ apis, these are the definitions I go by, like it or not
    Right, but what I'm saying is how you understand what those definitions mean will not be the same as the person beside you.

    Well, it is called the .NET Framework, so there you go. Language-independant library more like it.

    Can you name one language-independant API? That seems like a tough feat by those definitions. Seems like by the time they become language-independant, they are frameworks for existing language-dependant API's, and thus are called language-independant frameworks or libraries. Some type of DLL library that doesn't wrap could be a language-independant API perhaps? Technically not language-dependant, and still forms the core features, if you can call it the procedures from C, C++, C#, python, etc.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  7. #22
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Dae View Post
    Right, but what I'm saying is how you understand what those definitions mean will not be the same as the person beside you.
    Yeah, I got it. You kindly pointed that out with your previous reply...

    Well, it is called the .NET Framework, so there you go. Language-independent library more like it.
    Well, now that I think of it - seeing as it runs within a managed environment, framework would probably be a better definition for it, yes.
    But a library is the actual file where the code is stored.
    It is subjective, but I would call it a framework, then.

    Can you name one language-independant API? That seems like a tough feat by those definitions. Seems like by the time they become language-independant, they are frameworks for existing language-dependant API's, and thus are called language-independant frameworks or libraries. Some type of DLL library that doesn't wrap could be a language-independant API perhaps? Technically not language-dependant, and still forms the core features, if you can call it the procedures from C, C++, C#, python, etc.
    Nope, this I cannot, seeing as I know very few APIs in general.
    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.

  8. #23
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by transgalactic2 View Post
    java unlike C is an object oriented language

    and there is no pointers in JAVA
    Well if that were true, then why do they call this a NullPointerException?

    I guess from a literal standpoint, Java references aren't actually pointers, since you can't treat them at memory addresses, but they aren't real references either. They're some weird thing in between pointers & references.

    As for this API debate... The term API simply stands for Application Programming Interface, so just about anything that you would normally put in a header file would qualify as an API. A function or class definition is an API -- period. So the MFC header files are API's for the MFC library (i.e. the .lib & .dll files).
    Last edited by cpjust; 11-01-2008 at 04:39 PM.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  9. #24
    Registered User
    Join Date
    Oct 2008
    Posts
    12
    java sucks i ll study after C >> C++>>asm >> maybe mysql oracle after that

  10. #25
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Quote Originally Posted by genie View Post
    java sucks i ll study after C >> C++>>asm >> maybe mysql oracle after that
    Java was the .NET of yester-year. And to be honest, I trust the JavaVM more than I trust the .NET framework.

    Anyway, it serves its purpose well. So no need to hate on Java.

  11. #26
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Java does not suck. It is in-fact very nice, you'll have no problem picking up Java if you know C.

    The main differences are;
    * Exception handling
    * Weird for-loop syntax is possible (like for-each)
    * OO

    I'd say they're references, not pointers. For one there is no pointer arithmetic, although the developers of Java use the pointer/reference term interchangeably.

    > And to be honest, I trust the JavaVM more than I trust the .NET framework.
    So do I, not to mention the VM is portable

    Oh and learning "asm" doesn't make you a hard-core hacker. At least it certainly doesn't get you the chicks.

  12. #27
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Quote Originally Posted by zacs7 View Post
    Oh and learning "asm" doesn't make you a hard-core hacker. At least it certainly doesn't get you the chicks.
    I believe the OP wanted to be a h4x0r, and obviously when you are a h4x0r you do have a lot of social deficiencies.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C#, Java, C++
    By incognito in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 10-05-2004, 02:06 PM
  2. First Java Class at college
    By GanglyLamb in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 09-29-2004, 10:38 PM
  3. The Java language is being expanded
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 06-11-2004, 09:07 PM
  4. Java woes
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 07-06-2003, 12:37 AM
  5. C or Java as a first language
    By CorJava in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 10-23-2002, 05:12 PM