如何实际编写程序? [英] How to actually write a program?

查看:89
本文介绍了如何实际编写程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我一直在学习编码(python是我在一些BASIC之后研究过的第二种语言)。我真正想知道的是

,如果你打算实际编写一个程序或某种类型的项目,

你是如何实际开始的。


想象一下,你知道你想要程序做什么(它的功能),你

对程序的工作原理有一个大概的了解。你打开了一个

空的文本文件并将其保存为''mykewlprogram.py'',现在你坐在空文本文件前面的

...现在然后....我从哪里开始。


关于这个问题的任何想法:-)


Ta

Nick

Hello there,
I have been on and off learning to code (with python being the second
language I have worked on after a bit of BASIC). What I really want to know
is, if you are going to actually write a program or a project of some sort,
how do you actually start.

Picture this, you know what you want the program to do (its features), you
have a possably rough idea of how the program will work. You have opened an
empty text file and saved it as ''mykewlprogram.py'' and now your sitting in
front of an empty text file... Now then.... where do I start.

Any ideas about this problem :-)

Ta
Nick

推荐答案

Nick Evans写道:
Nick Evans wrote:
你好,
我一直在学习代码(python是我在BASIC之后研究过的第二种语言)。我真正想知道的是,如果你要真正编写一个程序或某种项目,
你是如何开始的。

想象一下,你知道你想要程序做什么(它的功能),你对程序如何运作有一个大概的了解。你打开了一个
空文本文件并保存为''mykewlprogram.py'',现在你坐在空文本文件的前面......现在......我从哪里开始。

关于这个问题的任何想法: - )
Hello there,
I have been on and off learning to code (with python being the second
language I have worked on after a bit of BASIC). What I really want to know
is, if you are going to actually write a program or a project of some sort,
how do you actually start.

Picture this, you know what you want the program to do (its features), you
have a possably rough idea of how the program will work. You have opened an
empty text file and saved it as ''mykewlprogram.py'' and now your sitting in
front of an empty text file... Now then.... where do I start.

Any ideas about this problem :-)




关闭文件。打开test_mykewlprogram.py并开始编写单元测试。

http:// www .extremeprogramming.org /

当然答案比这要大得多。如此之大,我甚至不会试图更充分地回答它。 :)


Jp



Close the file. Open test_mykewlprogram.py and begin writing unit tests.

http://www.extremeprogramming.org/

The answer is much larger than this, of course. So large I''m not
even going to try to answer it more fully. :)

Jp


Nick Evans写道:
Nick Evans wrote:
你好,
我一直在学习编码(python是我在BASIC之后研究过的第二种语言)。我真正想知道的是,如果你要真正编写一个程序或某种项目,
你是如何开始的。

想象一下,你知道你想要程序做什么(它的功能),你对程序如何运作有一个大概的了解。你打开了一个
空文本文件并保存为''mykewlprogram.py'',现在你坐在空文本文件的前面......现在......我从哪里开始。

关于这个问题的任何想法: - )
Hello there,
I have been on and off learning to code (with python being the second
language I have worked on after a bit of BASIC). What I really want to know
is, if you are going to actually write a program or a project of some sort,
how do you actually start.

Picture this, you know what you want the program to do (its features), you
have a possably rough idea of how the program will work. You have opened an
empty text file and saved it as ''mykewlprogram.py'' and now your sitting in
front of an empty text file... Now then.... where do I start.

Any ideas about this problem :-)




当然,首先你要写一个测试。然后你运行它并确保它失败

(因为当然还没有其他代码存在)。然后你只需要编写足够的代码来通过测试。再次运行测试,并获得

通过。清理干净并重新开始......

http:/ /diveintopython.org/unit_testing/

http ://c2.com/cgi/wiki?TestDrivenDevelopment

http://www.amazon.com/exec/obidos/tg...24713?v=glance < > http://www.objectmentor.com/writeUps .. .venDevelopment

http:// www.agiledata.org/essays/tdd.html

http://groups.yahoo.com/group/testdrivendevelopment/

http://www.testdriven.com/


等......


-Peter



Sure, first you write a test. Then you run it and make sure it fails
(because of course no other code exists yet). Then you write just
enough code to pass the test. Run the test again, and get it to
pass. Clean things up and go back to the start...

http://diveintopython.org/unit_testing/

http://c2.com/cgi/wiki?TestDrivenDevelopment

http://www.amazon.com/exec/obidos/tg...24713?v=glance

http://www.objectmentor.com/writeUps...venDevelopment

http://www.agiledata.org/essays/tdd.html

http://groups.yahoo.com/group/testdrivendevelopment/

http://www.testdriven.com/

etc...

-Peter


作曲家怎么样?写一首歌?他可能会知道这首歌的整体声音,所以他可能会先用钢琴演奏。然后他可能会在弦乐部分上演奏

,以及一般的和弦进程。然后添加一些

woodwinds,逐个构建歌曲,直到所有小部件

组装到一个更大的整体。


编写程序也不例外。你必须首先打破你的歌曲

部分。这是一个非常有创意的过程,而且它不是可以教授的东西。找到一个漂亮,安静的房间,当你不被任何事情分散注意力的时候。想想更大的问题,并尝试将它分成更小的部分。这个部门是

编程中最难的部分;在代码中表达这些想法变得和演讲一样自然

与练习。经过一番反思,你的道路应该变得清晰。


2004年9月3日星期五09:29:36 + 00 + 00,Nick Evans写道:
How does a composer write a song? He might know the overall sound of the
song, so he might start by playing it on a piano. Then he might work on
the strings part, and a general chord progression. Then add some
woodwinds, building the song piece by piece until all the small parts
are assembled to a greater whole.

Writing a program is no different. You must first break your song in to
parts. It''s a highly creative process, and it''s not something that can
be taught. Find yourself a nice, quiet room, and a time when you arn''t
distracted by anything. Think of the greater problem and try to divide
it into smaller pieces. This division is the hardest part of
programming; expressing the ideas in code becomes as natural as speech
with practice. After some reflection your path should become clear.

On Fri, Sep 03, 2004 at 09:29:36PM +0000, Nick Evans wrote:
你好那里,
我一直在学习编码(python是我在BASIC之后研究过的第二种语言)。我真正想知道的是,如果你要真正编写一个程序或某种项目,
你是如何开始的。

想象一下,你知道你想要程序做什么(它的功能),你对程序如何运作有一个大概的了解。你打开了一个
空文本文件并保存为''mykewlprogram.py'',现在你坐在空文本文件的前面......现在......我从哪里开始。

关于这个问题的任何想法:-)

尼克
Hello there,
I have been on and off learning to code (with python being the second
language I have worked on after a bit of BASIC). What I really want to know
is, if you are going to actually write a program or a project of some sort,
how do you actually start.

Picture this, you know what you want the program to do (its features), you
have a possably rough idea of how the program will work. You have opened an
empty text file and saved it as ''mykewlprogram.py'' and now your sitting in
front of an empty text file... Now then.... where do I start.

Any ideas about this problem :-)

Ta
Nick



这篇关于如何实际编写程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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