Talk:Define a primitive data type: Difference between revisions

From Rosetta Code
Content added Content deleted
(java is marked incorrect. thinking about it)
 
(My 0.02 EUR)
Line 1: Line 1:
Couldn't a class be considered ''primitive'' type (?) in Java? Or anyway, for languages like Java (Python could be another one?) the only (at least I can't see another one) way of defining a "data types" with an "active behaviour" (data+code...) is to "encapsulate" the whole stuff into a class... --[[User:ShinTakezou|ShinTakezou]] 16:32, 1 March 2009 (UTC)
Couldn't a class be considered ''primitive'' type (?) in Java? Or anyway, for languages like Java (Python could be another one?) the only (at least I can't see another one) way of defining a "data types" with an "active behaviour" (data+code...) is to "encapsulate" the whole stuff into a class... --[[User:ShinTakezou|ShinTakezou]] 16:32, 1 March 2009 (UTC)

:I guess the intention was something like "built-in scalar type." I think the difference lies between a type, which operations are defined by a single (primitive?) types algebra construct like '''int T''' in C++, and a full-blown user-defined type produced by another types algebra construct like '''class T {}''' of same C++. Personally, I don't see any great difference between them, but the task creator probably did. He could also add a pile of secondary thoughts about value vs. reference semantics of "primitive" and "non-primitive" types, he probably had (which, to me, would have no sense at all). My 2¢. --[[User:Dmitry-kazakov|Dmitry-kazakov]] 17:29, 1 March 2009 (UTC)

Revision as of 17:29, 1 March 2009

Couldn't a class be considered primitive type (?) in Java? Or anyway, for languages like Java (Python could be another one?) the only (at least I can't see another one) way of defining a "data types" with an "active behaviour" (data+code...) is to "encapsulate" the whole stuff into a class... --ShinTakezou 16:32, 1 March 2009 (UTC)

I guess the intention was something like "built-in scalar type." I think the difference lies between a type, which operations are defined by a single (primitive?) types algebra construct like int T in C++, and a full-blown user-defined type produced by another types algebra construct like class T {} of same C++. Personally, I don't see any great difference between them, but the task creator probably did. He could also add a pile of secondary thoughts about value vs. reference semantics of "primitive" and "non-primitive" types, he probably had (which, to me, would have no sense at all). My 2¢. --Dmitry-kazakov 17:29, 1 March 2009 (UTC)