
技能施法前摇: 天灵灵,地灵灵,import 和 namespace 快显灵
在 github 看代码的时候,通常第一屏都是 import 和 namespace ,这时候感觉就像程序员作为老在念技能施法前摇。
1 ggabc 337 天前 via Android 技术手段解决不了了确实得施法,当然万能重启也是施法之一 |
2 SchwarzeR 337 天前 技能要吟唱才能施法 就像变量要要先声明在引用一下 For example: ``` const FireMagic = new Magic( ``` よりく より暗き漆に 我が真の混交を望みう 醒の来たれり の境界に落ちし理 むぎょうの歪みとなりて出せよ!! 踊れ、踊れ、踊れ! 我が力の奔流に望むは 崩なり ぶものなき崩なり! 万象等しく灰にきし 深より来たれ! これが、人最大の威力の攻手段! これこそが!究の攻魔法! ``` ) FireMagic.Expolosion() ``` |
3 IvanLi127 337 天前 天尊在上,地在下,三清圣人,诸天神明,今我奉天命,恭请诸位神灵降临,助我一臂之力,愿以诚心恭敬,施行法事,普度众生。 |
4 wenerme OP Java 还有专属技能前摇: XyzController - XyzService - XyzServiceImpl - XyzDao - XyzDTO |
5 sampeng 337 天前 好主意。我这就去改我的 cursor 。看能不能让他用这个风格跟我对话 |
6 wenerme OP @SchwarzeR 哈哈哈哈,这个架势让我想起 Python 的前摇,和一般的前摇不一样 ``` class FastAPI(Starlette): """ 技能前摇开始 """ 开始施法 ``` ``` class BackgroundTasks(StarletteBackgroundTasks): """ A collection of background tasks that will be called after a response has been sent to the client. Read more about it in the [FastAPI docs for Background Tasks]( https://fastapi.tiangolo.com/tutorial/background-tasks/). ## Example ```python from fastapi import BackgroundTasks, FastAPI app = FastAPI() def write_notification(email: str, message=""): with open("log.txt", mode="w") as email_file: cOntent= f"notification for {email}: {message}" email_file.write(content) @app.post("/send-notification/{email}") async def send_notification(email: str, background_tasks: BackgroundTasks): background_tasks.add_task(write_notification, email, message="some notification") return {"message": "Notification sent in the background"} ``` """ def add_task( ``` |
7 securityCoding 337 天前 go 的前摇很短,go mod tidy~ |
8 xiyuesaves 337 天前 那安装环境是不是在画召唤阵/符纸 hhhhh |
9 dcdlove 337 天前 DO MO KE SA LA MO JI BU KAI YI FU LI SI JIE MA GAI YI GE RU JIA XIA HA LA DUO KU XI DUO |
10 wenerme OP @securityCoding `go mod tidy` 最多相当于擦拭法器,但 go 的咒语通常只有一句,但是非常长,类似 天灵灵灵灵灵灵灵灵。 ``` import ( "灵" "灵" "灵" "灵" "灵" ) ``` |
12 kanepan19 337 天前 op 理解的写代码施法前摇 : 天灵灵,地灵灵,import 和 namespace 快显灵 我理解的写代码施法前摇 : 摸鱼一上午 |
13 ppddtt 337 天前 @wenerme 前摇太小,XyzController -> XyzControllerImpl -> XyzApplicationService -> XyzApplicationServiceImpl -> XyzDomainService -> XyzDomainServiceImpl -> XyzRepository -> XyzRepositoryImpl -> XyzMapper |
15 w568w 337 天前 #include 算不算请神上身 |
16 handsome50 337 天前 我直接 ctrl C+ctrl V ,法术瞬发 |
17 csys 337 天前 那叫依赖 你喝水之前要先有杯子 写字之前要先有笔 什么天灵灵地灵灵……这是智人该有的思路吗 |
18 wenerme OP |