senooken JP Social
  • FAQ
  • Login
senooken JP Socialはsenookenの専用分散SNSです。
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. ぽんず (anzumuemue@qiitadon.com)'s status on Monday, 22-Oct-2018 17:44:38 JST ぽんず ぽんず

    なんかやたらトリッキーなコードを書く人がいるんですよね…。

    2~1000まで偶数だけを使った、という場合って
    for i in range(2, 10000, 2):
    とか真っ先に浮かぶのに
    for i in range(2, 10000)[0::2]:
    ってやったり…。
    ジェネレータだから処理速度も使用メモリも変わらないけど…。

    みなさんはどんなトリッキーなコードを見たことありますか?

    In conversation Monday, 22-Oct-2018 17:44:38 JST from qiitadon.com permalink
    • 7of9(0x70f9=28921) and カバ repeated this.
    • 7of9(0x70f9=28921) (7of9@qiitadon.com)'s status on Monday, 22-Oct-2018 18:20:14 JST 7of9(0x70f9=28921) 7of9(0x70f9=28921)
      in reply to

      @anzu_muemue

      C++の継承を使った実装で、継承を使ったがためにベースクラスが神クラス化した
      程度です。

      自分は継承を安易に使わないようにしています(勉強不足というのもあります)。

      In conversation Monday, 22-Oct-2018 18:20:14 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

senooken JP Social is a social network, courtesy of senooken. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All senooken JP Social content and data are available under the Creative Commons Attribution 3.0 license.