N
Nick Keighley
How about you stop feigning a topic and calling me names? "The topic"?. Make
me. Bitch.
plonk
How about you stop feigning a topic and calling me names? "The topic"?. Make
me. Bitch.
I am wondering how else to you write a program that uses buttons on
forms which most programs use these days without
using the run time library (or what ever its called) that Windows
provides.
Most software today is either games or embedded.
Thanks everyone for your replies.
Some have said that C++ is portable to other platforms. I am
wondering how.
if you wrote a program for a desktop computer and wanted the same
program to work on a mobile phone then would you load the existing
code into a compiler that creates programs for the mobile phone or
would you use the
compiler that you used to create the program for the desktop computer > and somehow tell the compiler to compile the code for a mobile phone.
I suspect you would need to modify the code to allow for a smaller
screen size that the mobile phone has.
agreed C# looked a pretty good language. And I wouldn't miss multiple
inheritance much. Though I'd need some sort of Java-like interface
(I've no idea if C# has such a thing). I quite liked the safe/unsafe
(or whatever the name was) code concept (not all code needs to nasty
things with pointers).
actually C# being a Microsoft product put me off. they don't have a
good track record (and I program for Windows)
good grief. Though I'd expect some sort slowdown for a VM like .NET
Conversely, if we would start to discuss which features are missing from the
C programming language, while completely ignoring C++, we would end up with
a list of features which, when implemented, would've pushed the C
programming language closer to C++. For example, the type-generic
expressions introduced in C11 look like someone desperately wanted the C
programming language to support generic programming but did their best to
avoid introducing C++ templates to C.
Seeing atrocious code is no excuse to hate the language. If you showed them
atrocious C code, I bet they wouldn't think differently of C.
Brian said:I have not found an answer to the question why C++ is the most preferred
language. I thought it would be a good question to ask in this newsgroup
that has programmers that have been using C++ for a while.
I did read that its popular because it can be transferred to other
platforms but not everyone has more than one platform.
Thanks everyone for your replies.
Some have said that C++ is portable to other platforms. I am wondering how.
if you wrote a program for a desktop computer and wanted the same program
to work on a mobile phone then would you [...]
Well, I *did* say "semi" ...
If you're a C programmer you can see unmaintainable code, accept that
it's a mess ... but at the same time you *know* the language features
it uses are necessary.
With C++ you know the language features *aren't* necessary. You don't
see (since you're a C programmer with no real C++ experience) how very
useful they are when used properly.
Lynn, that you are a newbie to the spiel and that there should not be
anymore newbies, is quite disconcerting.
I have been writing software for about 40 years
now and have used about 10 software languages.
All software languages suck but C++ sucks less
really describes my feelings well.
Don't even get me started on user interface APIs.
OTOH, a person can see and know how useful the features can be, but due
to other reasons, may still instead opt with C (as, after all, the
features aren't strictly necessary).
LOL
My sentiments exactly.
I started writing C in 1977 ("before they wrote the book" was my brag.
<g>). As an early adopter of OO, cfront shortly after. Languages I
have dabbled with have come and gone, yet c\c++ remains.
Whenever a particular platform, language, script, API came up short -
out came a trusty C++ compiler. I firmly believe there is no
programming problem that can't be resolved with another layer of
indirection.
When asked why C++ is popular, useful, "better", "advisable" ... I
often tried to provide glorious prose and profound 'proofs'. I owe BGB
a debt - from now on I can simply say "It sucks less". <g>
BGB said:admittedly, I haven't been around nearly so long...
(at that time, I didn't exist yet).
around 20 years later (mid/late 90s), I was in elementary and middle
school and mostly still learning the basics of programming (a lot of this
by hacking around on/around the Quake source and similar...).
I got mostly into interpreters during high-school, back in the early
2000s. this was partly due to curiosity, and partly because at one point
I tried using and then got frustrated with GNU Guile.
yeah.
this has mostly been my experience.
there are a few areas where C and C++ come out a little weaker (vs a
scripting language or similar), but the scripting language I use for
these cases would fall on its face if it tried to do what C and C++ are
typically used for doing (a scripting language would make a poor choice
for an implementation language).
And C++ is got to be better than programming in assembly language.
I started programming when I brought a TRS 80 computer 30 years ago. When
you switched it on you got a BASIC language editor so the first language I
learnt was BASIC.
To find out how programs worked I took them apart using a disassembler and
stepped through the raw machine language code. I wasn't a hacker like some
people that added a jump statement to by pass the programs protection but
just liked to find out how commercial programs such as games worked.
Of course, but that's a different thing. My comments above was about
people who (a) don't use C++ and still (b) complain loudly every time
it's mentioned. Not about rational reasons why people use C.
Jorgen said:Well, I *did* say "semi" ...
If you're a C programmer you can see unmaintainable code, accept that
it's a mess ... but at the same time you *know* the language features
it uses are necessary.
With C++ you know the language features *aren't* necessary. You don't
see (since you're a C programmer with no real C++ experience) how very
useful they are when used properly.
I have not found an answer to the question why C++ is the most preferred
language. I thought it would be a good question to ask in this newsgroup
that has programmers that have been using C++ for a while.
I did read that its popular because it can be transferred to other
platforms but not everyone has more than one platform.
Calum said:In my opinion a number of events conspired to make it popular:
1. Backwards compatibility with C, which was and still is an extremely important language.
2. Historically very good performance, compared to alternatives at the
time, with smaller runtime requirements
3. Multi-paradigm (not simply OO).
4. Cross platform, cross vendor.
5. Network effects - one popular, it becomes harder to displace.
6. Standardization
7. Manual memory management, giving better control at the expense of a little safety
I think we can all agree that C++ has its warts, and you may want to
change parts if you could start from scratch, but that is not the world we live in.
Calum
early on, when I started messing with computers (elementary school years), my dad had a 486, and I used it mostly to play Wolfenstein
3D and Doom. Quake ran, but slowly, on a 486DX2.
back in these days, the internet was also really slow, and most games ran in DOS (so it was common to need to boot into DOS mode), ...
I don't really have many clear memories from much before this point (back this far, memories are a bit fragmentary). I generally
classify these as my early years.
this is, as opposed to now, where I am facing against advancing age and similar (my 20s will soon be gone... this is worrying...),
and also not having a job.
I have noted occasionally that code of mine from closer to my early years generally sucked (like, some of my code from around 2004 or
so was pretty horrid).
now, as for C++ vs ASM:
well, C++ offers a few clear advantages at least over ASM:
can get a lot more done in fewer statements;
is portable to a wide variety of systems (vs assembly which has to be largely rewritten for each type of CPU, OS, ...), and where it
isn't usually possible to move code between one assembler and another (MASM, NASM, GAS, ... are incompatible), ...
though, there are still a few edge-case things which can only really be done (effectively, or at all) in ASM.
this results in programs where typically the vast majority is written in C or C++, but some small parts will exist which are written
in ASM (which may have little or nothing to do with performance).
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. After that, you can post your question and our members will help you out.