V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
cloudzhou
V2EX  ›  Python

动态语言的重构怎么做?

  •  
  •   cloudzhou · Feb 3, 2013 · 4200 views
    This topic created in 4843 days ago, the information mentioned may be changed or developed.
    在编译类型的语言,比如java,如果要重构,设计到大量的方法名,类,变量名变更,借助ide,和编译的预检查,能解决很多问题,如果面对脚本语言呢?
    举个最简单的例子,改变一个对象变量的名字,如果知道其他对应的修改呢?
    2 replies    1970-01-01 08:00:00 +08:00
    Kymair
        1
    Kymair  
       Feb 3, 2013
    1. 覆盖率足够的测试?
    2. 好的IDE例如JetBrains对于动态语言的重构也是支持的挺不错的,当然没办法做到静态语言那么准确.
    yuelang85
        2
    yuelang85  
       Feb 4, 2013
    同 @Kymair

    这个需要靠足够覆盖率的自动化测试。

    pycharm的重构支持也不错。

    但是基于动态语言特点,这个真的很难。之前曾经找过python的静态分析的方法,无果。后来王垠说正在开发python的类似静态分析的工具,但是随着他离开google,也没什么下文了。。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2977 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 12:12 · PVG 20:12 · LAX 05:12 · JFK 08:12
    ♥ Do have faith in what you're doing.