Dynamic/Dynamically is used WAY to much in programming. What part of programming is NOT dynamic?
Depending upon your interpretation of the definition it can just mean: moving parts. Programming is all about moving parts.

I see things like "dynamically allocated array". Wtf does that even mean? (I get it, most likely means on heap) Say it specifically: it was allocated on the stack or the heap.

Apparently some people are just more energetic in their programming...

It becoming a really overused buzzword...

  • 0
    When the array is initialized at compile time I suppose.

    Maybe runtime allocation is better?
  • 4
    It has very precise meanings though
    dynamic typing -> type information checked at runtime
    dynamic allocation -> allocation size/existence determined at runtime
    dynamic routing -> routing paths determined at runtime
    dynamic dispatch -> method dispatch at runtime
    (Basically dynamic -> at runtime)

    dynamic programming -> yeaaaah this is poor naming, means constructing solutions out of solved sub-solutions.

    (For your array, it's not the stack/heap that makes the difference, it's that the allocation size depends on factors that are only resolved at runtime. That's a major difference from static allocation where all this is known at compile time).
  • 0
    @RememberMe Then in C++ static is also a modifier making that distinction muddy. We have dynamically allocated static variables... static pointer to heap memory.
  • 1
    @Demolishun nothing wrong there. A static pointer means that the *pointer variable* itself is static, not the thing it's pointing to.

    I agree though, in general C/C++'s use of the static keyword is an absolute mess. It's generally a lifetime quantifier i.e. that a static thing is guaranteed to be around in the same place in memory for the duration of the program (so static in the sense that it's always guaranteed to stay at the same place, as opposed to C's usual automatic (stack allocated) variables and class members). It's not really the static in "static allocation".

    It's also used to define functions that aren't visible outside a c file but I feel that's just inconsistency (in this case static is sort of opposite to extern).

    static in the sense of static typing vs dynamic typing is different, it denotes something that is known at compile time. I suppose you could say C/C++ static variables are known at compile time and they always exist for the duration of the program regardless of anything else (i.e. the linker ensures they're there). It's a very different meaning however from const and constexpr, which are to do with the *values* a variable can take.
  • 0
    @RememberMe I know, and people assign dynamic term to freaking everything under the sun.
  • 1
    Static really is the way to go.

    Ultimately, any program is going to be run on a finite number of inputs. A static-only approach would precompute the answers, and boom! Results in O(1) complexity.

    Also would take up much less memory.
  • 1
    @halfflat Is there an O type notation for the amount of space used? Like S(infinite) for all possible outcomes?

    You have some awesome comments btw.
  • 1
    @Demolishun I've precomputed all my comments, so I don't have to think about them.
  • 0
    @halfflat That would make for an awesome scifi. Where some scientist figures out how to calculate the outcome of humanity on the universe using some quantum computer. He discovers that the universe will be destroyed by mankind so he has to deal with that eventuality. Insert some plot twists, suppression of reality, etc. Maybe end movie with, "We are fucked, but the beer is good!" Insert really dark humor.
  • 1
    @Demolishun Got to say, as far we are all individually concerned, life is finite. But: beer _is_ good.
  • 0
    it's more of a synonym of "at runtime", than a buzzword.

    dynamically generated mesh, for example. mesh that the code creates during runtime, using some algo.
Add Comment