language agnostic - Hogyan írja be a kód elemeket a normál szövegbe?

original title: "language agnostic - How do you typeset code elements in normal text?"


What is the best way to typeset a function with arguments for readibility, brevity, and accuracy? I tend to put empty parentheses after the function name like func(), even if there are actually arguments for the function. I have trouble including the arguments and still feeling like the paragraph is readable.

Any thoughts on best practices for this?

Hogyan lehet a legjobban egy függvényt tippelni az olvashatóság, rövidség és pontosság érvelésével? Hajlok üres zárójeleket tenni a függvény neve után, mint például a func (), akkor is, ha vannak ar ...

Ez az összefoglalás a fordítás után. Ha meg szeretné tekinteni a teljes fordítást, kattintson a "fordítás" ikonra

Minden válasz
  • Translate

    I usually take that approach, but if I feel like it's going to cause confusion, I'll use ellipses like: myFunction(...)

    I guess if I were good, I would use those any time I was omitting parameters from a function in text.

  • Translate

    I would simply be a little more careful with the name of my variables and parameters, most people will then be able to guess much more accurately what type of data you want to hold in it.