Full Version: Straying to C++
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
If I was asked about who would I rate the 'C' language, I would say it is just a genius work. It is the best language out there (opposed to C++ which is such a BAD O.O. hack). The way it is conceived allows you to perform almost anything.

Someone complained about the string handling funcions. At the very beginning, I also was puzzled about how C handled strings, but once you learn how memory is allocated and how pointers work, working with strings is a children's game. I am writing a "Japanese Graphic Adventure-like" interpreter in C and I had to write tons of string routines... I haven't had any problems.

C is for real programming Wink
Quote:If I was asked about who would I rate the 'C' language, I would say it is just a genius work. It is the best language out there (opposed to C++ which is such a BAD O.O. hack). The way it is conceived allows you to perform almost anything.

Why is C++ 'bad'? It provides a lot of useful additions to the powerful C language.. and you can still do everything with C++ you can do with C anyway, but you have the option of structuring your code better using classes & objects. The only thing I don't like is multiple inheritence, as it makes things confusing for a sloppy coder like me Smile
the "c" language (an update to 'b', a language created by bell labs i think) is just another syntax. it isnt the "language" that's "genius" it's the compilers made for it. the fact that there isnt a fast basic compiler doesnt mean the language itself is slow, it's just a way of representing clumps of machine code in a readable form.

and if you ask me, c++ gives you a lot more control than c does, but, then again, that's just me again.
Well, C++ is a hack in my opinion, as it is some kind of patch to C. When you have to write a OO language, you better start from scratch rather than adding features to an existing one.

I am saying this 'cause C++ is not a true OO language 'cause it allows non-OO techniques, and that could be cheesy. IMHO.

Java is better conceived as an OO language. Yeah, it is interpreted and slower and such, but I am talking about design. If Java had a good compiler like C++ has, it would kick ass.

Anyhow, I am very acustomed with structural and procedural programming, OO makes my life harder so I avoid it. C by itself provides enough functionality, IMHO.
You can do OOP in Qbasic.

However OOP with Java "classes" having each sub and main class in a separate file is just a bad idea. It's hard to test and it's hard to debug, IMHO. But professors don't care, so they teach you Java.

You can't do OO in QBasic, just strutured programming. It is different. Bot OO and SP have types and sets of SUBs with related functionality, but only OO leaves you to have pieces of executable code embedded in those objects, and things like hierarchy and software abstraction, things impossible to achieve in SP (you can use any FUNCTION anywhere, and this could be dangerous when working on a large project where many people is involved). Also QB lacks pointers, and that feature makes it very lame, IMHO.

The Java feature of having each class in a separate file is not a problem as long as you use a good IDE. With such a facility, your project will look like *exactly* as your QB program in the QB IDE where you have each SUB/FUNCTION in a separate "screen" or section.

I like storing each object definition in a separate file, just to be tidy. It is easy to copy some files to the new folder where you are gonna start your new project rather than having to do hours of copy and paste skimming thru' a bunch of untidy files full of both code and declarations.
Qbasic cannot do OOP period. OOP isnt just having classes and methods, it also includes features such as inheritance, polymorphism, abstract classes, class and method protection, templates and more. When used effectively, OOP is a very powerful way of programming (very suitable for large groups engineering large projects). Of course not everything lends itself to OOP, which is why other forms of languages exist (structural, functional, etc).

C++ is a terrible hack as Na_th_an said, it has ambiguous syntax problems ( << operators cause problems), multiple inheritance can be a nightmare, its attempts to remain backward compatible with C have destroyed its potential as a good OO language (and it isnt even fully backward compatible either). Unfortunately it seems to have ammased quite a following in the software engineering world, although Java and some of the .NET languages are now challenging this.

C is as Toonski said the successor to the language B (written by Kerrigan) which was the succesor to BCPL. B was a pretty terrible language and with the help of Dennis Richie, Bell labs produced the first C compiler which they used to reimplement UNIX portably.

Its not just the compiler that makes a language, but also the design. C was designed as a portable language that lends itself very well to system programming. Java was designed as a cross platform true OO language (and succeeds very well), QB is designed as a simple, fast language to learn. You wouldnt use QB or Java to write a hardware driver, nor would you use C to write an internet applet, regardless of the compiler. Language design is very important. Poor design is the reason languages such as PL/I dont exist anymore.
Reading loosecaboose is just music Smile

But, programming a business application in COBOL, who's a business oriented language (as you can read in the acronym), is still an annoying task. [Image: biglaugh.gif]
Wow, cheers guys. Now youve got me all embarrassed. :oops:

Yeah COBOL and Fortran were both disgusting ugly languages, the former having the horid captials everywhere syntax (which basic unfortunately picked up). Interestingly enough, both languages still have quite a following. You can even get object orrientated COBOL and Fortran if you really want to :o.

I think Java is a very nice language for bussiness applications, its much simpler than C/C++, excellent for software engineering in large groups and is highly web based (Companies can use applets, etc on intranets and global web pages). All this garbage about it being slow is unfounded, you can get JIT compilers if the VM issue bothers you that much and processors are getting sooo fast these days that bussiness application speed isnt even an issue anymore.

A good programmer learns which language is approiate for which task. I recently wrote a six line awk program (scripting language) for parsing data out of a UNIX syslog and creating a spreadsheet from it. I could have written it in bash, C or Java but it would have required far more effort for the same results.
Pages: 1 2 3