由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Computation版 - c++ versus fortran
相关主题
如何比较两条曲线的相似程度?c++最变态的是 头文件,模板,const, static 这几件事情。
A VPLS VC type question我捂我捂我XXX,老屌丝的炒股经
Jobs: Software Engineers in South California十二星座的编程语言(zz)
可以内推一名C++ sw engineer我捂我捂我XXX,老屌丝的炒股经 (转载)
内推软件工程师C++/Java面向对象是谁发明的阿?
现在的market真funny啊。请教:软件开发流程
说说我以前做的ultra low latency架构吧也凑个热闹,说说linux的desktop
中国的码农水平令人堪忧linus 这个俗人
相关话题的讨论汇总
话题: c++话题: mpi话题: fortran话题: use话题: vector
进入Computation版参与讨论
1 (共1页)
k*********g
发帖数: 791
1
1 功能
c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
c++完备;
其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
2 软件开发
c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
励”、“帮助”庞大的程序群的“创造”、“管理”;
用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
个人估计需要5年;
3 软件工程
即便不是做软件,而是写个1万行数量级的程序,c++也因为promotes优良的编程习惯而
战胜fortran;
4 super c
如果没有那么多的“object”,不需要++,那么可以不用c++的那些oop东西,把它当作
一个改进的c,有人称之super c,来用;这样,c++和fortran都是command oriented的
结构化语言; 用super c 写的程序,将来能比较迅速地upgrade成软件,if fortran,
k*********g
发帖数: 791
2
Oh, sh*t, 藕的程序copy到这儿成这个样子了
k*********g
发帖数: 791
3
Oh, sh*t, 藕的程序copy到这儿成这个样子了
本来相给大家做个示范动作,show一下how beautiful c++ is;
结果,藕从鞍马上一个跟斗摔了下来、、、
k*********g
发帖数: 791
4
Oh, sh*t, 藕的程序copy到这儿成这个样子了
本来想给大家做个示范动作,show一下how beautiful c++ is;
结果,藕从鞍马上一个跟斗摔了下来、、、
不过,可别小看以上这段程序:
在2007年春天写这段并行程序的时候,which用nonblocking communications with C+
+,可能是世界首次;当时藕花了很长时间琢磨、网上搜索,因为藕的C++水平其实
很烂;几天后,看到芝加哥大学的一个教授的一段blocking communications with c+
+程序,受到启发,才悟出应该如何写;
j**u
发帖数: 6059
5
藕的博士论文程序只用了4个左右的很简短的subroutine,就完成了“并行计算”,效
果是:8个processors,速度是8倍;
这个是你写的还是转贴的?很有意思.开始我还以为你自己开发了并行计算的东西,结果
还是用的mpi。其实那些程序用fortran一样很容易实现,不知道贴这个对你想说明的观
点有什么作用?另外你的speedup最高,是因为processor之间的commonication很少,这
个和语言没有任何关系,是和你的问题直接相关的。

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

l*****i
发帖数: 3929
6
这个"藕"让我想起了名噪一时的网络名人XX姐姐

【在 k*********g 的大作中提到】
: Oh, sh*t, 藕的程序copy到这儿成这个样子了
: 本来想给大家做个示范动作,show一下how beautiful c++ is;
: 结果,藕从鞍马上一个跟斗摔了下来、、、
: 不过,可别小看以上这段程序:
: 在2007年春天写这段并行程序的时候,which用nonblocking communications with C+
: +,可能是世界首次;当时藕花了很长时间琢磨、网上搜索,因为藕的C++水平其实
: 很烂;几天后,看到芝加哥大学的一个教授的一段blocking communications with c+
: +程序,受到启发,才悟出应该如何写;

i**g
发帖数: 134
7
c++比fortran才慢10%左右的详细对比情况?出处?

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

j**u
发帖数: 6059
8
我当初上平行计算课的时候那个老师也曾经说过类似的话,因他是fortran的狂热支持
者,对这个论断我一直保留意见,不过也没有具体比较过,没有大量的数据支持不好说。

【在 i**g 的大作中提到】
: c++比fortran才慢10%左右的详细对比情况?出处?
:
: 10

l******n
发帖数: 1683
9
这个说法好像很普遍, 但是前提是两者是都充分优化过的代码, fortran呀, c呀啥的
代码优化感觉比较容易, c++貌似就难多了.

说。

【在 j**u 的大作中提到】
: 我当初上平行计算课的时候那个老师也曾经说过类似的话,因他是fortran的狂热支持
: 者,对这个论断我一直保留意见,不过也没有具体比较过,没有大量的数据支持不好说。

e*l
发帖数: 37
10
fortran本来就是专门搞数值计算,用它做非数值的东西不是瞎搞么?
C++并不是什么都能做,底层的硬件操控还得靠汇编。
f77就是垃圾,f90标准出来得太晚,而且太保守,但是比f77好的多。
面向对象的语言多了去了,把C++说成是最好语言就是扯淡!
C++语法复杂,编程中需要关注的细节很多,编程效率并不高,相比Fortran隐藏
了很多细节,要简单得多,你的10人年的例子就是胡扯!
C++促进优良的编程习惯?地球人都笑了!难道用fortran就没有良好的编程习惯
了?
第5点是你自己凭空造的吧,你学过计算机操作系统没有?
速度的提法也是扯淡,C++编写代码以及调试比fortran要复杂得多。
你贴的博士论文上的代码有点糟糕,你只是把C++当成C在用而已,同样的东西用
frotran也可以做得更漂亮.

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

相关主题
现在的market真funny啊。c++最变态的是 头文件,模板,const, static 这几件事情。
说说我以前做的ultra low latency架构吧我捂我捂我XXX,老屌丝的炒股经
中国的码农水平令人堪忧十二星座的编程语言(zz)
进入Computation版参与讨论
e*l
发帖数: 37
11
你不要侮辱了C++
孤陋寡闻,进程间通讯本来就可以同步或者异步,这是基本常识

【在 k*********g 的大作中提到】
: Oh, sh*t, 藕的程序copy到这儿成这个样子了
: 本来想给大家做个示范动作,show一下how beautiful c++ is;
: 结果,藕从鞍马上一个跟斗摔了下来、、、
: 不过,可别小看以上这段程序:
: 在2007年春天写这段并行程序的时候,which用nonblocking communications with C+
: +,可能是世界首次;当时藕花了很长时间琢磨、网上搜索,因为藕的C++水平其实
: 很烂;几天后,看到芝加哥大学的一个教授的一段blocking communications with c+
: +程序,受到启发,才悟出应该如何写;

m******7
发帖数: 11
12
楼主真的对fortran了解到和c一样的程度了吗?还是只实在微机层面上的了解?

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

b****z
发帖数: 337
13
刀和剑哪个好?
梅需逊雪三分白,雪却输梅一段香。
单纯这样比较没有意义。

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

l*******G
发帖数: 1191
14
Look at what Linus says:
"C++ is a horrible language. It's made more horrible by the fact that a
lot of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if the
choice of C were to do nothing but keep the C++ programmers out, that in
itself would be a huge reason to use C."
http://twlevo.blogspot.com/2010/06/linus-on-c-usage-is-bad-thing-todo.html
j**f
发帖数: 7403
15
这个专题挺好的。看上面几个讨论,学到好些东西 。:)

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

k*********g
发帖数: 791
16
c++ horrible?
由此来说明你们很潮流?
来来来,
报一个什么都能干的语言出来;
来来来,
说说windows上的applications都用什么写的?
k*********g
发帖数: 791
17
快10%有个屁用?
容易编写、修改、维护、通用的语言, 省10000%的时间;
t*****z
发帖数: 812
18
现在有人单纯用fortran的吗?
一般都是C+fortran + C++混合编程
j****x
发帖数: 943
19
Many legacy codes still exist and work well.
x*****u
发帖数: 3419
20
ft,当然有单纯Fortran编程的。

【在 t*****z 的大作中提到】
: 现在有人单纯用fortran的吗?
: 一般都是C+fortran + C++混合编程

相关主题
我捂我捂我XXX,老屌丝的炒股经 (转载)也凑个热闹,说说linux的desktop
面向对象是谁发明的阿?linus 这个俗人
请教:软件开发流程其实以前几大UNIX用的CDE的桌面挺好的
进入Computation版参与讨论
t*****z
发帖数: 812
21
I mean commertial software

【在 x*****u 的大作中提到】
: ft,当然有单纯Fortran编程的。
w*****1
发帖数: 88
22
看到c++就开始头晕~~~飘过
m*******h
发帖数: 61
23
感觉是扯淡,编程语言就象说话用的语言一样,用的好与不好完全在于个人的水平和功
力,用c++和fortran一样多能写出优良的好的程序,这样的例子数不胜数,楼主的帖子
只能说明你用c++比用fortran好,无他!!!!
s*******s
发帖数: 414
24

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
are you sure you are not kidding?

【在 k*********g 的大作中提到】
: 快10%有个屁用?
: 容易编写、修改、维护、通用的语言, 省10000%的时间;

k*********g
发帖数: 791
25
来来来;
说说看;
做数值计算快10%有啥屁用;

【在 s*******s 的大作中提到】
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: are you sure you are not kidding?

k****5
发帖数: 546
26
这儿是科学计算版,不是cs版。
t*****z
发帖数: 812
27
c++的人告诉我传递多维数组的时候是fortran方便还是c++方便
x*****u
发帖数: 3419
28
http://thread.gmane.org/gmane.comp.version-control.git/57643/fo
From: Linus Torvalds linux-foundation.org>
Subject: Re: [RFC] Convert builin-mailinfo.c to use The Better String
Library.
Newsgroups: gmane.comp.version-control.git
Date: 2007-09-06 17:50:28 GMT (3 years, 38 weeks, 3 hours and 54 minutes ago)
On Wed, 5 Sep 2007, Dmitry Kakurin wrote:
>
> When I first looked at Git source code two things struck me as odd:
> 1. Pure C as opposed to C++. No idea why. Please don't talk about
portability,
> it's BS.
*YOU* are full of bullshit.
C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C.
In other words: the choice of C is the only sane choice. I know Miles
Bader jokingly said "to piss you off", but it's actually true. I've come
to the conclusion that any programmer that would prefer the project to be
in C++ over C is likely a programmer that I really *would* prefer to piss
off, so that he doesn't come and screw up any project I'm involved with.
C++ leads to really really bad design choices. You invariably start using
the "nice" library features of the language like STL and Boost and other
total and utter crap, that may "help" you program, but causes:
- infinite amounts of pain when they don't work (and anybody who tells me
that STL and especially Boost are stable and portable is just so full
of BS that it's not even funny)
- inefficient abstracted programming models where two years down the road
you notice that some abstraction wasn't very efficient, but now all
your code depends on all the nice object models around it, and you
cannot fix it without rewriting your app.
In other words, the only way to do good, efficient, and system-level and
portable C++ ends up to limit yourself to all the things that are
basically available in C. And limiting your project to C means that people
don't screw that up, and also means that you get a lot of programmers that
do actually understand low-level issues and don't screw things up with any
idiotic "object model" crap.
So I'm sorry, but for something like git, where efficiency was a primary
objective, the "advantages" of C++ is just a huge mistake. The fact that
we also piss off people who cannot see that is just a big additional
advantage.
If you want a VCS that is written in C++, go play with Monotone. Really.
They use a "real database". They use "nice object-oriented libraries".
They use "nice C++ abstractions". And quite frankly, as a result of all
these design decisions that sound so appealing to some CS people, the end
result is a horrible and unmaintainable mess.
But I'm sure you'd like it more than git.
Linus

a
the

【在 l*******G 的大作中提到】
: Look at what Linus says:
: "C++ is a horrible language. It's made more horrible by the fact that a
: lot of substandard programmers use it, to the point where it's much much
: easier to generate total and utter crap with it. Quite frankly, even if the
: choice of C were to do nothing but keep the C++ programmers out, that in
: itself would be a huge reason to use C."
: http://twlevo.blogspot.com/2010/06/linus-on-c-usage-is-bad-thing-todo.html

k*********g
发帖数: 791
29
to xiaozhu,
smart people use the good part of c++,
silly people use the bad part of c++.
for example, silly programmers use some very special little things or tricks
. that's really silly. that not only introduces bugs also raise maintenance
fees.
by the way, the thred is the pk between fortran and c++
not the pk between c and c++.
even comparing the common part, the structural programming part of c++ is
much better than c.
when i develop software, only really standard oop stuff will be used. other
oop stuff, if developed by general practioners and if can be anyway kind of
replaced by structral action oriented programming, then will not be adopted.
k*********g
发帖数: 791
30
1 功能
c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
c++完备;
其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
2 软件开发
c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
励”、“帮助”庞大的程序群的“创造”、“管理”;
用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
个人估计需要5年;
3 软件工程
即便不是做软件,而是写个1万行数量级的程序,c++也因为promotes优良的编程习惯而
战胜fortran;
4 super c
如果没有那么多的“object”,不需要++,那么可以不用c++的那些oop东西,把它当作
一个改进的c,有人称之super c,来用;这样,c++和fortran都是command oriented的
结构化语言; 用super c 写的程序,将来能比较迅速地upgrade成软件,if fortran,
得重写;
5 交流
目前,计算机99%以上是用来“数据搬运”的,主要分“通信”、“数据处理”2大块
;比如,操作系统,就是一个数据搬运问题;
计算机1%不到是用来“数据产生”的,既科学计算;搬运工们基本不用real number;
科学计算的,基本用real number;
那些数据搬运工,即computer science人士,基本不懂fortran;
所以,做科学计算的,if用fortran,数据搬运工们的成果就不能及时拿来主义了;
6 关于“速度”的思辨
c++比fortran才慢10%左右;不用++的c++,比fortran慢得更少;
思辨一下:is 10% speed reduction A big deal?
a 你的程序快10%左右,这样本来需要24小时算完的东西,你的fortran程序22小时就
能算完;这很牛吗?
b 当计算机在计算的时候,你不可以去干别的事吗?慢10%妨碍你啦?
c 为了让计算机省2个小时,你愿意自己多花几百小时、甚至几千小时(this is the
case if 做软件)写程序、改程序、调试程序、维护程序,这样做,是不是太傻B了?
抑或傻A?
藕的博士论文程序只用了4个左右的很简短的subroutine,就完成了“并行计算”,效
果是:8个processors,速度是8倍;
以下是其中一个subroutine:
// filtered gathering of condensed local vector, make sure incoming data not
modified
#include "globalDefined.h"
#include
#include
using namespace std;
#if parallel
#include "mpi.h"
#endif
extern int MPI_Rank, MPI_Size;
extern int MPI_SendList[MPI_MAXSIZE], MPI_ReceiveList[MPI_MAXSIZE];
extern int MPI_Inf[2], MPI_Inf_Buffer[2];
extern double MPI_Vector[MPI_MAXNUMROW], MPI_Vector_Buffer[MPI_MAXNUMROW];
void MPI_superpositionFiltered (
int localContribution, // 0 or 1: local contribution
included or not
int rowCounter, int rowToNode[], int nodeToRow[], double
vector_local[],
int counterFilteredList[],
int rowToNodeFilteredList[][MPI_MAXSIZE], // indexed by
outcoming data
double vector[]
)
{
#if parallel
MPI::COMM_WORLD.Barrier();
#endif
int i;
#if parallel
int j;
int tag = 0;
MPI::Status status;
MPI::Request requestIsend, requestIrecv;
#endif
// initialization
for ( i = 0; i < rowCounter; i++ ) {
vector[i] = 0.0;
}
// possible local contribution
if ( localContribution == 1 ) {
for ( i = 0; i < rowCounter; i++ ) {
vector[i] += vector_local[i];
}
}
#if parallel
MPI::COMM_WORLD.Barrier();
#endif
// broadcast filtered values and positions by all processors
#if parallel
for ( i = 0; i < MPI_Size-1; i++ ) {
for ( j = 0; j < counterFilteredList[MPI_SendList[i]]; j++ ) {
MPI_Vector[j] = vector_local[ nodeToRow[rowToNodeFilteredList[j]
[MPI_SendList[i]]] ];
}
if ( counterFilteredList[MPI_SendList[i]] != 0 ) {
requestIsend = MPI::COMM_WORLD.Isend ( &MPI_Vector,
counterFilteredList[MPI_SendList[i]],
MPI::DOUBLE, MPI_SendList[i], tag );
requestIsend.Wait ( status );
}
if ( counterFilteredList[MPI_ReceiveList[i]] != 0 ) {
requestIrecv = MPI::COMM_WORLD.Irecv ( &MPI_Vector_Buffer,
counterFilteredList[MPI_ReceiveList[i]],
MPI::DOUBLE, MPI_ReceiveList[i], tag );
requestIrecv.Wait ( status );
for ( j = 0; j < counterFilteredList[MPI_ReceiveList[i]]; j++ ) {
vector[ nodeToRow[rowToNodeFilteredList[j][MPI_ReceiveList[i
]]] ] += MPI_Vector_Buffer[j];
}
}
}
#endif
#if parallel
MPI::COMM_WORLD.Barrier();
#endif
}
相关主题
按说java也够快了A VPLS VC type question
问个矩阵作为参数, C programming的问题Jobs: Software Engineers in South California
如何比较两条曲线的相似程度?可以内推一名C++ sw engineer
进入Computation版参与讨论
k*********g
发帖数: 791
31
Oh, sh*t, 藕的程序copy到这儿成这个样子了
k*********g
发帖数: 791
32
Oh, sh*t, 藕的程序copy到这儿成这个样子了
本来相给大家做个示范动作,show一下how beautiful c++ is;
结果,藕从鞍马上一个跟斗摔了下来、、、
k*********g
发帖数: 791
33
Oh, sh*t, 藕的程序copy到这儿成这个样子了
本来想给大家做个示范动作,show一下how beautiful c++ is;
结果,藕从鞍马上一个跟斗摔了下来、、、
不过,可别小看以上这段程序:
在2007年春天写这段并行程序的时候,which用nonblocking communications with C+
+,可能是世界首次;当时藕花了很长时间琢磨、网上搜索,因为藕的C++水平其实
很烂;几天后,看到芝加哥大学的一个教授的一段blocking communications with c+
+程序,受到启发,才悟出应该如何写;
j**u
发帖数: 6059
34
藕的博士论文程序只用了4个左右的很简短的subroutine,就完成了“并行计算”,效
果是:8个processors,速度是8倍;
这个是你写的还是转贴的?很有意思.开始我还以为你自己开发了并行计算的东西,结果
还是用的mpi。其实那些程序用fortran一样很容易实现,不知道贴这个对你想说明的观
点有什么作用?另外你的speedup最高,是因为processor之间的commonication很少,这
个和语言没有任何关系,是和你的问题直接相关的。

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

l*****i
发帖数: 3929
35
这个"藕"让我想起了名噪一时的网络名人XX姐姐

【在 k*********g 的大作中提到】
: Oh, sh*t, 藕的程序copy到这儿成这个样子了
: 本来想给大家做个示范动作,show一下how beautiful c++ is;
: 结果,藕从鞍马上一个跟斗摔了下来、、、
: 不过,可别小看以上这段程序:
: 在2007年春天写这段并行程序的时候,which用nonblocking communications with C+
: +,可能是世界首次;当时藕花了很长时间琢磨、网上搜索,因为藕的C++水平其实
: 很烂;几天后,看到芝加哥大学的一个教授的一段blocking communications with c+
: +程序,受到启发,才悟出应该如何写;

i**g
发帖数: 134
36
c++比fortran才慢10%左右的详细对比情况?出处?

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

j**u
发帖数: 6059
37
我当初上平行计算课的时候那个老师也曾经说过类似的话,因他是fortran的狂热支持
者,对这个论断我一直保留意见,不过也没有具体比较过,没有大量的数据支持不好说。

【在 i**g 的大作中提到】
: c++比fortran才慢10%左右的详细对比情况?出处?
:
: 10

l******n
发帖数: 1683
38
这个说法好像很普遍, 但是前提是两者是都充分优化过的代码, fortran呀, c呀啥的
代码优化感觉比较容易, c++貌似就难多了.

说。

【在 j**u 的大作中提到】
: 我当初上平行计算课的时候那个老师也曾经说过类似的话,因他是fortran的狂热支持
: 者,对这个论断我一直保留意见,不过也没有具体比较过,没有大量的数据支持不好说。

e*l
发帖数: 37
39
fortran本来就是专门搞数值计算,用它做非数值的东西不是瞎搞么?
C++并不是什么都能做,底层的硬件操控还得靠汇编。
f77就是垃圾,f90标准出来得太晚,而且太保守,但是比f77好的多。
面向对象的语言多了去了,把C++说成是最好语言就是扯淡!
C++语法复杂,编程中需要关注的细节很多,编程效率并不高,相比Fortran隐藏
了很多细节,要简单得多,你的10人年的例子就是胡扯!
C++促进优良的编程习惯?地球人都笑了!难道用fortran就没有良好的编程习惯
了?
第5点是你自己凭空造的吧,你学过计算机操作系统没有?
速度的提法也是扯淡,C++编写代码以及调试比fortran要复杂得多。
你贴的博士论文上的代码有点糟糕,你只是把C++当成C在用而已,同样的东西用
frotran也可以做得更漂亮.

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

e*l
发帖数: 37
40
你不要侮辱了C++
孤陋寡闻,进程间通讯本来就可以同步或者异步,这是基本常识

【在 k*********g 的大作中提到】
: Oh, sh*t, 藕的程序copy到这儿成这个样子了
: 本来想给大家做个示范动作,show一下how beautiful c++ is;
: 结果,藕从鞍马上一个跟斗摔了下来、、、
: 不过,可别小看以上这段程序:
: 在2007年春天写这段并行程序的时候,which用nonblocking communications with C+
: +,可能是世界首次;当时藕花了很长时间琢磨、网上搜索,因为藕的C++水平其实
: 很烂;几天后,看到芝加哥大学的一个教授的一段blocking communications with c+
: +程序,受到启发,才悟出应该如何写;

相关主题
可以内推一名C++ sw engineer说说我以前做的ultra low latency架构吧
内推软件工程师C++/Java中国的码农水平令人堪忧
现在的market真funny啊。c++最变态的是 头文件,模板,const, static 这几件事情。
进入Computation版参与讨论
m******7
发帖数: 11
41
楼主真的对fortran了解到和c一样的程度了吗?还是只实在微机层面上的了解?

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

b****z
发帖数: 337
42
刀和剑哪个好?
梅需逊雪三分白,雪却输梅一段香。
单纯这样比较没有意义。

10

【在 k*********g 的大作中提到】
: 1 功能
: c++什么都能做,早期fortran只能做数值计算,现在能做非数值的东西,但还是远没有
: c++完备;
: 其实,fortran77是个好东西:专项、简单;从fortran90开始,哲学出了问题;
: 2 软件开发
: c++是开发软件的最好语言,很大程度是因为它的“面向对象”的特点,其实就是“鼓
: 励”、“帮助”庞大的程序群的“创造”、“管理”;
: 用fortran写软件,不仅仅有些功能(如,对计算机软硬件的操作)没法办,而且整个
: 软件会被管理得一塌糊涂;用c++,10个人1年就能搞定的东西,if用frotran,同样10
: 个人估计需要5年;

t*****z
发帖数: 812
43
I have to change my mind recently. C++ is the trend in the future. Fortran
is dying even in the numerical computational field.
t*****n
发帖数: 4908
44
准备写书了。那位参与?
Programing in Engineering by C++
t***s
发帖数: 4666
45
你这话都不通。

【在 t*****n 的大作中提到】
: 准备写书了。那位参与?
: Programing in Engineering by C++

x*****u
发帖数: 3419
46
Is there a good book on oop? Thanks!

tricks
maintenance

【在 k*********g 的大作中提到】
: to xiaozhu,
: smart people use the good part of c++,
: silly people use the bad part of c++.
: for example, silly programmers use some very special little things or tricks
: . that's really silly. that not only introduces bugs also raise maintenance
: fees.
: by the way, the thred is the pk between fortran and c++
: not the pk between c and c++.
: even comparing the common part, the structural programming part of c++ is
: much better than c.

t*****n
发帖数: 4908
47
C++已经走入歧途了。我的意思是取其精华,去掉垃圾。强调用C++写行业应用软件。

【在 t***s 的大作中提到】
: 你这话都不通。
l*******G
发帖数: 1191
48
Look at what Linus says:
"C++ is a horrible language. It's made more horrible by the fact that a
lot of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if the
choice of C were to do nothing but keep the C++ programmers out, that in
itself would be a huge reason to use C."
http://twlevo.blogspot.com/2010/06/linus-on-c-usage-is-bad-thin
k*********g
发帖数: 791
49
c++ horrible?
由此来说明你们很潮流?
来来来,
报一个什么都能干的语言出来;
来来来,
说说windows上的applications都用什么写的?
k*********g
发帖数: 791
50
快10%有个屁用?
容易编写、修改、维护、通用的语言, 省10000%的时间;
相关主题
我捂我捂我XXX,老屌丝的炒股经面向对象是谁发明的阿?
十二星座的编程语言(zz)请教:软件开发流程
我捂我捂我XXX,老屌丝的炒股经 (转载)也凑个热闹,说说linux的desktop
进入Computation版参与讨论
t*****z
发帖数: 812
51
现在有人单纯用fortran的吗?
一般都是C+fortran + C++混合编程
j****x
发帖数: 943
52
Many legacy codes still exist and work well.
x*****u
发帖数: 3419
53
ft,当然有单纯Fortran编程的。

【在 t*****z 的大作中提到】
: 现在有人单纯用fortran的吗?
: 一般都是C+fortran + C++混合编程

t*****z
发帖数: 812
54
I mean commertial software

【在 x*****u 的大作中提到】
: ft,当然有单纯Fortran编程的。
w*****1
发帖数: 88
55
看到c++就开始头晕~~~飘过
m*******h
发帖数: 61
56
感觉是扯淡,编程语言就象说话用的语言一样,用的好与不好完全在于个人的水平和功
力,用c++和fortran一样多能写出优良的好的程序,这样的例子数不胜数,楼主的帖子
只能说明你用c++比用fortran好,无他!!!!
s*******s
发帖数: 414
57

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
are you sure you are not kidding?

【在 k*********g 的大作中提到】
: 快10%有个屁用?
: 容易编写、修改、维护、通用的语言, 省10000%的时间;

k*********g
发帖数: 791
58
来来来;
说说看;
做数值计算快10%有啥屁用;

【在 s*******s 的大作中提到】
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: are you sure you are not kidding?

k****5
发帖数: 546
59
这儿是科学计算版,不是cs版。
t*****z
发帖数: 812
60
c++的人告诉我传递多维数组的时候是fortran方便还是c++方便
相关主题
linus 这个俗人问个矩阵作为参数, C programming的问题
其实以前几大UNIX用的CDE的桌面挺好的如何比较两条曲线的相似程度?
按说java也够快了A VPLS VC type question
进入Computation版参与讨论
x*****u
发帖数: 3419
61
http://thread.gmane.org/gmane.comp.version-control.git/57643/fo
From: Linus Torvalds linux-foundation.org>
Subject: Re: [RFC] Convert builin-mailinfo.c to use The Better String
Library.
Newsgroups: gmane.comp.version-control.git
Date: 2007-09-06 17:50:28 GMT (3 years, 38 weeks, 3 hours and 54 minutes ago)
On Wed, 5 Sep 2007, Dmitry Kakurin wrote:
>
> When I first looked at Git source code two things struck me as odd:
> 1. Pure C as opposed to C++. No idea why. Please don't talk about
portability,
> it's BS.
*YOU* are full of bullshit.
C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C.
In other words: the choice of C is the only sane choice. I know Miles
Bader jokingly said "to piss you off", but it's actually true. I've come
to the conclusion that any programmer that would prefer the project to be
in C++ over C is likely a programmer that I really *would* prefer to piss
off, so that he doesn't come and screw up any project I'm involved with.
C++ leads to really really bad design choices. You invariably start using
the "nice" library features of the language like STL and Boost and other
total and utter crap, that may "help" you program, but causes:
- infinite amounts of pain when they don't work (and anybody who tells me
that STL and especially Boost are stable and portable is just so full
of BS that it's not even funny)
- inefficient abstracted programming models where two years down the road
you notice that some abstraction wasn't very efficient, but now all
your code depends on all the nice object models around it, and you
cannot fix it without rewriting your app.
In other words, the only way to do good, efficient, and system-level and
portable C++ ends up to limit yourself to all the things that are
basically available in C. And limiting your project to C means that people
don't screw that up, and also means that you get a lot of programmers that
do actually understand low-level issues and don't screw things up with any
idiotic "object model" crap.
So I'm sorry, but for something like git, where efficiency was a primary
objective, the "advantages" of C++ is just a huge mistake. The fact that
we also piss off people who cannot see that is just a big additional
advantage.
If you want a VCS that is written in C++, go play with Monotone. Really.
They use a "real database". They use "nice object-oriented libraries".
They use "nice C++ abstractions". And quite frankly, as a result of all
these design decisions that sound so appealing to some CS people, the end
result is a horrible and unmaintainable mess.
But I'm sure you'd like it more than git.
Linus

a
the

【在 l*******G 的大作中提到】
: Look at what Linus says:
: "C++ is a horrible language. It's made more horrible by the fact that a
: lot of substandard programmers use it, to the point where it's much much
: easier to generate total and utter crap with it. Quite frankly, even if the
: choice of C were to do nothing but keep the C++ programmers out, that in
: itself would be a huge reason to use C."
: http://twlevo.blogspot.com/2010/06/linus-on-c-usage-is-bad-thin

k*********g
发帖数: 791
62
to xiaozhu,
smart people use the good part of c++,
silly people use the bad part of c++.
for example, silly programmers use some very special little things or tricks
. that's really silly. that not only introduces bugs also raise maintenance
fees.
by the way, the thred is the pk between fortran and c++
not the pk between c and c++.
even comparing the common part, the structural programming part of c++ is
much better than c.
when i develop software, only really standard oop stuff will be used. other
oop stuff, if developed by general practioners and if can be anyway kind of
replaced by structral action oriented programming, then will not be adopted.
t*****z
发帖数: 812
63
I have to change my mind recently. C++ is the trend in the future. Fortran
is dying even in the numerical computational field.
t*****n
发帖数: 4908
64
准备写书了。那位参与?
Programing in Engineering by C++
t***s
发帖数: 4666
65
你这话都不通。

【在 t*****n 的大作中提到】
: 准备写书了。那位参与?
: Programing in Engineering by C++

x*****u
发帖数: 3419
66
Is there a good book on oop? Thanks!

tricks
maintenance

【在 k*********g 的大作中提到】
: to xiaozhu,
: smart people use the good part of c++,
: silly people use the bad part of c++.
: for example, silly programmers use some very special little things or tricks
: . that's really silly. that not only introduces bugs also raise maintenance
: fees.
: by the way, the thred is the pk between fortran and c++
: not the pk between c and c++.
: even comparing the common part, the structural programming part of c++ is
: much better than c.

t*****n
发帖数: 4908
67
C++已经走入歧途了。我的意思是取其精华,去掉垃圾。强调用C++写行业应用软件。

【在 t***s 的大作中提到】
: 你这话都不通。
r*k
发帖数: 594
68
顶这个,fortran里面你可以对函数传递一个数组的一个片段,e.g. Array(3:5,4:7)。
在c或者c++里面不容易实现。

【在 t*****z 的大作中提到】
: c++的人告诉我传递多维数组的时候是fortran方便还是c++方便
l*******G
发帖数: 1191
69
C++ 没有复数类型!
1 (共1页)
进入Computation版参与讨论
相关主题
linus 这个俗人内推软件工程师C++/Java
其实以前几大UNIX用的CDE的桌面挺好的现在的market真funny啊。
按说java也够快了说说我以前做的ultra low latency架构吧
问个矩阵作为参数, C programming的问题中国的码农水平令人堪忧
如何比较两条曲线的相似程度?c++最变态的是 头文件,模板,const, static 这几件事情。
A VPLS VC type question我捂我捂我XXX,老屌丝的炒股经
Jobs: Software Engineers in South California十二星座的编程语言(zz)
可以内推一名C++ sw engineer我捂我捂我XXX,老屌丝的炒股经 (转载)
相关话题的讨论汇总
话题: c++话题: mpi话题: fortran话题: use话题: vector