Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Why is C++ so popular

Reply
Thread Tools

Why is C++ so popular

 
 
Brian
Guest
Posts: n/a
 
      09-30-2012
Brian <(E-Mail Removed)> wrote:
> 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 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.

--
Regards Brian
 
Reply With Quote
 
 
 
 
Brian
Guest
Posts: n/a
 
      09-30-2012
Ian Collins <(E-Mail Removed)> wrote:
> On 09/29/12 23:23, Brian wrote:
>>
>> 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 (excluding Web applications) today doesn't use buttons on
> forms, nor does it run on windows.


But if you don't click on a button or select from a pull down menu then how
do you tell the program what you want to do. Apart from some utils that run
in DOS most of my programs use buttons on a form.

--
Regards Brian
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      09-30-2012
On 09/30/12 13:59, Brian wrote:
> Ian Collins<(E-Mail Removed)> wrote:
>> On 09/29/12 23:23, Brian wrote:
>>>
>>> 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 (excluding Web applications) today doesn't use buttons on
>> forms, nor does it run on windows.

>
> But if you don't click on a button or select from a pull down menu then how
> do you tell the program what you want to do. Apart from some utils that run
> in DOS most of my programs use buttons on a form.


Most software today is either games or embedded.

--
Ian Collins
 
Reply With Quote
 
BGB
Guest
Posts: n/a
 
      09-30-2012
On 9/29/2012 5:18 PM, Rui Maciel wrote:
> BGB wrote:
>
>> the main merit C++ has is that it has a lot of features beyond those
>> available in plain C.

>
> 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.
>


could be.

(fantasy land here).


I would probably opt for:
type-inferred variables;
maybe something akin to operator overloading (possibly with some special
and named operators, 1);
possibly, function overloading (likely including return type, 2).
maybe closures (or at least anonymous functions, 3);
scope delegation (4);
....

1: something akin to a copy-constructor and destructor;
maybe a type-conversion operator (so it is possible to declare
conversions to/from other types).

2: typically, only the argument types are considered and the return type
is ignored, preventing cases of overloading with a single value type but
multiple return types. in certain cases though (such as with overloaded
operators), this could be useful.

the compiler could reject cases though where this would lead to an
unresolved ambiguity, basically where the both the expression and target
have ambiguous types (the main alternative being to have "best guess"
semantics).

3: preferably full closures, which can also be used as normal function
pointers, although this case introduces a semantic edge case (there
would be either a memory leak or a need for a garbage collector).

alternatively, mechanisms could be provided to aid building these
easier, but it is unclear how to go about doing this without making it
as awkward as is using current means (creating a struct to hold the
captured variables and using an API call to construct a closure using a).

a simpler solution would be to introduce a non-closure block (or
anonymous nested function), and then use this as a means to construct
such a closure (via an API call or overloaded operator).

say:
_Fun { body... }

is the same as a function declared as:
void whaterver() {body...}
....
whatever

and
_Fun functype {body...}
would allow declaring args and a return-type, where functype is
essentially a function-pointer type.

say:
_Fun int(*)(int x, int y) { return x+y; }
_Fun foo_cb_t { return x+y; }
....


4: this is going off into obscure land, but C already has a very
limited form as a common compiler extension: unnamed structs or unions.
the change would be to allow a case whereby the struct or union can
still have a name and be referenced, but the compiler may look into the
struct if trying to resolve a name (declared within the struct);

example:
typedef struct
{
int x, y;
}Foo;

typedef struct
{
Foo xy;
int z;
}Bar;

_Delegate Foo *foo;

"foo" refers to the struct pointer as before.
"x" may also be used, and implicitly be understood as "foo->x".

Bar *foo;

"foo->x;" is the same as "Foo->xy.x;"

....


and I can solidly expect none of this...



combining some of this, a person could then write a closure something like:
struct {
int x, y;
}_Delegate *vars=gcalloc(sizeof(*vars));
x=3; y=4;
return(dyllWrapClosure(vars, "()i",
_Fun int(*)(typeof(vars) vars) { return(x+y); } )

which is a bit ugly, but still slightly better than the present
situation (and doesn't introduce any implicit runtime dependencies).


or such...

 
Reply With Quote
 
Jan G
Guest
Posts: n/a
 
      09-30-2012
Brian wrote:
> 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.


While I am going to read the replies and "play along", I am not going to
call you "a troll", because if I did that, I would be as much a hypocrit as
<your favorite example of hypocrisy>. That said, your "inflamatory" subject
title is, of course (?), "the rub": C++ is... well, after this "very
important" thread, surely.


 
Reply With Quote
 
Jan G
Guest
Posts: n/a
 
      09-30-2012
Krice wrote:
> On 27 syys, 11:44, Brian <(E-Mail Removed)> wrote:
>> I have not found an answer to the question why C++ is the most
>> preferred language.

>
> It's multi-paradigm which seems to be good in programming
> languages since one paradigm alone can be restricting. C++
> is mainly OOP language and I think OOP is the best paradigm
> we have at the moment.
>
> C++ has a good, clear syntax even it's "long" and some people
> think it requires too much writing. Still, some programming
> languages to me look like this: q(:+05,C-/(-Ae),"hello":r)
> which explains why they are not as preferred. C++ is quite
> easy to read if it's well written and don't have any fancy
> programming magic.
>
> C++ is also fast, a feature that can't be underestimated.
> Most programs work better if they have that extra speed
> coming from the simple low level structure of C++ executable.


You win, the BOOBY prize: first to respond and ready to show your
"competence". (If war is such a good thing, why doesn't anyone smart
enlist?). Could it be that C++ is actually a BAD programming language? (Not
that it is in any way a reflection on it's creator (if it is bad). While
that COULD be so, I would instantly dismiss anyone suggesting such). That
said, if it is GOOD, did he just get lucky? Then I say, "good for you, you
were lucky". That said, isn't it a said state of affairs, I mean, if it was
that someone had to "get lucky"? I know a lot about luck, because I don't
have any (OK, I actually don't even like "luck").


 
Reply With Quote
 
Jan G
Guest
Posts: n/a
 
      09-30-2012
BGB wrote:
> On 9/27/2012 3:44 AM, Brian wrote:
>> 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.
>>

>
> because it sucks less than the other options?...
>


Surely because YOUR language did not "take off" because you were
discriminated against because of your refusal to write even one full
sentence? Surely you are just waiting to say "I told you so!". If what you
have is so good, you wouldn't need to TRICK people into "finding" it. You
don't have "nothing" (everyone has some worth, any engineer ... well, don't
draw conclusions), (I hypothesize), but what you have is not apparent (not
that I ask you to make it so). Don't reply to this post, for it is not your
"lotto ticket".


 
Reply With Quote
 
Jan G
Guest
Posts: n/a
 
      09-30-2012
Lynn McGuire wrote:
> On 9/27/2012 4:38 AM, BGB wrote:
>> On 9/27/2012 3:44 AM, Brian wrote:
>>> 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.
>>>

>>
>> because it sucks less than the other options?...

>
> +1
>
> Lynn


Lynn, that you are a newbie to the spiel and that there should not be
anymore newbies, is quite disconcerting.


 
Reply With Quote
 
Jan G
Guest
Posts: n/a
 
      09-30-2012
Nick Keighley wrote:
> On Sep 28, 4:56 am, Brian <(E-Mail Removed)> wrote:
>> BGB <(E-Mail Removed)> wrote:
>>> On 9/27/2012 3:44 AM, Brian wrote:


>> If I were to ask software companies what language the program they
>> are selling in written in then I have a feeling the answer would be
>> either C or C++.

>
> yes but that's just a feeling.


Prove it. The poster you responded to "had a feeling" that, well what he
said, but you COUNTERED with "yes but that's just a feeling".

YOU, Mr., are on THIN ice. Not to be timid, I am of course saying: Put up or
shut up.




 
Reply With Quote
 
Jan G
Guest
Posts: n/a
 
      09-30-2012
BGB wrote:

[his same old spiel: "my java virtual machine-like thing and reflectory
bombasitcalistic heterohomongenous syntactical stratocaster-based ... um, I
forget, what was he "on" about in his youth?]


 
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
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Why is OO popular? Ian Roberts C++ 5 04-20-2004 05:30 AM
Are Dvd-R more popular then the +? Why? lbbs DVD Video 29 01-11-2004 02:14 PM
Are Dvd-R more popular then the +? Why? lbbs Computer Support 9 01-08-2004 12:24 AM



Advertisments