ShenYou666
V2EX  ›  问与答

有没有为起一个好的变量名犯难!

  •  
  •   ShenYou666 · Oct 5, 2019 · 2933 views
    This topic created in 2437 days ago, the information mentioned may be changed or developed.

    经常为了一个好的变量名犹豫不决,有时候英文直译过来太长了(或者是方法不对),如果起一个拼音被其他人看到会觉得实力太低端,我太难了,有没有好的方法请教一个~~

    8 replies    2019-10-06 16:37:41 +08:00
    loading
        1
    loading  
       Oct 5, 2019   ❤️ 3
    3K1yf6UvnVz5w008
        2
    3K1yf6UvnVz5w008  
       Oct 5, 2019
    同问。
    copymaster
        3
    copymaster  
       Oct 5, 2019 via iPad   ❤️ 2
    "There are only two hard things in Computer Science: cache invalidation and naming things" - Phil Karlton
    ech0x
        4
    ech0x  
       Oct 5, 2019 via iPhone
    @copymaster 我刚刚也想回复这个😂😂
    ShenYou666
        5
    ShenYou666  
    OP
       Oct 5, 2019 via Android
    @loading 刚才玩了下的确好用,谢谢大佬
    taotaodaddy
        6
    taotaodaddy  
       Oct 6, 2019 via Android
    这可是编程届两大难题之一
    comwrg
        7
    comwrg  
       Oct 6, 2019
    那就写长一点啊 总比自创的缩写强
    Orenoid
        8
    Orenoid  
       Oct 6, 2019
    先确保能被读懂,再考虑短,如果上下文逻辑复杂或者跨度大,可以考虑把语境和状态带进变量名里
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3000 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 14:30 · PVG 22:30 · LAX 07:30 · JFK 10:30
    ♥ Do have faith in what you're doing.