Timeline for Does Java promote a separation between class definitions and implementations, as is C++?
Current License: CC BY-SA 4.0
23 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Aug 22, 2023 at 7:29 | history | suggested | Chukwujiobi Canon | CC BY-SA 4.0 |
Semantics corrected
|
Jul 24, 2023 at 16:25 | review | Suggested edits | |||
S Aug 22, 2023 at 7:29 | |||||
May 23, 2017 at 12:40 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Jan 23, 2012 at 5:56 | history | edited | yannis | CC BY-SA 3.0 |
homework tag cleanup
|
Nov 9, 2011 at 17:14 | vote | accept | Etienne Noël | ||
Nov 9, 2011 at 9:26 | answer | added | Sean | timeline score: 0 | |
Nov 9, 2011 at 9:01 | answer | added | DeadMG | timeline score: 6 | |
Nov 9, 2011 at 8:54 | answer | added | dan04 | timeline score: 14 | |
Nov 8, 2011 at 18:42 | answer | added | Chuck Adams | timeline score: 3 | |
Nov 8, 2011 at 18:25 | history | edited | Thomas Owens♦ | CC BY-SA 3.0 |
added 25 characters in body; edited tags
|
Nov 8, 2011 at 18:04 | answer | added | Peter Lawrey | timeline score: 7 | |
Nov 8, 2011 at 17:40 | comment | added | user7043 | @dan04: Yes, of course. That comment was entirely under the assumption of a primitive one-pass compiler and the limited (language-agnostic) object file formats C nigh-universally compiles to. | |
Nov 8, 2011 at 17:37 | comment | added | dan04 | @delnan: You don't need headers for separate compilation if you store the relevant type information in the object file format. Java does this with its *.class files. Turbo Pascal 4 did it with its *.tpu files. | |
Nov 8, 2011 at 17:31 | comment | added | David Thornley |
Also, C++ header files expose considerably more implementation than I like, unless you use the PIMPL idiom. It's necessary to list all the data members, even if private , so the implementation will know the size, and the private member functions also.
|
|
Nov 8, 2011 at 17:22 | comment | added | FrustratedWithFormsDesigner | Java can have Interfaces which can separate class definition and class implementation, if the class in question implements the interface. Not quite the same as C++ though. | |
Nov 8, 2011 at 17:16 | comment | added | Etienne Noël | @delnan I see now why you guys don't want "which is better stuff " :P | |
Nov 8, 2011 at 17:15 | comment | added | user7043 |
@Channel72: No, you only need headers if you care for seperate compilation. But as #include ing the implementation makes compile times explode for larger projects, it's frowned up. And independently, some people decided at some point (I doubt this was the initial reason for the seperation) that physically seperating interface and implementation was good style.
|
|
Nov 8, 2011 at 17:12 | history | edited | Etienne Noël | CC BY-SA 3.0 |
deleted 206 characters in body
|
Nov 8, 2011 at 17:11 | comment | added | Channel72 | C (and by extension C++) really had no choice but to separate the header files from the implementation files, due to the limited one-pass compiler technology at the time C was created. | |
Nov 8, 2011 at 17:11 | comment | added | Etienne Noël | oops, the link didn't work. I'll reformulate, what I wanted to know basically, is the differences between both of them and which one tends to be more easy to reuse the code or for extensibility. | |
Nov 8, 2011 at 17:09 | comment | added | user7043 | If you want to ask "Why doesn't Java use header files", then just ask that and do away with the "which is better" stuff - as you've seen, we're allergic to that ;) Also search, I'm pretty certain this (or at least closely related questions) have been brought up before. | |
Nov 8, 2011 at 17:08 | history | edited | Eric Wilson | CC BY-SA 3.0 |
JAVA to Java
|
Nov 8, 2011 at 17:05 | history | asked | Etienne Noël | CC BY-SA 3.0 |