473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ascii VS binary files

hello,
I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"

10-x all,
Miki
Nov 14 '05 #1
15 2359
mi**********@yahoo.com (miki) wrote:
I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"


Get out of there. If they think that question even _has_ a simple
answer, you don't want to be working for them, it'll be a Dilbert
environment. Unless, of course, they know very well that the answer is
"both; which you use depends entirely on the application", and were
trying to trick you; in which case, ditto.

Richard
Nov 14 '05 #2
Richard Bos wrote:
mi**********@yahoo.com (miki) wrote:

I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"

Get out of there. If they think that question even _has_ a simple
answer, you don't want to be working for them, it'll be a Dilbert
environment. Unless, of course, they know very well that the answer is
"both; which you use depends entirely on the application", and were
trying to trick you; in which case, ditto.


One way to get an idea of someone's abilities is to
ask a superficially simple question of this sort and see
whether the respondent can peel a few layers from the onion.
C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
his oral examination for his PhD in something astronomical:
One of his examiners asked "Why is the sky blue?" Stoll says
he felt relieved to get such a simple question -- but the
relief soon vanished. The guy kept asking "Can you be more
specific?" and Stoll found himself filling blackboard after
blackboard with equations of quantum electrodynamics ...

It's a mistake to assume too much about an interviewer's
reasons for asking a question.

--
Er*********@sun.com

Nov 14 '05 #3
In <40**************@sun.com> Eric Sosman <Er*********@sun.com> writes:
One way to get an idea of someone's abilities is to
ask a superficially simple question of this sort and see
whether the respondent can peel a few layers from the onion.
C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
his oral examination for his PhD in something astronomical:
One of his examiners asked "Why is the sky blue?" Stoll says
he felt relieved to get such a simple question -- but the
relief soon vanished. The guy kept asking "Can you be more
specific?" and Stoll found himself filling blackboard after
blackboard with equations of quantum electrodynamics ...


Probably a fake story. Or the guy was unable to provide a simple answer
to a simple question. Classical electrodynamics is enough for the
dispersion of electromagnetic radiation in air and the law governing
it is well known. Once you have invoked it and pointed out that,
according to it, higher frequencies are dispersed more than lower
frequencies (and that blue light is toward the high end of the visible
light frequency spectrum), you can't be more specific than that. Maybe
a little colorimetry is needed to explain why blue and not violet.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #4
On Fri, 25 Jun 2004, miki wrote:
hello, I was asked this question during a job interview, and didn't know
the answer. could someone please help me with that? the question was:
"Which files are more suitable for working in C, ascii or binary?"


Why do you think there is ONE answer? My first thought is, why would
someone ask this question. I can come up with some theories. The
possibilities are endless though. It could be the interviewer wants
someone who asks questions. It could be they believe there is one answer
to this question. It could be the interview is bored, decided they don't
want to hire you and are just messing with you now.

The list can go on and on. I'd just tell him what I think is the right
answer. I might ask a few questions myself (never be afraid to ask for
clarification). In the end, I'd ask the interviewer what they were
expecting from that question.

--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vi************@whitehouse.gov
Nov 14 '05 #5
"Richard Bos" <rl*@hoekstra-uitgeverij.nl> wrote in message
news:40***************@news.individual.net...
mi**********@yahoo.com (miki) wrote:
the question was: "Which files are more suitable for working in C, ascii
or binary?"
Get out of there. If they think that question even _has_ a simple
answer, you don't want to be working for them, it'll be a Dilbert
environment. Unless, of course, they know very well that the answer is
"both; which you use depends entirely on the application", and were
trying to trick you; in which case, ditto.


It could be a trick question. In C you have no concept of ascii files. You
have text file and binary files.

Regards,
Martin
Nov 14 '05 #6
miki wrote:

hello,
I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"

10-x all,
Miki

Without knowing too much about the rest of your
interview, I speculate that the question may
represent a _bias_ against one or the other.

I worked at a company that did their
Middleware as binary but were unsuccessful.
The project managers' perception was that
binary was inherently bad. After a staff
replacement (no kidding), they switched to ASCII.

Even though the bandwidth was reduced significantly,
it was "better". It's difficult to understand
their viewpoint, but it wasn't based on
any sound judgment I'm aware of...
-
Stephen
Nov 14 '05 #7
"Richard Bos" <rl*@hoekstra-uitgeverij.nl> wrote in message
"Which files are more suitable for working in C, ascii or
binary?"


Get out of there. If they think that question even _has_ a simple
answer, you don't want to be working for them, it'll be a Dilbert
environment.

You just don't know. If they expect a one word "right" answer then I agree
that the job is probably not worth having. However if they expect you to
talk intelligently about the advantages of each (text is portable, and is
easy to examine by a human, however a binary file is usually portable enough
if specifed correctly, is usually easier to parse, and is more compact) then
I don't see anything wrong with the question.
Nov 14 '05 #8
"miki" <mi**********@yahoo.com> wrote in message
news:e9**************************@posting.google.c om...
hello,
I was asked this question during a job interview, and didn't know the answer. could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"
10-x all,
Miki


Interesting discussion indeed:

With standard C, one can store and retrieve even complex data structure (not
containing memory references) or array of these structures with single ANSI
C call. Assuming the same platform endianity, alingment and padding.

I guess somebody can say the same about ASCII files using printf() / scanf()
.... however, arbitrary size arrays will require more than single call.

Anyway, my answer to the question above would be binary.

Roman
Nov 14 '05 #9
miki wrote:
hello,
I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"

10-x all,
Miki


The answer is, the guy interviewing you does not know C. You have a %50/%50 shot of
getting the answer he wants to hear.

--
Samiam is Scott A. Moore

Personal web site: http:/www.moorecad.com/scott
My electronics engineering consulting site: http://www.moorecad.com
ISO 7185 Standard Pascal web site: http://www.moorecad.com/standardpascal
Classic Basic Games web site: http://www.moorecad.com/classicbasic
The IP Pascal web site, a high performance, highly portable ISO 7185 Pascal
compiler system: http://www.moorecad.com/ippas

Being right is more powerfull than large corporations or governments.
The right argument may not be pervasive, but the facts eventually are.
Nov 14 '05 #10
miki wrote:

hello,
I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or
binary?"


"Both, and neither."

This cannot be answered without knowing what the files are to be used for.

Think of the C compiler itself, which is probably written in C. It takes
text source files and creates binary object files. (Though I suppose
that even this might be 'implementation dependent".) It doesn't make much
sense to use binary source files, and it makes even less sense to make
text object files. (Though again, this is a simplification, since the C
compilers I have used on *nix systems actually create text files of
assembler source code. Of course, this is then passed to the assembler
[probably written in C] which takes the text assembler source and then
creates the binary object file.)

Some files are naturally text format, and some are naturally binary, and
which type you use depends on the file's purpose, and not on C.

Are you sure you want to work for a place that thinks the question has an
answer? (Unless the question was meant to get you to thinking about the
concepts of text-vs-binary, and to give more than a simple answer. But,
what are the odss of that?)

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Nov 14 '05 #11
Dan Pop wrote:

In <40**************@sun.com> Eric Sosman <Er*********@sun.com> writes:
One way to get an idea of someone's abilities is to
ask a superficially simple question of this sort and see
whether the respondent can peel a few layers from the onion.
C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
his oral examination for his PhD in something astronomical:
One of his examiners asked "Why is the sky blue?" Stoll says
he felt relieved to get such a simple question -- but the
relief soon vanished. The guy kept asking "Can you be more
specific?" and Stoll found himself filling blackboard after
blackboard with equations of quantum electrodynamics ...


Probably a fake story. Or the guy was unable to provide a simple answer
to a simple question. Classical electrodynamics is enough for the
dispersion of electromagnetic radiation in air and the law governing
it is well known. Once you have invoked it and pointed out that,
according to it, higher frequencies are dispersed more than lower
frequencies (and that blue light is toward the high end of the visible
light frequency spectrum), you can't be more specific than that. Maybe
a little colorimetry is needed to explain why blue and not violet.


I thought everyone knew why the sky is blue: because if it were green,
we wouldn't know where to stop mowing.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Nov 14 '05 #12
Eric Sosman wrote:
[...]
"Which files are more suitable for working in C, ascii or binary?"

Get out of there. If they think that question even _has_ a simple
answer, you don't want to be working for them, it'll be a Dilbert
environment. Unless, of course, they know very well that the answer is
"both; which you use depends entirely on the application", and were
trying to trick you; in which case, ditto.


One way to get an idea of someone's abilities is to
ask a superficially simple question of this sort and see
whether the respondent can peel a few layers from the onion.
C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
his oral examination for his PhD in something astronomical:
One of his examiners asked "Why is the sky blue?" Stoll says
he felt relieved to get such a simple question -- but the
relief soon vanished. The guy kept asking "Can you be more
specific?" and Stoll found himself filling blackboard after
blackboard with equations of quantum electrodynamics ...

It's a mistake to assume too much about an interviewer's
reasons for asking a question.


ObRemindsMeOfAStory:

Young boy asks his father "where did I come from?" Father goes through
the whole "birds and bees" story. Father asks son "do you have any more
questions?" Son says he does, and asks "Billy says he comes from New
Jersey, and I want to know where I came from."

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Nov 14 '05 #13
On 25 Jun 2004 01:47:20 -0700, mi**********@yahoo.com (miki) wrote:
hello,
I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"
ascii
10-x all,
Miki


Nov 14 '05 #14
On 25 Jun 2004 14:43:39 GMT, Dan Pop <Da*****@cern.ch> wrote:
In <40**************@sun.com> Eric Sosman <Er*********@sun.com> writes:
One way to get an idea of someone's abilities is to
ask a superficially simple question of this sort and see
whether the respondent can peel a few layers from the onion.
C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
his oral examination for his PhD in something astronomical:
One of his examiners asked "Why is the sky blue?" Stoll says
he felt relieved to get such a simple question -- but the
relief soon vanished. The guy kept asking "Can you be more
specific?" and Stoll found himself filling blackboard after
blackboard with equations of quantum electrodynamics ...
Probably a fake story. Or the guy was unable to provide a simple answer
to a simple question. Classical electrodynamics is enough for the
dispersion of electromagnetic radiation in air and the law governing
it is well known. Once you have invoked it and pointed out that,
according to it, higher frequencies are dispersed more than lower
frequencies (and that blue light is toward the high end of the visible
light frequency spectrum), you can't be more specific than that.


Examiner: "you've shown me what the response to scattering in air is.
But still, why is the sky *blue*?"

You need then to assert the Planck black body law for the photosphere
of the Sun (which requires quantum mechanics somewhere)---but then
probably also an examiner will ask you to justify certain assumptions
and pursue what happens if you want a more detailed calculation
(e.g. the QED formulation perhaps to justify the black body law, and
some physical reasoning about scattering lengths to justify the black
body).

A tougher followup on the classical end is to then ask, we know the
sky is blue but how will it look through polarized sunglasses?"
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de

Nov 14 '05 #15
On Sat, 26 Jun 2004 08:53:25 GMT, Scott Moore <sa****@moorecad.com> wrote:
miki wrote:
hello,
I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"

10-x all,
Miki


The answer is, the guy interviewing you does not know C. You have a %50/%50 shot of
getting the answer he wants to hear.


Or it was a trick question to weed out bullshitters, and a good reply is
"neither, C has specific capability for stream-oriented I/O as opposed
to strictly record-oriented I/O, but makes little distinction between
ASCII or binary."

Nov 14 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bix | last post by:
As this is my very first post, I'd like to give thanks to all who support this with their help. Hopefully, this question hasn't been answered (too many times) before... If anyone could explain...
2
by: Albert Tu | last post by:
Hi, I am learning and pretty new to Python and I hope your guys can give me a quick start. I have an about 1G-byte binary file from a flat panel x-ray detector; I know at the beggining there...
8
by: W. de Jonge | last post by:
Who can help me? I want to create a link(href) which opens an .doc or an ..xls directly in MS Word or MS Excell and not in IE so that I don't have to save the document first en open it from...
12
by: Sunner Sun | last post by:
Hi, all Since the OS look both ASCII and binary file as a sequence of bytes, is there any way to determine the file type except to judge the extension? Thank you!
13
by: greg | last post by:
Hello, I'm searching to know if a local file is ascii or binary. I couldn't find it in the manual, is there a way to know that ? thanks, -- greg
31
by: Claude Yih | last post by:
Hi, everyone. I got a question. How can I identify whether a file is a binary file or an ascii text file? For instance, I wrote a piece of code and saved as "Test.c". I knew it was an ascii text...
6
by: SandyMan | last post by:
Hi, I am able to open a binary file for reading but can someone tell me as how to go about converting a Binary file to ASCII file using C. Thanks In Advance SandyMan
68
by: vim | last post by:
hello everybody Plz tell the differance between binary file and ascii file............... Thanks in advance vim
24
by: pbd22 | last post by:
Hi. I want to know the size of a file (prior to FTP) in ASCII Mode. The reason is that I want to know how bit the file is going to be once it reaches the FTP server and there is a size...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.