如何制定计划如何实施?

编程入门 行业动态 更新时间:2024-10-26 08:29:03
本文介绍了如何制定计划如何实施?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个问题。我正在学习如何使用c ++语言。我已经尝试使用我所掌握的知识制作自己的程序,但是有时当我遇到编写代码时,我花了很长时间 来弄清楚我应该做些什么。例如,我正在写一个程序 ,它告诉你所有的素数都小于你在控制台输入的的数字。这是一个非常短的程序,但是在成功编写代码时我花了一个 。然后我觉得我卡住的原因是我开始编写代码而没有任何计划。 我只是坐在电脑前,开始编写代码。 我听说有些人知道如何制定一个全面的计划,让他在实际开始写作之前想要实现他的代码。我听说 关于绘制流程图,然后有人说流程图不是一个大型程序的有效方法。 可以告诉任何人我是多么经验丰富的程序员用他的计划来编写他的代码,因此在他编写代码时,他被卡住的可能性更小? ? /> 非常感谢,祝你有个美好的一天。

Hi, I have a question. I am learning about how to use c++ language. I have attempted to make my own programs, using the knowledge that I have, but sometimes when I get stuck on writing a code, it took me a long time to figure out what I should do. For instance, I was writing a program which tells you all the prime numbers that are less than the number you input on the console. It was a very short program, but it took me a while to write the code successfully. Then I thought that the reason why I got stuck was that I started writing the code without having any plan. I just sat down in front of the computer, and started writing the code. I heard that some people knows how to make a over-all plan of how he wants to implement his code before he actually starts writing. I heard about drawing a flowchart, then somebody said that a flowchart is not an effective way for a large program. Could anybody tell me how more experienced programer makes his plan for writing his code, so that there is less chance that he gets stuck while he''s writing his code? Thank you very much, and have a good day.

推荐答案

2003年9月5日星期五09: 35:36 GMT,takashi< tw ****** @ telus>写道: On Fri, 05 Sep 2003 09:35:36 GMT, takashi <tw******@telus> wrote: 我有一个问题。我正在学习如何使用c ++语言。我已经尝试使用我拥有的知识制作自己的程序,但有时当我遇到编写代码时,我花了很长时间才弄清楚我是什么应该做。例如,我正在编写一个程序,它告诉你所有的素数小于你在控制台上输入的数字。这是一个非常短的程序,但在成功编写代码时我花了一个。然后我认为我被卡住的原因是我开始编写代码而没有任何计划。 制定计划总是一个好主意。 我只是坐在电脑前,开始编写代码。 就是这样。它对于这个目的是有好处的,因为它使得人们可以看到关系,并且它可以用于它,因为它不会强加任何约束。 ,所以可以代表意大利面条的任何和所有功能 代码。 但是出于同样的原因,这不是一个很好的代表开始 with:获得易于理解的代码,你需要的代码 比流程图更自然地限制自己;一种方法是 将自己限制在结构化编程中。 C ++的构造,例如 while,do,for,if-else。 尝试掌握算法等级,首先对应< $ / b $ b OO编程中的各个成员函数。 但请记住,当你进入更大的系统/更高级别时, 专注于执行流程通常是错误的事情。 任何人都可以告诉我更有经验的程序员如何制定他的计划来编写他的代码,这样他获得的机会就会减少在他写代码的时候卡住了吗? 这是一个以聪明的方式懒惰的问题... ;-) 不要决定不要做的事情还需要做出决定,因为那可能会让你陷入一条非常不理想的道路,在你没有足够的信息和理解的地方。明智的决定。 请关注可能的showstoppers。 除此之外,计划在很大程度上取决于具体的系统和 编码水平 - 功能,模块,类,包,系统...... 计划也很大程度上取决于谁制作它们以及谁我打算执行它们,并且与C ++作为一种语言没什么关系。 非常感谢,祝你有个美好的一天。 Hi, I have a question. I am learning about how to use c++ language. Ihave attempted to make my own programs, using the knowledge that I have,but sometimes when I get stuck on writing a code, it took me a long timeto figure out what I should do. For instance, I was writing a programwhich tells you all the prime numbers that are less than the number youinput on the console. It was a very short program, but it took me awhile to write the code successfully. Then I thought that the reason whyI got stuck was that I started writing the code without having any plan. Always a good idea to have a plan. I just sat down in front of the computer, and started writing the code.I heard that some people knows how to make a over-all plan of how hewants to implement his code before he actually starts writing. I heardabout drawing a flowchart, then somebody said that a flowchart is not aneffective way for a large program. That''s right, assuming that by "flowchart" you mean the usual "execution path flowchart". A flowchart is good for deducing what spaghetti code does, and that''s just about it. It''s good for that purpose because it makes the relationships visible to the eye, and it _can_ be used for that because it doesn''t impose any constraints, and so can represent any and all features of spaghetti code. But for the very same reason it''s not a good representation to start with: to obtain something that is easy to understand as code you need to constrain yourself much more than is natural with a flowchart; one way is to limit yourself to the "structured programming" constructs of C++, such as while, do, for, if-else. Try to master the level of algorithms and such first, corresponding to individual member functions in OO programming. But do keep in mind that as you progress to larger systems / higher levels, focusing on execution flow will generally be The Wrong Thing To Do. Could anybody tell me how more experienced programer makes his planfor writing his code, so that there is less chance that he gets stuckwhile he''s writing his code? It is a matter of being lazy in an intelligent way... ;-) Don''t decide things that don''t need to be decided yet, because that may lock you into a very suboptimal path at a point where you don''t have enough information and understanding to make an informed decision. Do focus on possible showstoppers, however. Other than that plans depend very much on the concrete system and on the level of coding -- function, module, class, package, system... Plans also depend very much on who makes them and who''s intended to execute them, and do not have very much to do with C++ as a language. Thank you very much, and have a good day.

Hth。无论如何

Hth. anyway

" takashi" < TW ****** @ telus>在消息中写道 新闻:INY5b.8876 "takashi" <tw******@telus> wrote in message news:INY5b.8876

kW.2449@edtnps84 ... kW.2449@edtnps84... 我有一个问题。我正在学习如何使用c ++语言。我已经尝试使用我拥有的知识制作自己的程序,但有时当我遇到编写代码时,我花了很长时间才弄清楚我是什么应该做。例如,我正在编写一个程序,它告诉你所有的素数小于你在控制台上输入的数字。这是一个非常短的程序,但在成功编写代码时我花了一个。然后我认为我被卡住的原因是我开始编写代码而没有任何计划。我只是坐在电脑前,开始编写代码。我听说有些人知道如何在他真正开始写作之前就如何实现他的代码制定一个全面的计划。我听说关于绘制流程图,然后有人说流程图不是大型程序的有效方法。 这是正确的,流程图对于大规模设计来说太原始​​了。 有些人使用一种叫做UML(通用建模语言)的东西。如果你有兴趣的话,那么很多很多书都有这个。 有人能告诉我更有经验的程序员如何制定他的计划来编写他的代码,这样他在写代码的时候就不太可能被卡住了?非常感谢你,祝你有个美好的一天。 Hi, I have a question. I am learning about how to use c++ language. I have attempted to make my own programs, using the knowledge that I have, but sometimes when I get stuck on writing a code, it took me a long time to figure out what I should do. For instance, I was writing a program which tells you all the prime numbers that are less than the number you input on the console. It was a very short program, but it took me a while to write the code successfully. Then I thought that the reason why I got stuck was that I started writing the code without having any plan. I just sat down in front of the computer, and started writing the code. I heard that some people knows how to make a over-all plan of how he wants to implement his code before he actually starts writing. I heard about drawing a flowchart, then somebody said that a flowchart is not an effective way for a large program. That''s correct, a flow chart is far too primitive for large scale design. Some people use something called UML (Universal Modelling Language). There are lots and lots of books on this if you are interested. Could anybody tell me how more experienced programer makes his plan for writing his code, so that there is less chance that he gets stuck while he''s writing his code? Thank you very much, and have a good day.

我很少计划。我所做的是定期查看我写的代码。如果 我觉得我陷入困境,我会回过头来看看我所写的内容和 如有必要,重写部分(或全部)代码我''到目前为止写的,学习 第一次出错的教训。我曾经读过一句话, 表示每个程序都可以从头开始重写,至少 一次,我同意这一点。 但是我不是想要提前计划,它的作品对很多人来说,它只是因为我不是很擅长它。我非常重视好的设计,它只是为我找到实现优秀设计的最好方法就是开始 编码。 John

I very rarely plan. What I do is regularly review the code I''ve written. If I feel that I''m getting bogged down I go back over what I have written and if necessary rewrite part (or all) of the code I''ve written so far, learning the lessons from what went wrong the first time. I read a quote once that said every program could benefit from being rewritten from scratch at least once, I agree with that. But I''m not trying to knock planning ahead, its works for many people, its just that I''m not very good at it. I value good design a great deal, its just that I find the best way for me to achieve good design is to start coding. John

更多推荐

如何制定计划如何实施?

本文发布于:2023-11-27 06:50:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637030.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:计划

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!