如何启动C ++软件项目? [英] How to start a C++ software project?

查看:109
本文介绍了如何启动C ++软件项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,


我想开始一个c ++软件项目。它用于模拟复杂媒体中声波的传播。它可能包含4个部分:

GUI,预处理,模拟和后处理。用户可以使用GUI

来建模几何图形,设置一些参数并显示结果。


系统有点大。我没有大代码的expierence。但是

我非常熟悉物理部分以及

系统应该提供的功能。对于大型系统来说,我们需要做好b $ b需求分析,架构设计等等。有人可以给我一些建议吗?我可以跳过它们来直接编写程序代码吗?

这可能会让项目立即开始并尽早完成。


我感谢您的帮助! />

水生

Dear All,

I want to start a c++ software project. It is used to simulate the
propagation of sound waves in complex media. It may contain 4 parts:
GUI, preprocession, simulation and postprocession. Users can use GUI
to model their geometry, set some parameters and show the results.

The system is kind of large. I have no expierence in large codes. But
I am very familiar with the physics part and what functionaloty the
system should provide. Seems for a large system, we need do
requirement analysis, architecture design and so on. Anybody can give
me some suggestion? May I jump over them to directly code the program?
This may make the project begin immedialtly and fulfill early.

I appreciate your kind help!

Shuisheng

推荐答案

shuisheng写道:
shuisheng wrote:

我想开始一个c ++软件项目。它习惯于[...]


系统有点大。 [...]

对于大型系统来说,我们需要做什么?b $ b需求分析,架构设计等等。有人可以给我一些建议吗?
I want to start a c++ software project. It is used to [...]

The system is kind of large. [..]
Seems for a large system, we need do
requirement analysis, architecture design and so on. Anybody can give
me some suggestion?



你在一个错误的新闻组。你需要在comp.software-eng中询问。

你所使用的语言*不重要。

You''re in a wrong newsgroup. You need to ask in comp.software-eng.
The language in which you do it does *not* matter.


我可以跳过它们直接编写程序代码?
May I jump over them to directly code the program?



是的,你可以。你得到了我的明确许可。你应该?我不认为这是b $ b。但我该告诉你谁?

Yes, you may. You have my expressed permission. Should you? I
don''t think so. But who am I to tell you?


这可能会使项目立即开始并尽早完成。
This may make the project begin immedialtly and fulfill early.



我认为每个人都应该这样做,至少在他们的

生命周期中一次。弄清楚你可以花多少时间浪费在这个上,只需这样做!(tm)我的意思是,继续浪费你的时间!

你很有可能除了一些非常低级别的代码之外可能还有一些东西。但话说回来,如果你没有获得任何收益,你获得了经验,对吧?


V

-

请在通过电子邮件回复时删除资金''A'

我没有回复最热门的回复,请不要问

I think everyone should do it that way, at least once in their
lifetime. Figure out how much time you can afford to waste on
this and just do it!(tm) I mean, go ahead and waste your time!
You will most likely get NOTHING out of it except maybe some
bits a pieces of the very low-level code. But then again, if
you don''t gain anything, you gain experience, right?

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask


我想启动一个c ++软件项目。
I want to start a c++ software project.

>

系统有点大。我在大代码中没有expierence。

我可以跳过它们直接编写程序代码吗?

这可能会使项目立即开始并尽早完成。
>
The system is kind of large. I have no expierence in large codes.
May I jump over them to directly code the program?
This may make the project begin immedialtly and fulfill early.



添加到Victor的建议:

1)在开始之前,获取版本控制系统。我在Windows上使用Subversion +

TortoisSVN,但还有很多其他的,取决于你的操作系统和流行程序。起初它看起来有点矫枉过正,但是当你有一些代码正常工作时,你会打破它,你就可以打破它,你能够回到原来的地方吗? ,并将体验幸福。 (另外,你会得到更多的改变而不必担心太多关于

打破的事情,因为你总是能够回来如果你需要

到。)


2)对于大型项目,有几种不同的开发方法用于
。它们的共同之处在于,你需要实现一些部分,测试这些部分,然后实施更多部分,然后再测试这些部分,并最终将所有内容构建完成。

的条款工作。


两种常用方法:

A)结构化设计。这是我们上学的时候教他们很长时间的一个。

例如,写一下:

int main( ){

preprocess();

simulate();

postprocess();

}


然后以类似的高级别编写预处理函数。说:


void preprocess(){

preprocessA();

preprocessB();

int result = preprocessC();

if(result 3){

preprocessD();

} else {

preprocessE();

}

}


现在将preprocessA写成这样的部分。最后,你得到

点,其中每个部分足够小,你可以编写实际的

代码,而无需再调用任何函数。然后你就完成了。


2)敏捷方法。这是一种更现代的方法

制作1页左右的功能列表。这可能不会超过每小时1/2美元。


选择一个优先级最高的并实施它。然后选择

另一个并实现它等等。


对于每个功能,可能从最淡化的版本开始

可以想象,然后添加其他功能直到它完成。


例如,在您的情况下,我可能决定从GUI开始。我的第一件事就是创建一个窗口,其中包含静态文本,表示

GUI即将推出。然后我会测试并确保它有效。然后我会改变它,因为它有3个按钮(假设我是我需要的),并且当你点击每个按钮时,它就是
点击按钮1或类似的东西

那样的。然后测试。 $?
3)使用KISS原则(Keep It Simple,Stupid)。大型项目

很难,而且经常因为过于野心勃勃而被杀死。

做所有事情,结果,你什么也得不到。

优先考虑并做最重要的事情并让它们正常工作要好得多,然后

以后再加上铃声和口哨声。


祝你的项目好运。


Michael

To add to Victor''s suggestions:
1) Before you start, get a version control system. I use Subversion +
TortoisSVN on Windows, but there are plenty of others, depending on
your OS and proclivities. At first it will seem like overkill, but
when you have some code working, then you break it, you''ll be able to
get back to where you were, and will experience bliss. (Also, you''ll
be able to make more changes without having to worry too much about
breaking things, because you''ll always be able to get back if you need
to.)

2) There are several different development methodologies that are used
for larger projects. What they all have in common is that you
implement some pieces, test those pieces, then implement some more,
and test those, and eventually you build the whole thing in terms of
pieces that work.

Two common methodologies:
A) Structured design. This is the one they used to teach a long time
ago when I went to school.
For example, write:
int main() {
preprocess();
simulate();
postprocess();
}

Then write the preprocess function in a similar high level. Say:

void preprocess() {
preprocessA();
preprocessB();
int result = preprocessC();
if (result 3) {
preprocessD();
} else {
preprocessE();
}
}

Now write preprocessA in pieces like this. Eventually, you get to the
point where each pieces is small enough that you can write the actual
code without calling any more functions. Then you''re done.

2) Agile method. This is a more modern methodology
Make a 1-page or so list of features. This probably won''t take more
than 1/2 an hour.

Pick one that''s the highest priority and implement it. Then pick
another and implement it, etc.

For each feature, maybe start with the most watered-down version you
can imagine, then add additional functionality until it''s complete.

For example, in your case, I might decide to start with the GUI. My
first thing would be to create a window that has static text saying
"GUI coming soon." Then I''d test and make sure that works. Then I''d
change it so it has 3 buttons (assuming that''s what I needed), and
when you click each one it says "You clicked Button 1" or something
like that. Then test. And piece by piece, get it working.

3) Use the KISS principle (Keep It Simple, Stupid). Large projects
are hard, and are frequently killed by trying to be too ambitious and
do everything, and as a result, you get nothing. It''s much better to
prioritize and do the most important things and get them working, then
add bells and whistles later.

Good luck on your project.

Michael


2月22日上午9:13 ,水生 < shuishen ... @ yahoo.comwrote:
On Feb 22, 9:13 am, "shuisheng" <shuishen...@yahoo.comwrote:

感谢您的帮助!
I appreciate your kind help!



就是这样:在你没有最初知道你正在实施什么或如何实现的情况下,C ++是一种糟糕的语言选择实现它,

但是以探索的方式获取这些知识。


首先,你受到编辑 - 编译 - 链接 - 运行周期的限制。

整个计划必须精心打造;在您执行任何操作之前,所有东西都必须在它们之间徘徊

。这个属性还使程序可以抵抗许多你可能想要在迭代开发情况下实验的变化,通过分配大量的成本

这些实验:概念上的小变化需要太大的附加变化波动,以便程序继续编译,构建和运行
。绝缘模块最大限度地减少了他们的b $ b依赖关系需要一些了解如何,以及各种垫片的开发,因为它们只存在于

为了绝缘。


你的想法中唯一受益于C ++的部分是声波传播的实际模拟给定的给定

几何。这可以封装为一个带有一些好的定义二进制接口的库:用于将模型传递给库的数据类型,用于设置模拟参数的函数和

进行模拟,以及在某些给定的

表示中获得结果的方法,可能有实时反馈。


其余的周边软件可以用一些动态的

语言来完成,它有一个像样的GUI工具包和一个外语函数调用

的能力。

另一件需要考虑的事情是,您可以使用多少现有软件来重复使用。已经有软件可以创建三个$ b / b $ b维模型,并以其他

程序可以解析的已知格式导出它们。这可能足以为这些声波模拟创建

几何。我知道模型中的

对象必须归因于与声学有关的附加属性

,但是也许一些建模程序有办法来获得
表示带有一些用户定义的通用属性,可以附加到模型元素上。

Just this: C++ is a poor choice of language for situations where you
don''t initially know what you are implementing or how to implement it,
but acquire that knowledge in an exploratory way.

Firstly, you are constrained by edit-compile-link-run cycles. The
entire program has to be well-formed; everything has to dove-tail
before you can execute any of it. This property also makes programs
resistant to many of the kinds of changes you might want to experiment
with in an iterative development situation, by assigning a large cost
to those experiments: the conceptually small change requires too large
of a ripple of collateral changes so that the program continues to
compile, build and run. Insulating modules to minimize their
dependencies requires a bit of know how, and also the development of
various shims which clutter the program because they exist only for
the sake of that insulation.

The only part of your idea that benefits from C++ is the actual
simulation of the propagation of sound waves in the given given
geometry. This could be encapsulated as a library with some well-
defined binary interface: data types for communicating the model to
the library, functions for setting up the simulation paramters and
doing the simulation, and ways of obtaining the results in some given
representation, possibly with real-time feedback.

The rest of the surrounding software could be done up in some dynamic
language that has a decent GUI toolkit and a foreign-function calling
capability.

Another thing to consider is how much existing software could you
reuse. There is already software out there which can create three-
dimensional models and export them in some known format that other
programs can parse. That could be good enough for creating the
geometry for these sound wave simulations. I understand that the
objects in the model have to be attributed with additional properties
related to acoustics, but maybe some modelling programs have a way to
represent that with some user-defined generic attributes that can be
attached to the model elements.


这篇关于如何启动C ++软件项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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