C太老了?意见呢? [英] C is too old? opinions?

查看:83
本文介绍了C太老了?意见呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...


我对这种令人印象深刻且功能强大的C语言很有兴趣,但是我认为它已经过时了......


头文件/源文件的想法,方法可以冲突进入

彼此我不喜欢...看看C#哪个更干净/>
命名空间。


为什么C没有命名空间和区域概念?哪些方法和

字段可以从外面隐藏?


类似于:


a_source_file.c :


名称空间SomeName(.SomeName)

{

区域堆栈

{

private int [] myStack;


private void someMethod(){};


public void push(int i) {};

public int pop(){};

}

}


another_source_file .c:


使用SomeName(.SomeName);


int main(int argc,char [] * argv)

{

Stack.push(10);

System.printf(Stack.pop());

}


我真的很生气;)我是唯一拥有这种观点的人吗?


如果我是一个非常优秀的程序员(我不是......但是!)我会

开发了一个编译器和一个更简单(但仍然令人印象深刻和

强大)c ...


最好和最亲切的问候

La sse Espeholt

解决方案

Lasse Espeholt写道:


为什么有C不是命名空间和区域概念哪些方法和

字段可以从外面隐藏?



听起来你可以从C ++中得到你想要的东西。

-

有些人*是*傲慢,其他人阅读常见问题解答。

- Chris Dollin


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


Lasse Espeholt写道:


>为什么C不是命名空间和区域概念?哪些方法和
字段可以从外面隐藏?



听起来你可以从C ++中得到你想要的东西。



还有标题问题,我不是它的粉丝...我可以摆脱

的头文件但是它仍然是推荐的,对吧?


文章< 44 ******************* ****@dread16.news.tele.dk> ,

< Lasse Espeholtwrote:


>为什么C没有命名空间和区域概念?哪些方法和
字段可以从外面隐藏?



请阅读有关静态的信息存储限定符,以及文件范围。


-

编程就是在您忙于制定其他计划时发生的事情。


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(.SomeName)
{
area Stack
{
private int[] myStack;

private void someMethod() {};

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

another_source_file.c:

using SomeName(.SomeName);

int main(int argc, char[] *argv)
{
Stack.push(10);
System.printf(Stack.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

解决方案

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


On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.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?


In article <44***********************@dread16.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.


这篇关于C太老了?意见呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆