V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
mkdir
V2EX  ›  程序员

艺术品欣赏

  •  
  •   mkdir · 2022-03-03 17:15:38 +08:00 · 2369 次点击
    这是一个创建于 1003 天前的主题,其中的信息可能已经有所发展或是发生改变。
        var voList = []
        voList.add({
            "type": 1,
            "energyRiseMonth": energyRiseMonth.coalConsuRise,
            "energyRiseYear": energyRiseYear.coalConsuRise,
            "energyRankMonth": energyRankMonth1 != null ? energyRankMonth1.coalConsuRanking != null ? energyRankMonth1.coalConsuRanking : nullVal : nullVal,
            "energyRankRiseMonth": energyRankMonth1 != null ? energyRankMonth1.coalConsuRanking != null ? energyRankMonth1.coalConsuRanking - 
            (energyRankRiseMonth1 != null ? (energyRankRiseMonth1.coalConsuRanking != null ? energyRankRiseMonth1.coalConsuRanking : 0) : 0 ): nullVal : nullVal,
            "energyRankYear": energyRankYear1 != null ? energyRankYear1.coalConsuRanking != null ? energyRankYear1.coalConsuRanking : nullVal : nullVal,
            "energyRankRiseYear":energyRankYear1 != null ? energyRankYear1.coalConsuRanking != null ? energyRankYear1.coalConsuRanking - 
            (energyRankRiseYear1 != null ? (energyRankRiseYear1.coalConsuRanking != null ? energyRankRiseYear1.coalConsuRanking : 0) : 0) : nullVal : nullVal
        });
        voList.add({
            "type": 2,
            "energyRiseMonth": energyRiseMonth.growPowerConsuRise,
            "energyRiseYear": energyRiseYear.growPowerConsuRise,
            "energyRankMonth": energyRankMonth2 != null ? energyRankMonth2.growPowerConsuRanking != null ? energyRankMonth2.growPowerConsuRanking : nullVal: nullVal,
            "energyRankRiseMonth": energyRankMonth2 != null ? energyRankMonth2.growPowerConsuRanking != null ? energyRankMonth2.growPowerConsuRanking - 
            (energyRankRiseMonth2 != null ? (energyRankRiseMonth2.growPowerConsuRanking != null ? energyRankRiseMonth2.growPowerConsuRanking : 0) : 0) : nullVal: nullVal ,
            "energyRankYear": energyRankYear2 != null ? energyRankYear2.growPowerConsuRanking != null ? energyRankYear2.growPowerConsuRanking : nullVal : nullVal,
            "energyRankRiseYear": energyRankYear2 != null ? energyRankYear2.growPowerConsuRanking != null ? energyRankYear2.growPowerConsuRanking - 
            (energyRankRiseYear2 != null ? (energyRankRiseYear2.growPowerConsuRanking != null ? energyRankRiseYear2.growPowerConsuRanking : 0) : 0) : nullVal : nullVal
        });
        voList.add({
            "type": 3,
            "energyRiseMonth": energyRiseMonth.cookedPowerConsuRise,
            "energyRiseYear": energyRiseYear.cookedPowerConsuRise,
            "energyRankMonth": energyRankMonth3 != null ? energyRankMonth3.cookedPowerConsuRanking != null ? energyRankMonth3.cookedPowerConsuRanking : nullVal : nullVal,
            "energyRankRiseMonth": energyRankMonth3 != null ? energyRankMonth3.cookedPowerConsuRanking != null ? energyRankMonth3.cookedPowerConsuRanking
             - (energyRankRiseMonth3 != null ? (energyRankRiseMonth3.cookedPowerConsuRanking != null ? energyRankRiseMonth3.cookedPowerConsuRanking : 0) : 0) : nullVal : nullVal ,
            "energyRankYear": energyRankYear3 != null ? energyRankYear3.cookedPowerConsuRanking != null ? energyRankYear3.cookedPowerConsuRanking : nullVal : nullVal,
            "energyRankRiseYear":energyRankYear3 != null ? energyRankYear3.cookedPowerConsuRanking != null ? energyRankYear3.cookedPowerConsuRanking - 
            (energyRankRiseYear3 != null ? (energyRankRiseYear3.cookedPowerConsuRanking != null ? energyRankRiseYear3.cookedPowerConsuRanking : 0) : 0) : nullVal : nullVal
        });
    
    11 条回复    2022-03-04 22:32:34 +08:00
    fgwmlhdkkkw
        1
    fgwmlhdkkkw  
       2022-03-03 17:52:12 +08:00   ❤️ 1
    可能别人是用模板生成的呢,也说不定
    ljpCN
        2
    ljpCN  
       2022-03-03 17:53:26 +08:00
    有生之年能看到这样的代码真是我的荣幸。
    7Qi7Qi
        3
    7Qi7Qi  
       2022-03-03 17:56:31 +08:00
    代码 kpi
    tomato3
        4
    tomato3  
       2022-03-03 18:04:45 +08:00
    血压上来了
    yuruizhe
        5
    yuruizhe  
       2022-03-03 19:13:10 +08:00
    嵌套三元表达式,毫无简洁可言
    bthulu
        6
    bthulu  
       2022-03-04 08:41:17 +08:00
    这个很简洁啊, 不都是推荐这种么? 这么多嵌套三元表达式, 改成 if 语句你想想得嵌套多少层, 这都扁平化了还不好么
    ciddechan
        7
    ciddechan  
       2022-03-04 09:56:52 +08:00
    a = abcdefg 后,他是复制一段然后改标号的?
    darkengine
        8
    darkengine  
       2022-03-04 11:21:06 +08:00
    别说了,昨天看到一段类似的 Android java 代码。。。
    DingJZ
        9
    DingJZ  
       2022-03-04 11:51:42 +08:00

    看起来是我司程序员跳槽了
    alexmy
        10
    alexmy  
       2022-03-04 12:14:28 +08:00
    @DingJZ 我这有段代码的的 ? : 能嵌套 10 个以上,而且判断条件也很复杂充满了 if 。

    接手的人看的真是一把辛酸泪,连夜改了。
    touzi1024
        11
    touzi1024  
       2022-03-04 22:32:34 +08:00
    你小子放我代码干嘛,来我办公室一趟—_—
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2670 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 07:25 · PVG 15:25 · LAX 23:25 · JFK 02:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.