推荐学习书目
› 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
dreamm
V2EX  ›  Python

问下 V 站大佬们,创建数据库,字段会写 comment 吗

  •  
  •   dreamm · Oct 22, 2019 · 3841 views
    This topic created in 2537 days ago, the information mentioned may be changed or developed.

    入职新公司,在老项目上继续开发,所有表都没有 comment,而且有的字段定义也不是很清晰,想看具体字段含义还得看数据库,甚至需要在 chrome 中 F12 根据响应数据和页面来看,这样正常么?

    9 replies  •  2019-11-04 15:28:17 +08:00
    Joyboo
        1
    Joyboo  
       Oct 22, 2019
    不正常,这种情况的代码大概率是买的外包代码进行二次开发的,简称 屎堆
    wooke
        2
    wooke  
       Oct 22, 2019
    mssql 创建 comment 很麻烦,所以我基本都不写注释。
    fuyufjh
        3
    fuyufjh  
       Oct 22, 2019
    正常,大部分代码的质量都只是能跑而已
    dreamm
        4
    dreamm  
    OP
       Oct 22, 2019
    @Joyboo 不是外包,只是项目所有的表,没有一条 comment。。我觉得对于接手的人很不友好了。
    dreamm
        5
    dreamm  
    OP
       Oct 22, 2019
    @wooke 不麻烦吧?从建表来说,不管用 DDL 还是 ORM,加个 comment 就可以啊,你说的麻烦是指哪个层面?
    dreamm
        6
    dreamm  
    OP
       Oct 22, 2019
    @fuyufjh 有一说一代码质量还是可以的,但是就 comment 这个问题,每次在之前的表上做新需求,就很麻烦
    javen73
        7
    javen73  
       Oct 23, 2019
    肯定写
    zhengyao6
        8
    zhengyao6  
       Oct 23, 2019
    还是要写的吧,建表的时候顺便写上也不麻烦
    wooke
        9
    wooke  
       Nov 4, 2019
    @dreamm 反正没有 mysql 方便,mysql 直接加在字段后面,mssql 还需要用单独的 sp 才行
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   810 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 22:22 · PVG 06:22 · LAX 15:22 · JFK 18:22
    ♥ Do have faith in what you're doing.