473,545 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2370
mi**********@ya hoo.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**********@ya hoo.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*********@su n.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.in dividual.net...
mi**********@ya hoo.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**********@y ahoo.com> wrote in message
news:e9******** *************** ***@posting.goo gle.com...
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.co m/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

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

Similar topics

7
2372
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 this behavior, I'd greatly appreciate it. I'm leaving the example at the bottom. There is a variable, fmt, within the test0 function which can be...
2
2019
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 is a 128-byte header and the rest of the file is integers in 2-byte format. What I want to do is to save the binary data into several smaller files
8
23613
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 Explorer. I asked our webmaster at the office but he didn't know the answer so I hope you can help me. Greetz Willem
12
7807
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
3533
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
3124
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 file. Then after compilation, I got a "Test" file and it was a binary executable file. The problem is, I know the type of those two files in my mind...
6
10028
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
5171
by: vim | last post by:
hello everybody Plz tell the differance between binary file and ascii file............... Thanks in advance vim
24
2985
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 difference between binary and ascii mode (100 or so bytes). So, how do I get the size of the file in ASCII Mode using the usual VB.NET API?
0
7487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7420
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7446
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6003
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3476
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.