艺术品欣赏

2022-03-03 17:15:38 +08:00
 mkdir
    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
    });
2393 次点击
所在节点    程序员
11 条回复
fgwmlhdkkkw
2022-03-03 17:52:12 +08:00
可能别人是用模板生成的呢,也说不定
ljpCN
2022-03-03 17:53:26 +08:00
有生之年能看到这样的代码真是我的荣幸。
7Qi7Qi
2022-03-03 17:56:31 +08:00
代码 kpi
tomato3
2022-03-03 18:04:45 +08:00
血压上来了
yuruizhe
2022-03-03 19:13:10 +08:00
嵌套三元表达式,毫无简洁可言
bthulu
2022-03-04 08:41:17 +08:00
这个很简洁啊, 不都是推荐这种么? 这么多嵌套三元表达式, 改成 if 语句你想想得嵌套多少层, 这都扁平化了还不好么
ciddechan
2022-03-04 09:56:52 +08:00
a = abcdefg 后,他是复制一段然后改标号的?
darkengine
2022-03-04 11:21:06 +08:00
别说了,昨天看到一段类似的 Android java 代码。。。
DingJZ
2022-03-04 11:51:42 +08:00

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

接手的人看的真是一把辛酸泪,连夜改了。
touzi1024
2022-03-04 22:32:34 +08:00
你小子放我代码干嘛,来我办公室一趟—_—

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/837755

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX