Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > I need your advices about C prg.

Reply
Thread Tools

I need your advices about C prg.

 
 
James Kuyper
Guest
Posts: n/a
 
      04-26-2013
On 04/26/2013 08:28 AM, Malcolm McLean wrote:
> On Friday, April 26, 2013 12:05:15 AM UTC+1, Stephen Sprunk wrote:
>> On 25-Apr-13 10:19, Rui Maciel wrote:
>>
>>> Stephen Sprunk wrote:

>>
>> 1.8 billion people speak English, compared to 1.3 billion who speak
>> Mandarin. Every student in China is now required to learn English, and
>> it is projected that within a decade China will have more English
>> speakers than the US itself.
>>

> Actually they write Mandarin.


The Chinese speak and hear multiple spoken languages, such as Mandarin
or Cantonese, which they think of as dialects of a single language,
though linguists consider several of them to be distinct languages.
However, they read and write essentially a single written Chinese
language (*文 or Zhōngwén), though it is written slightly differently
by speakers of the different spoken languages.
--
James Kuyper
 
Reply With Quote
 
 
 
 
Rui Maciel
Guest
Posts: n/a
 
      04-26-2013
David Brown wrote:

> There are more /native/ speakers of Mandarin than /native/ speakers of
> English (and Spanish falls between these two). However, there are more
> people who speak English than any other language - mostly as a second
> language. Figures vary wildly depending on what levels of competence
> you look for, but something like 20% is probably a decent estimate (of
> native and second-language speakers).


The second languages are taught because they are useful to communicate with
those who don't speak our native language. Therefore, their choice is
motivated by how useful they might be to communicate with others.

In the last decade or so, english managed to become a de facto esperanto,
but that was mainly because the US dominated the world's economy and
academia. Things won't stay like that for long.

In addition, in some western countries it's much more likely that you
stumble on someone who speaks mandarin natively than english.

Again, a couple of decades ago francophones were using the same arguments to
justify why it would be silly for them to learn a second language.


> If you narrow the field to people who are seriously interested in
> programming - and therefore mostly young, literate, reasonably well
> educated, and familiar with computers, then I expect the percentage of
> people who can read reasonable English and have at least basic English
> written and oral skills is going to be very much higher.


Hardware production is already firmly established in Asia. I wouldn't bet
that in a decade or so english will still be the prefered language to
communicate with them.

Regarding software, I've published a small library (written in C, so let's
pretend it's on-topic) which is distributed under a FLOSS license and
managed to be somewhat popular. Currently, according to the site's download
statistics, the most number of downloads are by far from China, while those
from the US amount to only about 70% of that.

Singapore is ranked 4th, and Taiwan ranks 9th, right after the UK.


Rui Maciel
 
Reply With Quote
 
 
 
 
Stephen Sprunk
Guest
Posts: n/a
 
      04-26-2013
On 26-Apr-13 07:28, Malcolm McLean wrote:
> On Friday, April 26, 2013 12:05:15 AM UTC+1, Stephen Sprunk wrote:
>> 1.8 billion people speak English, compared to 1.3 billion who
>> speak Mandarin. Every student in China is now required to learn
>> English, and it is projected that within a decade China will have
>> more English speakers than the US itself.

>
> Actually they write Mandarin. The various dialects aren't mutually
> intelligible. Since Chinese uses a pictogram system, you can have the
> same pictogram pronounced in totally different ways, without breaking
> the writing system.


1.3 billion is for Mandarin speakers only; Cantonese, Taiwanese, etc.
speakers are not included, even though they use (roughly) the same
writing system.

The PRC mandated Mandarin in all schools, govt offices, etc. on the
mainland, so now only the elderly remember their region's dialect.
Non-PRC areas kept their dialects, eg. Cantonese in Hong Kong and Macau,
Taiwanese in Taiwan, etc.

There is a difference between "Simplified" (PRC) and "Traditional"
(non-PRC) writing, but natives tell me that the two are mutually
intelligible, something like a continental European still being able to
recognize their language without its normal diacritical marks.

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking
 
Reply With Quote
 
James Kuyper
Guest
Posts: n/a
 
      04-26-2013
On 04/26/2013 11:02 AM, Stephen Sprunk wrote:
....
> The PRC mandated Mandarin in all schools, govt offices, etc. on the
> mainland, so now only the elderly remember their region's dialect.
> Non-PRC areas kept their dialects, eg. Cantonese in Hong Kong and Macau,
> Taiwanese in Taiwan, etc.


Cantonese is still quite widely used in Canton itself and in neighboring
provinces.

> There is a difference between "Simplified" (PRC) and "Traditional"
> (non-PRC) writing, but natives tell me that the two are mutually
> intelligible, something like a continental European still being able to
> recognize their language without its normal diacritical marks.


My wife tells me differently. Raised in Taiwan, where they still use
almost exclusively the Traditional characters, she finds the simplified
ones almost unintelligible. That fits my own experience - I had a hard
time finding textbooks that teach the traditional characters; the best I
could do is find one that taught both forms. I learned to write both
simplified and traditional characters, and they were quite different.
The difference is far greater than, for instance, the difference between
the Helvitica and Fraktur typefaces.

 
Reply With Quote
 
Seebs
Guest
Posts: n/a
 
      04-26-2013
On 2013-04-25, Keith Thompson <(E-Mail Removed)> wrote:
> Still, a PDF copy of K&R is most likely a copyright violation.


Seems quite likely, although I'm not sure -- the question of how fair use
applies to media shifts is moderately open.

That said: As someone who has made a living writing now and then, I would
point out that I have never seen any evidence that I should care about
copyright violations of my writing, in general. By and large, if I'm selling
something, I care about sales. The theory that a given non-sale might have
been a sale otherwise is interesting, but I've seen no statistics bearing
out that it's a generally applicable pattern; rather, everything I've seen
suggests that widespread copying of a work tends to increase sales.

I know a lot of people who want to learn to program and can't, right now,
afford books. And worrying about whether they are getting their books
illegally is in general really, really, low on my priority list.

Note: I don't have the legal authority to tell people that they are welcome
to free copies of my shell book, because the publisher has a vote in the
matter. However, having access to concrete sales figures on at least one other
book, and knowing how people copying it freely affected them... Well, I
am pretty sure that people trading PDFs of my book would be in my economic
best interests, whether or not it is authorized by the publisher.

Economics: Weird.

-s
--
Copyright 2013, all wrongs reversed. Peter Seebach / http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
 
Reply With Quote
 
Seebs
Guest
Posts: n/a
 
      04-26-2013
On 2013-04-25, Jorgen Grahn <(E-Mail Removed)> wrote:
> There's also a lot of confusion about what "embedded programming" is.
> My employers call what I do embedded programming, but it's really
> for the most part ordinary Unix server programming.


I don't think this is really a confusion, just... Times change.

When I was first active on comp.lang.c, I had what was at the time a fairly
powerful computer. It had 6MB of memory, I believe, and a 25 MHz processor,
and I think a 200MB hard drive.

Nowadays, I do embedded systems stuff. We do, in fact, I believe, still
actually talk to people about targets that have less than 200MB of available
long-term storage. I don't think I've heard of anyone actually using a
system with under 64MB of main memory with this product. I mean, I'm sure
it must happen, but it doesn't come up much. If I have to look at a target,
it's typically got at least one 700MHz or faster core, and realistically
it's pretty common for it to have 2-8 cores at >1GHz, at least 512MB-1GB
of memory (or quite a bit more), and so on. I take it for granted that users
will want decent performance when assembling filesystems 1GB or more in
size that will be installed on thousands+ of embedded devices.

At which point, developer time tends to be more expensive than storage,
so yeah.

I still remember when I thought it was in some way unreasonable that people
wanted to run the whole GNU toolchain on their target systems in the field.
I've long since gotten used to that. Of *course* people want self-hosting so
they can recompile hundreds of packages from source using autoconf
configuration.

For embedded systems.

-s
--
Copyright 2013, all wrongs reversed. Peter Seebach / (E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
 
Reply With Quote
 
Stephen Sprunk
Guest
Posts: n/a
 
      04-26-2013
On 25-Apr-13 20:49, James Kuyper wrote:
> On 04/25/2013 07:05 PM, Stephen Sprunk wrote: ....
>> ~95% of Americans speak English on some level, including most
>> native Spanish-speakers. Legal immigrants must know it to get a
>> visa in the first place, and their kids are forced to learn it in
>> school. That leaves only illegal immigrants, and many of them pick
>> up English as well to avoid detection and/or get higher-paying
>> jobs.
>>
>> Culturally, I agree that it would be a good to learn Spanish to
>> speak to our neighbors to the south, but it's a poor economic
>> choice--and mandating thatt would be political suicide. Learning
>> Portuguese would be a better economic choice, but Brazilians
>> students are learning English now, so any benefit there would be
>> short-lived.

>
> The entire southwest portion of the US used to be controlled by
> Spanish speaking people, and Spanish remains pervasive throughout
> that region. Many people for whom Spanish is their birth language
> come from families that have been US citizens for 3 generations, or
> longer - some can trace their presence in the region to back before
> it was seized by the US. Spanish was my first foreign language, and
> it remains by far the most useful of the five that I've learned, even
> though I now live in the Maryland (which also, for different reasons,
> has a significant Spanish-speaking population).


Still, most of them speak English as well, aside from the illegal
immigrants, despite potentially speaking Spanish at home.

As noted, making Spanish mandatory in the schools in the southwestern US
would be political suicide. We require _some_ foreign language to
graduate, and many students do choose Spanish, but most schools offer
other languages as well.

>>> - Canada: it has two official languages: english and french.

>>
>> Aside from those living in Quebec or working for the govt, there's
>> not much reason to learn French, since even the Quebecois learn
>> English in school now.

>
> Many Québécois are much more cooperative with those who at least
> attempt to speak with them in French. You can insist on using
> English, but the more obstinate ones will respond by pretending not
> to understand.


My experience in France is that they pretend not to know English, but if
you try to speak French, they will answer in English rather than allow
you to continue butchering their beautiful language. (I speak it well
enough to get pegged as French Canadian, but to the actual French that
still qualifies as butchering their language.)

This is notably unlike in most other countries, where people will
happily speak whatever common language can be found--and that is most
often English. Even if you do speak their language fluently, many still
prefer English just to get practice with a native speaker.

>> 1.8 billion people speak English, compared to 1.3 billion who
>> speak Mandarin. Every student in China is now required to learn
>> English, and it is projected that within a decade China will have
>> more English speakers than the US itself.

>
> I can vouch personally for the fact that the English spoken by many
> of those students is quite poor ... I wouldn't recommend counting
> on being able to communicate with all of them using English.


Spoken English quality varies among non-native speakers, but most
problems can be attributed to starting too late in life, eg. college.
The current (and future) generations of Chinese students will be far
better by the time they reach the job market simply because they're
starting earlier.

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking
 
Reply With Quote
 
Seebs
Guest
Posts: n/a
 
      04-26-2013
On 2013-04-26, David Brown <(E-Mail Removed)> wrote:
> On 26/04/13 01:47, Seebs wrote:
>> On 2013-04-25, David Brown <(E-Mail Removed)> wrote:
>>> No, "main" does not always have a return parameter - "main" does not
>>> always return, and therefore a return parameter is meaningless.


>> This analysis is incorrect.


>> On at least some systems, the calling sequence depends on what type
>> the return would be if the function returned, so even a function that
>> never returns must have the correct return type.


> If you have such a system, then that would be true. However, I have a
> hard time imagining what could go wrong within the body of main even if
> the calling sequence depended on the return type. I could imagine how
> things could fail on the return from main() if the return type did not
> match the expected type, but not during execution of main() and its
> infinite loop.


> I think your argument here is perhaps technically true, but very much
> hypothetical.


I don't recall details, but I believe there have been systems on which
arguments and return value both went on the stack, so if your function
didn't have the same expectations for its return value as the caller, it
could end up reading the wrong arguments. Not sure, though.

Mostly, though:

I am a big believer in the theory that if something is undefined behavior,
and I don't have a really *good* reason to believe that I absolutely need
to find a way to make it happen, the best answer is to say "that's undefined
and I don't know what will happen".

So the fact that it's undefined is enough to make me think it's unsafe,
because even if it might well work in some environments, it might not in
others. Someone will do something thoughtful like a compiler which mangles
names to denote return types, and the program won't link, or will get a
default main() implementation provided by something like lex/yacc, or
whatever other madness.

> I made a specific point about /small/ embedded systems. I didn't define
> "small embedded systems" here, but Linux (or other OS's capable of
> calling independent programs) do not count as "small" - "small" system
> programs are free-standing rather than hosted.


I would concede this, but I would also argue that even then, it doesn't
necessarily matter; there's nothing *preventing* a freestanding environment
from choosing to use a setup in which main() is called and expected to
yield a return value.

> Typically in embedded systems there are at least two programs which are
> not standard hosted environments with "int main(...)" - the kernel, and
> also the bootloader (such as U-Boot). There may in fact be more levels
> of bootloader, some of which may not have any main() at all.


This is a good point, I hadn't been thinking about the boot loader. And
arguably, whatever's picking up the boot loader is almost certainly something
that someone somewhere wrote as code...

-s
--
Copyright 2013, all wrongs reversed. Peter Seebach / (E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
 
Reply With Quote
 
Seebs
Guest
Posts: n/a
 
      04-26-2013
On 2013-04-26, Rui Maciel <(E-Mail Removed)> wrote:
> The second languages are taught because they are useful to communicate with
> those who don't speak our native language.


And also because thinking in different languages promotes mental flexibility.

> In the last decade or so, english managed to become a de facto esperanto,
> but that was mainly because the US dominated the world's economy and
> academia. Things won't stay like that for long.


They might not, but the network effects may win anyway; at this point,
there's so much literature in key fields in English that you practically have
to learn it anyway. English is the new lingua franca!

> Again, a couple of decades ago francophones were using the same arguments to
> justify why it would be silly for them to learn a second language.


.... I made the joke above before I'd read that paragraph. But I'm leaving it
now.

> Hardware production is already firmly established in Asia. I wouldn't bet
> that in a decade or so english will still be the prefered language to
> communicate with them.


Hardware production is moving around more thanks to automation, though.

In any event, I think I'd say this: I don't think I've ever regretted learning
something.

-s
--
Copyright 2013, all wrongs reversed. Peter Seebach / (E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
 
Reply With Quote
 
Seebs
Guest
Posts: n/a
 
      04-26-2013
On 2013-04-26, David Brown <(E-Mail Removed)> wrote:
> On 26/04/13 01:47, Seebs wrote:
>> Read, write. Code and language. And don't neglect things like philosophy,
>> psychology, and so on; everything you know can help you be better at
>> programming. Psychology can help you understand people, and understanding
>> people helps you write programs that suit them, or write code they can
>> read. Philosophy can help you decide what to work on. And so on.


> Telepathy is useful too, when you are trying to figure out what a
> customer wants rather than what he says he wants...


Observations: Read Kahneman's _Thinking, Fast and Slow_. Read sites like
"Not Always Right" and "Clients From Hell". Study Miller's Law ("To
understand what another person is saying, you must assume that it is true
and try to imagine what it could be true of.") Do this stuff and you will
find that customer requirements are substantially more approachable.

Still impossible to be consistently right, but you can improve your odds.

> Seriously, that's good advice. There is lots more to programming well
> than just writing code - you have to know /what/ to code.
>
> Other useful related skills are graphical design, economics (programmers
> are notoriously bad at figuring out real-world costs), physics, maths,
> more maths, applied maths, pure maths, and then some more maths.


Yes. Human interface considerations are something programmers in general are
HORRIBLE at. Norman's "The Design of Everyday Things" is another book I
strongly recommend.

-s
--
Copyright 2013, all wrongs reversed. Peter Seebach / (E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
silly question about Running a script from the command line A.Rock Python 0 04-10-2013 11:21 AM
newbie question about confusing exception handling in urllib cabbar@gmail.com Python 6 04-09-2013 07:11 PM
Need your advices =?utf-8?B?5rW36aOO?= Java 10 04-17-2006 10:26 PM
Need advices for exam 70-306 LoveGarfield MCSD 3 09-21-2003 11:06 AM
need advices : intranet archecture design Gildas Garcia ASP .Net 0 07-04-2003 07:08 PM



Advertisments