新人入职,上午写了一段代码,下午就被开除了

1

有一个程序员,入职了一家公司,上午刚刚写下一段代码,没想到下午就有人事来通知他被开除了。

640?wx_fmt=jpeg

这个程序员表示很委屈。感觉这个方法,除了性能差一点,没啥别的问题呀。。。

2

除了获取时间以外,一位程序员因为自己写了个排序算法,也被开除了。

640?wx_fmt=jpeg


3

统计用户总数,这代码还真是666呢。

640?wx_fmt=jpeg

4

前段时间网传的价值一个亿的AI核心代码,你能看出其中的端倪吗?

640?wx_fmt=jpeg

5

甩锅侠了解一下。

640?wx_fmt=jpeg

6

英语不够,拼音来凑。

public void shit(){    // 本身逻辑没什么问题,就这个命名,中英混合    // 工作流中的 直接办理到结束节点    // 节点类型是【办到底】    boolean isbandaodi = confirmMenuindexOfActivityName(processdefinitionid, nextNodeName, "bandaodi");    if (isbandaodi) {        // 。。。    }}
    // 本身逻辑没什么问题,就这个命名,中英混合
    // 工作流中的 直接办理到结束节点
    // 节点类型是【办到底】
    boolean isbandaodi = confirmMenuindexOfActivityName(processdefinitionid, nextNodeName, "bandaodi");
    if (isbandaodi) {
        // 。。。
    }
}


7

下面这段代码的作者所在的公司,该不会是按代码行数开工资的吧?

640?wx_fmt=jpeg

8

最后,下面这段代码,看懂算我输。

 
 
//Stream 用的66的final EventAction eventAction = redisObj(    EventActionKey + distributionEventId,    () -> Optional            .of(distributionEventId)            .map(eventId -> {                final EventActionExample example = new EventActionExample();                example.createCriteria()                        .andEventIdEqualTo(eventId)                        .andTriggerTypeEqualTo(EnumEventTriggerType.DISTRIBUTION_PURCHASE.getCode().byteValue());                return example;            })            .map(eventActionMapper::selectByExample)            .filter(StringUtil::isNotEmpty)            .map(e -> e.get(0)).orElseThrow(() -> ExceptionUtil.createParamException("事件触发信息不存在"))    , EventAction.class);final AwardConfig awardConfig = redisObj(EventConfigKey + eventAction.getId(),    () -> Optional.ofNullable(eventAction.getId())            .map(actionId -> {                final AwardConfigExample example = new AwardConfigExample();                example.createCriteria()                        .andActionIdEqualTo(actionId);                return example;            })            .map(awardConfigMapper::selectByExample)            .filter(StringUtil::isNotEmpty)            .map(e -> e.get(0)).orElseThrow(() -> ExceptionUtil.createParamException("xxx")),    AwardConfig.class);Optional.of(req)    .map(e -> e.clueUid)    .map(id -> {        final ClueExample example = new ClueExample();        example.createCriteria()                .andClueUidEqualTo(id)                .andDeletedEqualTo(false)                .andReceivedEqualTo(false)                .andCreateTimeGreaterThan(now - cluetime);        example.setOrderByClause("create_time asc");        return example;    })  // 获取该被邀请人所有未过期且未被领取的线索的线索    .map(clueMapper::selectByExample)    .filter(StringUtil::isNotEmpty)    .ifPresent(clues -> {                final ClueResp clueResp = Optional.of(req)                        .filter(c -> {                            c.count = clues.size();                            return true;                        })                        .map(this::awardValue)                        .orElseThrow(() -> ExceptionUtil.createParamException("参数错误"));                final Integer specialId = req.getIsHead()                        ? clues.get(0).getId()                        : clues.get(clues.size() - 1).getId();                clues.stream()                        .peek(clue -> {                            final AwardConfig awardConfigclone = Optional.of(awardConfig)                                    .map(JSONUtil::obj2Json)                                    .map(json -> JSONUtil.json2Obj(json, AwardConfig.class))                                    .orElseGet(AwardConfig::new);                            awardConfigclone.setMoney(                                    Optional.of(clue.getId())                                            .filter(specialId::equals)                                            .map(e -> clueResp.specialReward.longValue())                                            .orElse(clueResp.otherAverageReward.longValue())                            );                            eventActionService.assembleAward(                                    awardConfigclone,                                    clue.getAdviserUid(),                                    clue.getAdviserUid(),                                    clue.getClueUid(),                                    eventAction,                                    new PasMessageParam(),                                    clue.getId(),                                    AwardRelationType.Clud.code()                            );                        })                        .forEach(clue -> {                            clue.setOrderNo(req.orderNo);                            clue.setCommodityName(req.commodityName);                            clue.setOrderAmount(req.orderAmount);                            clue.setReceived(true);                            clue.setModifyTime(now);                            clueMapper.updateByPrimaryKeySelective(clue);                        });            }    );
final EventAction eventAction = redisObj(
    EventActionKey + distributionEventId,
    () -> Optional
            .of(distributionEventId)
            .map(eventId -> {
                final EventActionExample example = new EventActionExample();
                example.createCriteria()
                        .andEventIdEqualTo(eventId)
                        .andTriggerTypeEqualTo(EnumEventTriggerType.DISTRIBUTION_PURCHASE.getCode().byteValue());
                return example;
            })
            .map(eventActionMapper::selectByExample)
            .filter(StringUtil::isNotEmpty)
            .map(e -> e.get(0)).orElseThrow(() -> ExceptionUtil.createParamException("事件触发信息不存在"))
    , EventAction.class);
final AwardConfig awardConfig = redisObj(EventConfigKey + eventAction.getId(),
    () -> Optional.ofNullable(eventAction.getId())
            .map(actionId -> {
                final AwardConfigExample example = new AwardConfigExample();
                example.createCriteria()
                        .andActionIdEqualTo(actionId);
                return example;
            })
            .map(awardConfigMapper::selectByExample)
            .filter(StringUtil::isNotEmpty)
            .map(e -> e.get(0)).orElseThrow(() -> ExceptionUtil.createParamException("xxx")),
    AwardConfig.class
);
Optional.of(req)
    .map(e -> e.clueUid)
    .map(id -> {
        final ClueExample example = new ClueExample();
        example.createCriteria()
                .andClueUidEqualTo(id)
                .andDeletedEqualTo(false)
                .andReceivedEqualTo(false)
                .andCreateTimeGreaterThan(now - cluetime);
        example.setOrderByClause("create_time asc");
        return example;
    })  // 获取该被邀请人所有未过期且未被领取的线索的线索
    .map(clueMapper::selectByExample)
    .filter(StringUtil::isNotEmpty)
    .ifPresent(clues -> {
                final ClueResp clueResp = Optional.of(req)
                        .filter(c -> {
                            c.count = clues.size();
                            return true;
                        })
                        .map(this::awardValue)
                        .orElseThrow(() -> ExceptionUtil.createParamException("参数错误"));
                final Integer specialId = req.getIsHead()
                        ? clues.get(0).getId()
                        : clues.get(clues.size() - 1).getId();
                clues.stream()
                        .peek(clue -> {
                            final AwardConfig awardConfigclone = Optional.of(awardConfig)
                                    .map(JSONUtil::obj2Json)
                                    .map(json -> JSONUtil.json2Obj(json, AwardConfig.class))
                                    .orElseGet(AwardConfig::new);
                            awardConfigclone.setMoney(
                                    Optional.of(clue.getId())
                                            .filter(specialId::equals)
                                            .map(e -> clueResp.specialReward.longValue())
                                            .orElse(clueResp.otherAverageReward.longValue())
                            );
                            eventActionService.assembleAward(
                                    awardConfigclone,
                                    clue.getAdviserUid(),
                                    clue.getAdviserUid(),
                                    clue.getClueUid(),
                                    eventAction,
                                    new PasMessageParam(),
                                    clue.getId(),
                                    AwardRelationType.Clud.code()
                            );
                        })
                        .forEach(clue -> {
                            clue.setOrderNo(req.orderNo);
                            clue.setCommodityName(req.commodityName);
                            clue.setOrderAmount(req.orderAmount);
                            clue.setReceived(true);
                            clue.setModifyTime(now);
                            clueMapper.updateByPrimaryKeySelective(clue);
                        });
            }
    );

参考资料:

https://gitee.com/oschina/bullshit-codes/tree/master/java


有道无术,术可成;有术无道,止于术

欢迎大家关注Java之道公众号

640?wx_fmt=png

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值