推荐学习书目
› 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 · 3929 views
    This topic created in 2570 days ago, the information mentioned may be changed or developed.

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

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