openlang
讨论编程语言的论坛

这段代码你会怎么写?

同一个问题,往往不止一种解法。看看代码,也看看背后的理由。

按语言浏览

你对什么感兴趣?

全部话题 ↗
  1. 01

    构建、包管理与配置

    依赖、构建脚本、Shell 与配置文件

  2. 02

    学习、历史与文化

    语言怎么学、从哪里来、大家怎么用

  3. 03

    并发与分布式系统

    执行顺序、故障与进程间消息

  4. 04

    语言设计与语法

    语法、抽象、模块与宏

  5. 05

    安全与验证

    不可信输入、未定义行为、测试与证明

  6. 06

    工具与维护

    编辑器、调试器、重构与升级

后续讨论

全部讨论 ↗
  1. A slow gfortran loop that copied an array section on every call

    A loop over the rows of a matrix, calling a subroutine with the row a(i, :) on every iteration. Right answer, embarrassing sp…

    回复 2最近活动 fortran
  2. Who owns a Vulkan buffer after submission?

    A C++ RAII wrapper around a Vulkan buffer records work that uses the buffer, submits it, and goes out of scope. Its destructo…

    回复 7最近活动 cppc
  3. Eight queue slots can still leave 88 goroutines waiting

    A buffered channel bounds the jobs sitting in it. It does nothing about the goroutines blocked trying to send. Say a server g…

    回复 8最近活动 go
  4. Ported a short MATLAB script to R and one result came back as a matrix

    Trying to redo a short MATLAB script in R, and I've barely touched MATLAB before. Most of it came over fine, except for a sin…

    回复 7最近活动 rmatlab
  5. Same Int, two targets, two answers

    Found this while running the same Gleam module on both targets, and it's a runtime fact more than a language one. gleam run p…

    回复 3最近活动 gleam
  6. na.rm = TRUE on a group that is all NA

    Per-group totals with tapply(x, g, sum, na.rm = TRUE), and one group came back as 0. Every value in that group is NA. Not a s…

    回复 5最近活动 r
  7. `String::from_utf8` gives the bytes back when it fails

    A consuming API has to decide what happens to the value when it fails. String::from_utf8 takes the Vec<u8> by value, and on f…

    回复 0最近活动 rust
  8. D's pure lets a function write through its arguments

    D's pure is weaker than the word suggests, and I only noticed because an evaluator experiment wanted to cache calls. pure in…

    回复 4最近活动 d
  9. Is an NFC key a sensible default for name lookup?

    Okay, a user pastes their name and it ends in e followed by U+0301. Later they type the same name and the keyboard gives U+00…

    回复 6最近活动 typescriptjavascript