473,654 Members | 3,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C is too old? opinions?

Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...

The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

Something like:

a_source_file.c :

namespace SomeName(.SomeN ame)
{
area Stack
{
private int[] myStack;

private void someMethod() {};

public void push(int i) {};
public int pop() {};
}
}

another_source_ file.c:

using SomeName(.SomeN ame);

int main(int argc, char[] *argv)
{
Stack.push(10);
System.printf(S tack.pop());
}

I'm really annoyed ;) Is im the only own with that point of view?

If i was a really good programmer (which i'm not... yet! ;)) i would
developed a compiler and a much more simple (but still impressive and
powerfull) c...

Best and kindest regards
Lasse Espeholt

Jul 12 '06
187 6442
On 2006-07-12 23:44:20 +0200, Ben Pfaff <bl*@cs.stanfor d.edusaid:
Lasse Espeholt writes:
>On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanfor d.edusaid:
>>Lasse Espeholt writes:

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I don't think there is a practical way to write large C or C++
programs without using header files. If you want to avoid header
files entirely, you'll need to move to something like C# or Java.
If C# can, C also can ;).... i can't see any problems ?

Jul 12 '06 #11
On 2006-07-12 23:48:41 +0200, Andrew Poelstra <ap*******@nowh ereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...

Nah; in fact, a new standard was released around 1999, and it still
isn't implemented widely because the features from 1989 are still
perfectly useful today!
>The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.

C++ has namespaces. You could try over there.
>Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

If you qualify a function with `static', it isn't visible outside
of the file that it is defined in.
>>
I'm really annoyed ;) Is im the only own with that point of view?

Around here, probably. :-)
>If i was a really good programmer (which i'm not... yet! ;)) i would
developed a compiler and a much more simple (but still impressive and
powerfull) c...

There was a guy who did that... Bjarne Strousup, they called him.
(Although `they' knew how to spell his name properly.)
yeah.... Bjarne Stroustrup is from my planet (Denmark, NOT the swedish
capital) ;)

hhm... i'm sadly the only one whom does not like C structure very much :D

Jul 12 '06 #12
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:44:41 +0200, Andrew Poelstra <ap*******@nowh ereat.allsaid:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanfor d.edusaid:

Lasse Espeholt writes:

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I'm not sure what you mean by that. No, you shouldn't eliminate header
files. C++ has what you want with namespaces. What is "still recommended,
right"?

I thought that header issen't nessesary in c++ but recommended, but i'm
not a c++ developer so...
Headers aren't technically necessary in C, either... it's still a
terrible idea to try and get along without them.

--
Andrew Poelstra <http://www.wpsoftware. net/projects/>
To email me, use "apoelstra" at the above domain.
"You people hate mathematics." -- James Harris
Jul 12 '06 #13
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:44:20 +0200, Ben Pfaff <bl*@cs.stanfor d.edusaid:
>Lasse Espeholt writes:
>>On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanfor d.edusaid:

Lasse Espeholt writes:

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I don't think there is a practical way to write large C or C++
programs without using header files. If you want to avoid header
files entirely, you'll need to move to something like C# or Java.

If C# can, C also can ;).... i can't see any problems ?
Untrue. Think carefully about that statement, and consider why C and
C# are different languages.

--
Andrew Poelstra <http://www.wpsoftware. net/projects/>
To email me, use "apoelstra" at the above domain.
"You people hate mathematics." -- James Harris
Jul 12 '06 #14
On 2006-07-12 23:59:02 +0200, Andrew Poelstra <ap*******@nowh ereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>On 2006-07-12 23:44:20 +0200, Ben Pfaff <bl*@cs.stanfor d.edusaid:
>>Lasse Espeholt writes:

On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanfor d.edusaid:

Lasse Espeholt writes:
>
>Why has C not namespaces and a "area idea" where some methods and
>fields could be hidden from the outside?
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I don't think there is a practical way to write large C or C++
programs without using header files. If you want to avoid header
files entirely, you'll need to move to something like C# or Java.

If C# can, C also can ;).... i can't see any problems ?

Untrue. Think carefully about that statement, and consider why C and
C# are different languages.
I know why they are different, but in this case it is true

Jul 12 '06 #15
On 2006-07-12 23:52:55 +0200, Richard Heathfield
<in*****@invali d.invalidsaid:
Lasse Espeholt said:

<snip>
>I'm looking for the simplicity of c# without objects ;)

Then C is the wrong place to look. C has objects. So does C++, so it's
no good looking there, either.
Object-orientated, classes then....

Jul 12 '06 #16
On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowh ereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>On 2006-07-12 23:44:41 +0200, Andrew Poelstra <ap*******@nowh ereat.allsaid:
>>On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanfor d.edusaid:

Lasse Espeholt writes:
>
>Why has C not namespaces and a "area idea" where some methods and
>fields could be hidden from the outside?
>
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?
I'm not sure what you mean by that. No, you shouldn't eliminate header
files. C++ has what you want with namespaces. What is "still recommended,
right"?

I thought that header issen't nessesary in c++ but recommended, but i'm
not a c++ developer so...

Headers aren't technically necessary in C, either... it's still a
terrible idea to try and get along without them.
I think its workds great in other languages...?

Jul 12 '06 #17
On 2006-07-12 23:52:12 +0200, Richard Heathfield
<in*****@invali d.invalidsaid:
Lasse Espeholt said:
>Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...

Fine, so don't use it. Nobody is forcing you to.
>The idea with header/source files where methods can clash into
eachother i don't like...

Since C doesn't have methods, the problem doesn't arise.
>Look at C# which is much cleaner with namespaces.

No thanks.
>Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

Because the language definition doesn't say it has.

<snip>
>If i was a really good programmer (which i'm not... yet! ;)) i would
developed a compiler and a much more simple (but still impressive and
powerfull) c...

Nobody is stopping you.
nobody forcing me - no, but in some cases C is a wonderfull
language.... don't get me wrong... i don't hate the language... it is
infact one of my favourites but i think some things could be done
better... i think it has some things there issent nessesary in modern
languages... for example header files...

hhm... it is correct that nobody is stopping me, but i stops myself...
I'm not good enogh....

best regards

Jul 12 '06 #18
Lasse Espeholt wrote:
Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...
What you think is largely irrelevant. C isn't going anywhere, and is
still the language of choice for many applications.
The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.
Gawd. If you must have that, C++ is a far better idea.

Brian
Jul 12 '06 #19
On 2006-07-13 00:19:03 +0200, Ian Collins <ia******@hotma il.comsaid:
Lasse Espeholt wrote:
>On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowh ereat.all>
said:
>>>
Headers aren't technically necessary in C, either... it's still a
terrible idea to try and get along without them.


I think its workds great in other languages...?
They have rules to enforce application layout and/or complex object
names that include a search path. What would you rather have:

path.to.some.ex ternal.wibble.a ();

or

#include "wibble.h"

a();
I like to have namespaces and using... ;)

Jul 12 '06 #20

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

Similar topics

35
3210
by: jerrygarciuh | last post by:
Hi all, I was just wondering what popular opinion is on PHP giving this warning: Warning: Invalid argument supplied for foreach() in /home/boogerpic/public_html/my.php on line 6 when presented with an indefined variable. It makes sense to me to warn if an unacceptably defined var is passed but it
2
3197
by: Kari Laitinen | last post by:
During the past 15 years I have been writing computer programs with so-called natural names, which means that the names (identifiers, symbols) in progarms are constructed of several natural words. I have even written a C++ book in which all programs are written with natural names. More information and free pages of the book can be found at http://www.naturalprogramming.com/cppbook.html I'm planning to produce similar books with the C#...
29
2389
by: David Eng | last post by:
In replying to P.J. Plauger ( http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&threadm=1089204435.746211%40master.nyc.kbcfp.com&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.c%252B%252B.moderated ) who responded my post in comp.long.c++ moderated neww group regarding "C++ standard and C++/CLI" topic, I worte the following post which was sensor by comp.lang.c++.moderated: ...
3
2130
by: Jack Klein | last post by:
I'm looking for opinions on a C technique I, and others, have used successfully in the past. While some people swear by, apparently others swear at it. Assume a part of a program too large to fit comfortably in a single source file, call it a "module". Let's call it "module A". Also assume for various reasons module A needs a private data store with static storage duration, accessible from files in more than one translation unit. ...
3
2610
by: John Doe | last post by:
I've been doing some reading/research on parsing simple configuration files through C, and have heard various opinions on the matter. I'd like to solicit some opinions and design criteria (as well as "gotchas") for doing this. I'm implementing a program that needs to read a standard configuration file, in key=value pairs for starters (though I'm open to other ideas). Basically it would be no more than about 20 lines total, one key per...
10
1468
by: John Swan | last post by:
Please, I have just created this site and am wondering what your opinion is from both professionals and amatures or the curious alike. Any opinions? www.integrated-dev-sol.co.uk Remove 123 from email address to reply. Anti spam and virus measure.
0
1424
by: Florian Thiel | last post by:
Dear PHP web developers, We are currently researching the ways in which the major web development platforms differ and in addition to our work with the Plat_Forms contest, we're now looking for actual professional opinions. If you have practical experience in the development of non-trivial web applications with two or more web development languages then we would like you to participate in a short survey. Three PHP teams competed in
5
1543
by: JT | last post by:
Hi, I would like opinions on a shareware issue. If shareware uses an online database to hold registration codes, which get copied locally and therefore only needs to check online if the shareware is not yet registered or if the registration code was lost, should there be an "Is it okay to go get your lost registration code?" message box? I've been told that certain firewalls will disallow everything until you've allowed it. I imagine...
1
1360
by: happyperson | last post by:
Hi All, I want to have a news and product review website. I want an RSS feed, online forum, article submission section, and possibly down the road the ability to upload/download music to this website. I am thinking about using PHP-Nuke 8.0 since that is what I am familiar with. I know Joomla and Drupal are supposedly nice CMS as well. Is PHP-Nuke too much hassle due to what I have heard about it's security issues or is this issue exaggerated...
21
2649
by: Steve Swift | last post by:
On page 90 of my O'Reilly "Javascript The definitive guide" 3rd edition there is an example of an If/Else construct: (some text removed) If (username != null) alert("Hello " + username); else { username = prompt("What is your name?"); alert("Hello " + username); }
0
8379
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
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
8816
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
8494
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,...
1
6162
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
4150
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
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1924
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.