新人入职,上午写了一段代码,下午就被开除了
生活随笔
收集整理的這篇文章主要介紹了
新人入职,上午写了一段代码,下午就被开除了
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1
有一個程序員,入職了一家公司,上午剛剛寫下一段代碼,沒想到下午就有人事來通知他被開除了。
這個程序員表示很委屈。感覺這個方法,除了性能差一點,沒啥別的問題呀。。。
2
除了獲取時間以外,一位程序員因為自己寫了個排序算法,也被開除了。
3
統計用戶總數,這代碼還真是666呢。
4
前段時間網傳的價值一個億的AI核心代碼,你能看出其中的端倪嗎?
5
甩鍋俠了解一下。
6
英語不夠,拼音來湊。
public?void?shit(){????//?本身邏輯沒什么問題,就這個命名,中英混合????//?工作流中的?直接辦理到結束節點????//?節點類型是【辦到底】????boolean?isbandaodi?=?confirmMenuindexOfActivityName(processdefinitionid,?nextNodeName,?"bandaodi");????if?(isbandaodi)?{????????//?。。。????}}????//?本身邏輯沒什么問題,就這個命名,中英混合
????//?工作流中的?直接辦理到結束節點
????//?節點類型是【辦到底】
????boolean?isbandaodi?=?confirmMenuindexOfActivityName(processdefinitionid,?nextNodeName,?"bandaodi");
????if?(isbandaodi)?{
????????//?。。。
????}
}
7
下面這段代碼的作者所在的公司,該不會是按代碼行數開工資的吧?
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之道公眾號
總結
以上是生活随笔為你收集整理的新人入职,上午写了一段代码,下午就被开除了的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Git提交更新代码
- 下一篇: Docker容器日志集中收集(clien