1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

(OT?) A comment question about correct English usage

Discussion in 'Embedded' started by Dimiter_Popoff, Mar 26, 2014.

  1. I was just writing a comment as I have been doing last 30 years or so
    and I was unsure whether to say "from" or "of" or something else.

    The text is:
    "Allocate memory either from the system or from a passed container" .

    While it is obvious and will likely work for anybody I am unsure
    about the "from", is it correct? If not what should it be?



    (back to the real programming/commenting with all the associated
    linguistic imperfections :D ).
    Dimiter_Popoff, Mar 26, 2014
    1. Advertisements

  2. Dimiter_Popoff

    David Brown Guest

    I would write "Allocate memory from either the system or a passed


    David Brown, Mar 26, 2014
    1. Advertisements

  3. Thanks David,

    sounds much better. Ordering seems even harder to get right than
    choosing between "from" "of" etc. .... :) .

    Dimiter_Popoff, Mar 26, 2014
  4. The "from" is quite correct.

    There's a slightly different form where "of" is correct:

    Allocate a block _of_ something.

    In that case, it is grouped like this

    Allocate (a block of something).

    verb direct-object

    In your case it's

    Allocate (memory) from (the system)

    verb direct-object indirect-object

    In the former case, the phrase that constitutes the direct-object
    contains another preposition and object that implies the the source of
    the direct-object. In the latter case, the indirect-object specifies
    the source of the direct-object specifically.
    Grant Edwards, Mar 26, 2014
  5. Dimiter_Popoff

    Tom Gardner Guest

    "of" implies a subtype or subset relationship, e.g. give me a piece of chocolate.
    "from" implies the source, e.g. give me a biscuit from the packet

    Hence your sentence means there are two different places
    (or maybe APIs) from which the memory can be allocated.

    The "either from ... or from ..." is good and explicit
    since it reinforces that there are equally valid alternatives.
    Tom Gardner, Mar 26, 2014
  6. Dimiter_Popoff

    Paul Rubin Guest

    It is fine. You could leave out the second "from" as someone suggested,
    but it's less ambiguous the way you wrote it. I'd leave it the way it is.
    Paul Rubin, Mar 26, 2014
  7. Dimiter_Popoff

    Tim Wescott Guest

    "From" is, indeed, correct. "Of" would sound really wrong here; it would
    trip up the native English speaker, but he'd probably figure out your
    meaning after a while.
    Tim Wescott, Mar 26, 2014
  8. Thanks to everyone who replied. I left the sentence as it was, I
    knew it would work, I asked because I was somewhat surprised by
    my uncertainty about something seemingly simple. The thing is
    that words like "from", "of" etc. have direct translations
    into other languages but they often overlap, e.g. in German
    "from" can be "von" but so can be "of"... (hopefully I get
    this right, I don't use a Bulgarian - my native - analogy
    for obvious reasons, I guess I am the only one here to
    speak the language).

    Now to beat this a little more in a somewhat more on topic
    direction, is the "container" word commonly used nowadays?
    Above, it means an object which would be asked to allocate
    memory (in DPS there are runtime dynamically found/loaded
    objects, one of these, typically a memory_pool type I have).
    (OK, deallocate memory it has previously allocated).
    If no container object is passed (by passing a 0) the request
    will be made via a system call, the lowest level
    allocate/deallocate, getting a multiple of 4k (the cluster
    being 1 MMU page). The memory_pool type can come with various
    cluster lengths, it is normally (always so far?) allocated
    from the system memory.
    I think I got to the "container" word by seeing it used by
    some browser, something like "plugin container" or sort of,
    not that I know what this means in their context beyond
    what would be obvious to most of us here :).

    Dimiter_Popoff, Mar 27, 2014
  9. Dimiter_Popoff

    Tim Wescott Guest

    Prepositions like this are hard exactly because the meanings overlap, but
    don't quite match. That, and the fact that it's hard to pin down exactly
    what they do mean -- in your native language, you just know.

    This reminds me of a friend of mine in college, who was learning German,
    French, and Serbian all at the same time. For about a week she totally
    lost her ability to correctly use prepositions in any language "Hey!
    let's go over the street at that restaurant over there!". This probably
    meant that her brain was rearranging itself to accommodate prepositions
    in any language (lucky girl). It was certainly interesting to watch.
    When I think of it at all, I think of "container" as being a specific
    sort of object, such as are defined in the C++ standard template
    library. Your sentence certainly made 100% sense to me with that word in
    there -- I took it to mean that you've got a class that allocates its own
    bits of memory, and you're passing a pointer to it.
    Tim Wescott, Mar 27, 2014
  10. OK, thanks - apparently the word has been commonly used for decades,
    it is just me now discovering it. No huge surprise, given that I live
    in my own programming universe :).
    Good thing I have picked its right meaning - it was intended to be
    exactly the one you got.

    Dimiter_Popoff, Mar 28, 2014
  11. Dimiter_Popoff

    Tom Gardner Guest

    Well, /one/ of the many "right" meanings :(
    Tom Gardner, Mar 28, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.