473,804 Members | 3,469 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 #1
187 6561
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++.
--
"Some people *are* arrogant, and others read the FAQ."
--Chris Dollin
Jul 12 '06 #2
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?

Jul 12 '06 #3
In article <44************ ***********@dre ad16.news.tele. dk>,
<Lasse Espeholtwrote:
>Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
Please read about the "static" storage qualifier, and about "file scope".

--
Programming is what happens while you're busy making other plans.
Jul 12 '06 #4
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"?

--
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 #5
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...

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

Jul 12 '06 #6
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.)

--
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 #7
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.
--
"Some programming practices beg for errors;
this one is like calling an 800 number
and having errors delivered to your door."
--Steve McConnell
Jul 12 '06 #8
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.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jul 12 '06 #9
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.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jul 12 '06 #10

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

Similar topics

35
3229
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
3206
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
2415
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
2138
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
2616
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
1480
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
1436
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
1554
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
1368
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
2673
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
9588
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
10589
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...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10327
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
10085
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
9161
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...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
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
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.