• Which would you perfer? "easy and fast and works well" or "hard and time consuming and error prone"


    The usernames used to establish connections to servers are often specified in configuration files.


    In most project, the configuration items works in this way: 

    1.       Connection string for each server is configured respectively. (Take only username here for an instance)

    2.       Each environment has different connection string.

    Which turnout to be a matrix for just a username setting:

    Server 1

    Server 2

    Server 3

    DEV

    qauser

    qauser

    qauser

    QA

    qauser

    qauser

    qauser

    UAT

    qauser

    qauser

    qauser

    PROD

    produser

    produser

    produser

    As you may found, there are n*m username settings but actually only having two different values.

    Come on, that’s only for a username configuration. There could be about half hundreds of .properties file contains half thousands configuration items. But actually, most of them are duplicated.


    While, in theory, all those values might be different and as a result, it sounds good to be configured separately.

    Bull shit! Fucking your FUTURE potential possibilities. Those messy configuration items already bring a lot of big troubles for NOW. No one could figure out the usage of every items, no one willing to, and a small change may breaks everything. When you feel horrible with those messy files, it is already too late to make changes.

    Why the configuration items grows duplicates ? 

    Mostly because of those lazybones always adding a new configure item whenever they need something configurable. That’s easy and fast and works well.

    They don’t bother to go through all the existing configure items first to find out if what they need already added by someone else for a similar reason, they don’t bother to refactor the existing source code even if he find a proper configuration item but badly named. That’s hard and time consuming and error prone.

    As a developer, which way will you prefer to?

    As a manager, will you lead developers to the right way and given them enough buffer for that way? Or just push the poor developers harder and harder without noticing the consequences might come. 

    In fact, any change facing those kinds of choices. 

  • 相关阅读:
    Linux下绑定网卡的操作记录
    迭代器、生成器、装饰器
    python二模块之装饰器
    python实现 --工资管理系统
    投票接口压测
    Mysql exists和in
    Django处理一个请求的过程
    快速排序 Python实现
    宿主机访问ubuntu虚拟机内的Django应用,访问不到的解决办法
    四、Git分支管理
  • 原文地址:https://www.cnblogs.com/nankezhishi/p/choiceofcodechanges.html
Copyright © 2020-2023  润新知