Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8006139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:25:01+00:00 2026-06-04T17:25:01+00:00

I was reading others’ code and saw so many people using something like BUFFER_SIZE

  • 0

I was reading others’ code and saw so many people using something like BUFFER_SIZE as a macro. The thing is, many programs could be written without this buffer thing. So when do we need buffer and when not? I mean, why we need a buffer? And how to use it properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:25:02+00:00Added an answer on June 4, 2026 at 5:25 pm

    From wikipedia:

    a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another.

    With that being said, I feel there are a few concrete uses of buffers:

    • Transforming an asynchronous data source into a synchronous data source:
      This is a big one, and a lot of APIs are built with this mindset. For example, imagine you’re reading a data source which is inherently prone to failure. Asynchronously you have a stream which can fail at certain times, but you can request the data be read again. This handling of data is a very low level detail, and you wouldn’t want programmers at a high level to have to worry about it. The solution, write a low level handler which manages the stream and put data in a buffer once it’s safely been read in. For example, you see this use of a buffer in file systems, network protocols, etc…

    • Passing large amounts of data around: If you want to share data between multiple people, you need a temporary place to store data to mediate it between people.

    • Copying things / doing destructive manipulations: If you have a situation where you need to free one pointer and move something around in memory (for whatever reason), you can put the data in a temporary holding place. One common case is where I’m doing something like destructively manipulating a string: I can’t manipulate the original string, I need to make a copy of it, so I don’t corrupt the pointer if other people are holding on to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really like the idea of reading others people code to improve your design
A lot of times when reading source code I see something like this: public
I wrote my own context by reading this article and many others, but none
Im reading Jon Skeet book. (#4) but one thing (among others) caught my eye
Sometimes when reading others' C# code I see a method that will accept multiple
Guys, I opened this question (I hope could help some others) but reading stackoverflow
I am reading WIX script written by others. There are some code really confuses
As many others, I started my MVVM journey by reading Josh Smith's MVVM Demo.
There are questions pertaining to reading settings from a separate config file and others
I'm facing the same issue others already posted on SO: On reading objects from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.