473,598 Members | 3,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

generic programming is very powerful. c should support it

i think c should adapt c++ template standard, as well as namespace. if
so, c can replace c++ in many cases.

Jul 26 '06 #1
28 2616

steve yee wrote:
i think c should adapt c++ template standard, as well as namespace. if
so, c can replace c++ in many cases.
I don't get this comment. You want C to become C++ so it could replace
C++? It WOULD BE C++.

What do you like about C that isn't in C++?

Tom

Jul 26 '06 #2
Tom St Denis wrote:
>
What do you like about C that isn't in C++?

Tom
Simplicity.

No automatic constructors, no OO orientation.

C has a lot of advantages.

Jul 26 '06 #3

jacob navia wrote:
Tom St Denis wrote:

What do you like about C that isn't in C++?

Tom

Simplicity.

No automatic constructors, no OO orientation.

C has a lot of advantages.
yes. what i mean is that c can adapt template and namespace from c++,
because it's very useful and does not hurt the simplicity of c. this
will not make c become c++, because there's much more than generic and
namespace in c++'s feature.

Jul 26 '06 #4

steve yee wrote:
jacob navia wrote:
Tom St Denis wrote:
>
What do you like about C that isn't in C++?
>
Tom
>
Simplicity.

No automatic constructors, no OO orientation.

C has a lot of advantages.

yes. what i mean is that c can adapt template and namespace from c++,
because it's very useful and does not hurt the simplicity of c. this
will not make c become c++, because there's much more than generic and
namespace in c++'s feature.
Adding a turing complete sub-language won't hurt the simplicity of C?

Jul 26 '06 #5
steve yee <yi******@gmail .comwrote:
i think c should adapt c++ template standard, as well as namespace. if
How do you propose to make use of templates without introducing the
notion of a class?

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gma il.com | don't, I need to know. Flames welcome.
Jul 26 '06 #6
On Wed, 26 Jul 2006, steve yee wrote:
>
jacob navia wrote:
>Tom St Denis wrote:
>>>
What do you like about C that isn't in C++?

Tom

Simplicity.

No automatic constructors, no OO orientation.

C has a lot of advantages.

yes. what i mean is that c can adapt template and namespace from c++,
because it's very useful and does not hurt the simplicity of c. this
will not make c become c++, because there's much more than generic and
namespace in c++'s feature.
I don't get it. If you want templates and namespaces, why don't you use a
subset of C++ (namely, C++ without the OO approach) ? It'd be some kind of
subset of C with additional things (such as ... templates and namespaces
for instance).

--
"Je deteste les ordinateurs : ils font toujours ce que je dis, jamais
ce que je veux !"
"The obvious mathematical breakthrough would be development of an easy way
to factor large prime numbers." (Bill Gates, The Road Ahead)
Jul 26 '06 #7

Christopher Benson-Manica wrote:
steve yee <yi******@gmail .comwrote:
i think c should adapt c++ template standard, as well as namespace. if

How do you propose to make use of templates without introducing the
notion of a class?
Templates aren't restricted to classes, though their usefulness
decreases considerably when all you have are function templates. In
theory, you could apply a template to a structure, though that strikes
me as awkward in the absence of member functions. Of course, there are
times when I've yearned for member functions in C. Maybe the OP is
looking for a watered down class concept too. ;-)
--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gma il.com | don't, I need to know. Flames welcome.
Jul 26 '06 #8
steve yee schrieb:
i think c should adapt c++ template standard, as well as namespace. if
so, c can replace c++ in many cases.
There is no function overloading in C. C++ templates without that would
not be useful.

Why don't you just use C++, since C++ has adopted most of the standard
library of C?

--
Thomas
Jul 26 '06 #9


steve yee wrote On 07/26/06 09:01,:
i think c should adapt c++ template standard, as well as namespace. if
so, c can replace c++ in many cases.
Make a formal proposal to the Committee. Be sure to
let us know how you get on with them, will you? 'bye, now!

--
Er*********@sun .com

Jul 26 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2886
by: Jim Newton | last post by:
hi all, i'm relatively new to python. I find it a pretty interesting language but also somewhat limiting compared to lisp. I notice that the language does provide a few lispy type nicities, but some very important ones seem to be missing. E.g., the multiple class inheritance is great, but there are no generic functions (at least that i can find). If i have classes X, Y, and Z, and subclasses X_sub, Y_sub, and Z_sub respectively.
49
2862
by: Steven Bethard | last post by:
I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another class). Any comments would be appreciated! Thanks! Steve ----------------------------------------------------------------------
6
2238
by: gong | last post by:
hi i recently looked at alexandrescu's book on c++, and i found it pretty much unintelligible. i have a few points which i wonder about. 1. as a developer, it is important, from a bottom line standpoint, to make code as transparent as possible. through its lifecycle, code inevitably becomes larger and more complex to cope with unexpected demands. if the starting point looks like alexandrescu's code, it will require very specialized...
4
1544
by: PDHB | last post by:
I'm sorry, but this is just the height of stupidity. I love the dot net framework. It has actually been sufficient to convert an anti-microsoft extremist (myself) to the windows camp. But not having numerical value types inherit from an interface to allow for arithmetic in generics, or in some other way allow arithmetic in generics without a performance killing or ugly work around is just the epitomy of idiocy. Yes, microsoft today is...
13
1238
by: master_programmer | last post by:
Advice to new programmers considering ASP.NET...... Dont do it !! I was forced to use the Visual Studio to make ASP.NET applications. It is very very slow. You are better off forgetting the idea and use a different programming language instead of IIS. I recommend trying a more powerful solution, give Cold Fusion a go, its free and you can compile the Cold Fusion code into applications that
14
4099
by: James Wong | last post by:
Hi everybody, I'm facing a serious trouble relating to GDI+ generic error. The error message is "A Generic error occured in GDI+" and the following information is stored in Excepton object: System.Drawing.Graphics.CheckErrorStatus(Int32 status) System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format) System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, PointF...
10
1922
by: Egghead | last post by:
Hi all, Can someone kindly enough point me to some situations that we shall or "must" use Generic Class? I can foresee the Generic Method is powerful, but I can not find a single situation that I will need the Generic Class, given there are so many other options. -- cheers,
15
7080
by: Anthony Paul | last post by:
Let's say that I would like a generic type that supports Min/Max properties and can be double or integer or even datetime if need be, something flexible. So I go about creating the following generic interface : *note : in reality I implement the IComparable and IEquatable generic interfaces and associated overriden methods, but I've cut everything down to the bare minimum for this example.
2
2128
by: jehugaleahsa | last post by:
Hello: I was reading another post and saw an argument (sort of) that brought up a good question. I have written a fairly large library of algorithms that occur in programming all the time. It mixes the C++ STL and the Power Collections Algorithms class. Recently a coworker of mine asked me what the deal was with anonymous
0
7899
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8392
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8050
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8264
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6718
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5850
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3897
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.