Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion {技术}代码的坏味道——你们的项目有这些问题吗?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
肖海彤  
View profile   Translate to Translated (View Original)
 More options Sep 22 2009, 12:07 am
From: 肖海彤 <red...@gmail.com>
Date: Mon, 21 Sep 2009 21:07:08 -0700 (PDT)
Local: Tues, Sep 22 2009 12:07 am
Subject: Re: {技术}代码的坏味道——你们的项目有这些问题吗?
除了rename 重构在这个项目中远远不够之外, 其他几个方面, 我都同意你的看法.

这个项目中, 面临的问题是, 程序结构太复杂, 已经理解不了了, 不但新功能很难加, 旧 bug 也很难调试了. 所以不得不大动干戈.

我的方法是分步走, 全局变量先弄成类静态变量, ok 了, 再转成普通成员变量,  ok 了, 再看看要不要加访问控制.  改一点就编译跑一
跑, 好在现在的 cpu  比前几年快不少.

On Sep 22, 11:50 am, up duan <fixo...@gmail.com> wrote:

> 就我的经验,简简单单的rename重构,就能极大地改善很多代码的质量,尤其是有一个良好的命名规范的时候。而且风险奇小。
> 重复代码的合并风险还是挺大的,反倒是长函数分拆风险很小。
> 取消全局变量一般来说都是个大动作,很有可能导致内部接口连锁式修改。

> 2009/9/22 肖海彤 <red...@gmail.com>

> > 问题是, 原来有一半的代码是通过全局变量来耦合的,  这些 .cpp 几乎引用所有的 .h;  完成同样的功能的代码, 每个地方各写一份; 超
> > 过 800行的函数有不少个,   我是想不出可以怎么写测试代码了 :)

> > 我只能当所有的 .cpp 是一个单元, 所有的上层脚本是我的测试代码了.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.