• Aceticon@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    4 months ago

    For non-programmers (who most definitelly don’t know that >> and << are bit shift operators) shoving something into something else is more intuitive than “calling a function with parameters”.

    Also don’t get me started on the unintuitiveness of first passing a string were text is mixed with funny codes sgnaling the places were values are going to be placed, with the values passed afterwards, as opposed to just “shove some text into stdout, then shove a value into stdout, then shove some more text into it”.

    Absolutelly, once you are used to it, the “template” style of printf makes sense (plus is naturally well-suited for reuse), but when first exposed to it people don’t really have any real life parallels of stituations were one first makes the final picture but leaving some holes in it and later fills-in the holes with actual values - because in real life one typically does it all at once, at most by incremental composition such as in C++, not by templating - so that style is not intuitive.