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
 
up duan  
View profile   Translate to Translated (View Original)
 More options Sep 22 2009, 12:23 am
From: up duan <fixo...@gmail.com>
Date: Tue, 22 Sep 2009 12:23:50 +0800
Local: Tues, Sep 22 2009 12:23 am
Subject: Re: [TL] Re: {技术}代码的坏味道——你们的项目有这些问题吗?

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

> 除了rename 重构在这个项目中远远不够之外, 其他几个方面, 我都同意你的看法.

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

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

呵呵,主要是我不太适合复杂的场合【可以认为是脑容量有点小:)】,所以我觉得rename以后,能极大的提升我的理解复杂方案的能力,因为改的都是我自己的风 格,对我来说统一、一致。比如:Pre*
Post* Begin* End* Start* Stop* Open* Close* Active* Deactive* Parse ToString
Draw ……等,让我能够花费很小的脑力就能知道它在干什么。
是的,大多数情况下,单纯的rename是不够的,但是我认为单纯的rename已经能解决很多问题了,更何况我还有金山词霸在手边帮我找一个自认为最且贴的名 字:)。
嗯,对我来说,重构也是一种帮助我理解原有代码的手段,一段代码被我重构了以后,我也就大致理解了它的结构。
最痛苦的事情莫过于C++的重构,很难有比较好的工具支持【顺便鼓吹一下SlickEdit,它支持C++重构】,而没有工具支持,纯手工重构不但效率低,还容 易出错。据说由于C++的语法太丑陋和难于解析了,所以很难写出一个C++的重构工具。

 
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.