General discussion

Locked

COOP sugestion

By Jaqui ·
excerpt from c++ Programming howto from linux documentation project:
( currently under review so not available for download )

1.4 COOP − C++ Object Oriented Programming−language
A problem with C++ is that it is a superset of C, and, although programmers can use the good (object
oriented) features of C++ and avoid the bad features of C, there is nothing to force them to do so. So, many
C++ programs are written with no object oriented features and continue to use the bad features of C that the
use of C++ should have overcome.
Therefore, I propose that we create a new version of C++ that does not allow the use of the bad features of C.
I propose that this new version of C++ be called COOP (say koop), which is an acronym for C++ Object
Oriented Programming−language" . COOP should be pronounced like chicken coop. (The logo of COOP
language is a big fat Hen inside coop!) I propose that the file extension for COOP files be .coo, which will
not conflict with .c for C programs or .cpp for C++ programs.
To begin with, write the COOP as a front end to C++. That is COOP pre−processes the code syntax and then
uses the standard C++ compiler to compile the program. COOP acts as a front end to C++ compiler. (To start
with, COOP will be a very good project/thesis topic for university students)
The following are some other proposed features of COOP:
COOP will borrow some best ideas from Microsoft C#, Microsoft put lot of efforts, and you can
simply utilize them. Specs are at csharp−specs and see C# overview.
?
? Is a subset of C++ language but will force programmer to use obejct oriented programming.
? Pure Object−oriented langauge but retains syntax of C++.
Remove all bad or confusing features of C++ in COOP, for e.g. multiple−inheritance, operator
overloading, limit usage of pointers, etc...
?
Prevent writing "C" like programming in COOP, something which C++ currently allows. Delete all C
features which are considered bad or redundant/duplicates, like printf, fprintf, malloc, struct, free etc..
?
? No downward compatibility to "C" language.
? Code written in COOP will be easy to maintain and is easily understandable/readable.
Code written in "COOP" will be re−usable (thru components, modules, objects). Supports re−usable
software components, thereby facilitating Rapid Application Development.
?
COOP is simple, robust, OOP, has bare mininum syntax (avoiding confusing, redundant, extra
constructs of C++ for e.g remove struct and use class)
?
Also borrow ideas from
? Java − Sun Microsystem put lot of effort, and you can simply utilize that.
? Connective C++ at http://www.quintessent.com/products/cc++.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Operator Overloading

by Tony Hopkinson In reply to COOP sugestion

is a feature I often wished was in delphi. The requirement for it is rare, but it can be very elegant. Couldn't agree more about multiple inheritance though, goes from mildly confusing to abomination in big steps that one.
Always liked Delphi's multiple interface approach on that front.
One thing I've always wanted to see in a language are an overloaded case/switch semantics.
For C proper control structures, no break, continue or goto. None of that macro crap.

The thing I hate most about C though is it's remarkable facility for obfuscation, the one that gave C++ it's name in particular. I see no point whatsoever in making source terse.

Collapse -

well said.

by Jaqui In reply to Operator Overloading

the idea of this is to break from the negative aspects of c, forcing oo prgramming.

most pre-processor directives are macros you know.
like include,
define....
they do have thier uses.

and gods yes, terse source is the bane of readability.
though this can be countered through good commenting to a certain extent, code needs to be readable for bugfix, security fix, or even updating at a later time.
terse code is opaque when doing this, making it more difficult than it needs to be.

Collapse -

Macros such as

by Tony Hopkinson In reply to well said.

if def etc i have no problem with. It's when some herbert gives you some source that completely changes it's function based on the content of a macro, I get upset, because no it's not clever.

As for commenting, why comments I can live with, but writing an english language translation of your source makes me wonder why it wasn't written in english in the first place.

/* Output Period Reports for the items in objlst
DO_RPs4Prd(objlst)
vs

GeneratePeriodReportsFor(InvoiceItemList);
No comment needed and less typing.

As for
int NumberOfInvoices // The Number Of Invoices

That one want me to break people's typing fingers.

Never seen this one done either !
/* Output Period Reports for the items in objlst
DO_RPs4Year(objlst)

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums