why is it always c or cpp

New to FreeBASIC? Post your questions here.
JaDogg
Posts: 345
Joined: Apr 13, 2008 12:11
Location: Sri Lanka - Negombo
Contact:

why is it always c or cpp

Postby JaDogg » Aug 12, 2008 3:47

every programing website or forum i visit nobody forget to talk about c
even c seems to harder than masm (to me)
but please tell me why some people think c is better than basic
KristopherWindsor
Posts: 2428
Joined: Jul 19, 2006 19:17
Location: Sunnyvale, CA
Contact:

Postby KristopherWindsor » Aug 12, 2008 3:57

Kristopher has all the answers, but he decides to lock the topic and keep you in the dark.
Now... where's my admin powers? :P
Mysoft
Posts: 776
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Postby Mysoft » Aug 12, 2008 5:39

in my opinion C is only "better" cuz was the one that got the better popularity (and then more improvements...)

but the reason, is that C syntax allow better optimization, cuz it works closer to the HW than BASIC, and in general basic doesnt have good structure mode, and things like that...

due to the lack of competition language... you can found almost everything in C... but only a little in VB (that is the only basic version that big companies use)

so for me FreeBasic, have more power than C have (except for optimized code, that counts a lot), i will not mention C++ and it full classes... nor .net framework or etc... cuz freebasic doesnt have support from those big companies that produces those things, so it have less power to make things happen...
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Aug 12, 2008 17:24

It's all the damn quirks. (IMHO)
jevans4949
Posts: 1151
Joined: May 08, 2006 21:58
Location: Crewe, England

Postby jevans4949 » Aug 12, 2008 18:57

C is (I guess) easier to implement, since there are fewer statements in the core language; all the things like input and print are in library functions which can (mostly) be implemented in C. I'm not sure of the history, but the source for the compiler was probably fairly easily available, which would give you a leg-up in implementing your own.

It also allowed you to interface to asm routines, especially interrupt type things, which GWBasic and QBasic really don't.
Mysoft
Posts: 776
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Postby Mysoft » Aug 12, 2008 20:50

Qbasic Allow Machine Code Execution... i can compile fasm code and output a .com file that can be directly loaded and executed by QBASIC

it just that isnt EASY as inline asm... that freebasic/C/? have =)
jofers
Posts: 1525
Joined: May 27, 2005 17:18
Contact:

Postby jofers » Aug 12, 2008 21:34

C is a mature, widely used, consistent, stable, officially standardized language which probably has the world's largest codebase. Furthermore, it is likely the only high-level language with support for every microprocessor in use.

Now, compare that to a language with 50 different forking dialects varying vastly over the past 40 years, limited support, and even less available code and tell me why anyone uses BASIC.

The obvious answer is that it's easier to learn. Little things, like not having a main function, and of course "the damn quirks" make it easy to write a 5-line fluff-less program that demonstrates exactly what you're trying to teach without any bizarre symbols to memorize.

But beyond that, I'd rather use a more consistent language.
JaDogg
Posts: 345
Joined: Apr 13, 2008 12:11
Location: Sri Lanka - Negombo
Contact:

Postby JaDogg » Aug 13, 2008 9:56

yes you all are correct
but dont you think basic should recieve much more respect because its older than c
jevans4949
Posts: 1151
Joined: May 08, 2006 21:58
Location: Crewe, England

Postby jevans4949 » Aug 13, 2008 12:44

JaDogg: Respect for age is not a part of IT culture, nor should it be. The question should always be: what is the "best" software tool to address the job in hand.

Sometimes one piece of software does a particular task well, sometimes another. In other cases a piece of software just doesn't have the function you need at all.

Of course, in software development a lot of this is down to personal or organisational methods of working.
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Postby arenth » Aug 13, 2008 18:10

Some people think C is better because those who go on and on about the merits of one language over another usually don't actually have that much experience in many other languages. C is not better then BASIC. It's better then BASIC at some things.

For example comparing FB and gcc.
C is faster. (Optimizing compiler)
FB is faster to code in. (Try complex string manipulation in C)

C has a great library of supporting libraries, written specifcally for it.
Fb can use those same libraries, though with a bit of work.

The list could go on.

In the end though, what does it really matter, C is a great language, FB is fun (and a great language too), use what makes you happy.
marcov
Posts: 2929
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Aug 14, 2008 9:55

arenth wrote:Some people think C is better because those who go on and on about the merits of one language over another usually don't actually have that much experience in many other languages. C is not better then BASIC. It's better then BASIC at some things.

For example comparing FB and gcc.
C is faster. (Optimizing compiler)


I think you should differentiate between "optimizes better in this and this situation because of historic bagage", and "this language is faster than that because average use needs less helpers".

FB is faster to code in. (Try complex string manipulation in C)


That's indeed what made me stick with Pascal.

C has a great library of supporting libraries, written specifcally for it.
Fb can use those same libraries, though with a bit of work.

The list could go on.

In the end though, what does it really matter, C is a great language, FB is fun (and a great language too), use what makes you happy.


Personally I think (but I'm biassed) that FreeBasic tries to be too much C-like. Same for adapting the gcc backend. Which means you can't (or harder) play-out your strengths on non-unix platforms and where gcc is relatively weak, because you inherit those weaknesses.

Which reminds me, I must finish the overview doc about the unit/module system that I'm preparing for FB devels :-)
Antoni
Posts: 1393
Joined: May 27, 2005 15:40
Location: Barcelona, Spain

Postby Antoni » Aug 14, 2008 13:28

JaDogg wrote:yes you all are correct
but dont you think basic should recieve much more respect because its older than c

Then FORTRAN should be the most respected language...
marcov
Posts: 2929
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Aug 14, 2008 14:20

Antoni wrote:
JaDogg wrote:yes you all are correct
but dont you think basic should recieve much more respect because its older than c

Then FORTRAN should be the most respected language...


Personally I would bet on the language where Ada, Queen of Machines, Mother of All Programmers, programmed in:

The Analyical Engine's language: http://en.wikipedia.org/wiki/Analytical_engine

It predates Fortran by more than a century
redcrab
Posts: 619
Joined: Feb 07, 2006 15:29
Location: France / Luxemburg
Contact:

Postby redcrab » Aug 14, 2008 15:21

sorry but I couldn't resist to post this (from QBExpress)

Image
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Postby arenth » Aug 14, 2008 21:33

marcov wrote:
arenth wrote:...
For example comparing FB and gcc.
C is faster. (Optimizing compiler)


I think you should differentiate between "optimizes better in this and this situation because of historic bagage", and "this language is faster than that because average use needs less helpers".

...


Actually it remains a valid and accurate point, FB does not optimize anywhere near as much as something like gcc, and therefore on an average basis, even near equivalent code will run faster in C then FB.

Its not really that important of an issue, and wasn't intended to elicit any sort of response. Simply put, its an edge (albeit a tiny one) C has over FB in that very specific field.

When it comes down to it, I'd gladly trade the marginal performance hit FB suffers for the immense volume of effort it saves me in codeing.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 11 guests