Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-

I tried growing a beard

Name: Anonymous 2006-10-14 5:27

...but I ended up taking my pants off too much.

Why do people use C when there's C++ anyway? C is so... unorganised.

Name: Anonymous 2006-10-14 5:52

To each his own.
Some people might have learned C, and never bothered with C++.
Also, there are fanboys.
Also, some stuff, like Ethereal plugins (last I checked) has to be written in plain C.
Happy-kai?

Name: Anonymous 2006-10-14 7:29

Saying C is unorganised when comparing with C++ is risible.

C++ is an unorganised mess (now). C's problem is that it's too low-level. C++ started off as a set of goodies and improvements on C, but it got a bit out of control after a while...

Name: Anonymous 2006-10-14 7:59

>>1
Because C++ is overcomplicated and disgusting for OO, and provides really nothing over C. I'm not the "There's nothing you can do in Python you can't do in C" guy, of course higher level languages are more productive and nicer to work in, but in the case of C++, you get a similarly complex, low-level language without any real advantages other than perhaps namespaces, at the cost of a lot of complexity and a huge set of features you have to remember, unless what you're writing is C++--.

Name: Anonymous 2006-10-14 9:02

>>4
C++ has the speed of C and the OO part, there is absolutely no other language on this planet that can do this right now.

Name: Anonymous 2006-10-14 10:36

>>4
Overcomplicated? How? I'm doing just fine with my multiple inheritance, <vector> and things like that.. not to mention the memory handling more straightforward

Name: Anonymous 2006-10-14 12:00

>>5
C++ has the speed of C and the OO part
Who said you want that done that way?

>>6
Multiple inheritance is fine, but nested templates and the memory management hell is not my idea of fun.

Name: Anonymous 2006-10-14 12:31

Overcomplicated? How?
H-o-l-y shit. Use a dynamic OO language. Any dynamic language. Yeah, we all know they're not as fast, but you're fucking insane if you think C++ isn't overcomplicated.

Hell, if you just HAVE to have it static, try Ocaml. Ocaml's already pretty ugly, but it's many times cleaner than C++, which is really saying something. Or poke a bit at Objective-C, which is a hybrid.

Have you ever used anything other than C++?

Name: Anonymous 2006-10-14 13:08

>>7
| Who said you want that done that way?

I do. I decide what I want to do and the tools I'll use. No one else does.

| but nested templates and the memory management hell is not my idea of fun.

Pussies fail at managing memory. And what managment? Object o; -> created and automatically destroyed for you.

Name: Anonymous 2006-10-14 13:10

>>9
I do. I decide what I want to do and the tools I'll use. No one else does.
Hint: Use assembly. C++ is making many decisions for you.

And the fact you think memory management is trivial or unnecessary shows you've never written anything over 200 lines of code.

Name: Anonymous 2006-10-14 13:18

>>10
| Use assembly. C++ is making many decisions for you.

Not when you can deduce the assembly code generated by the compiler.

| you've never written anything over 200 lines of code.

No one count lines of code anymore, noob. And YES, memory management is trivial.

Name: Anonymous 2006-10-14 15:15

This thread makes my head hurt.

C++ does have tangible benefits over C, and anyone who says otherwise simply hasn't written any applications of reasonable size. Language-level OO and forms of generic programming are incredible productivity boosts all around, and are, frankly, far safer than C's methods of managing data.

But, even then, to say that it's a clean design is a joke. It's a language where the standard library basically evolved out of "hey, this template stuff is kinda neat and it can all do this." All the way until the specifications for how templates work exploded into a horrible, horrible mess. And don't even get me started on the compiler error messages.

Memory management is easy peasy in C++ right up until you start dealing with references to data, or multiple things referencing something, or objects having to reference ach other. Then you get to make nightmarish messes of handles or have to resort to things like reference counting/garbage collection libraries, which can be a pain to implement and both have their drawbacks. Not to mention it has a tendency of making a mess of C++'s safe data management. While these can be pretty easy to maintain for a single-person project, as soon as you start adding other people to the mix it quickly becomes a nightmarish headache.

There's a reason most of my development these days avoids both C and C++ unless performance intensive code is absolutely mandatory.

Name: Anonymous 2006-10-14 16:54

"High thoughts must have high language" --Aristophanes

Name: Anonymous 2006-10-14 17:44

>>13
all language wars are now over

Name: Anonymous 2006-10-14 21:00

>>12 spoke great truth.

Oh, and here's a mind-bender for the few ignorant wankers who still believe GC is evil: GC is necessary for type safety. Why do you think all functional languages have it?

Enjoy your dangling pointer AIDS.

Name: Anonymous 2006-10-15 3:50

| GC is necessary for type safety.

Where are you pulling this shitty quote from? Uranus I guess...

Name: Anonymous 2006-10-15 13:51

>>16
Basically he's stating that if you explicitly deallocate memory and then create another chunk at the same location while references to the original memory block still exist(aka dangling pointers), you've broken safety and created a memory error. "Type safety" isn't quite the correct term here but it is what Wikipedia uses, and that's about as accurate as ever.

GC handily gets around that by not having any explicit deallocation whatsoever, ensuring that all references are valid at all times. Of course, this also causes fragmentation and cache misses as the program ends up allocating new memory like crazy until the GC kicks in.

Name: Anonymous 2006-10-15 15:01

>>12

Use smart pointers

Name: segin 2006-10-15 15:04

>>15
No, that's not it, it's just that I find C++ to be fucking confusing

Name: Anonymous 2006-10-16 5:41

>>16
Ever heard of Andrei Alexandrescu? Yes, that Andrei Alexandrescu, one of the bigwigs of the C++ world. A search in groups.google.com will return plenty of hits: http://groups.google.com/groups?&q=alexandrescu+garbage+collection+type+safety

Read comp.lang.c++.moderated a bit more often, okay? I'm not even a C++ programmer fer fuck's sake!

Name: Anonymous 2006-10-16 19:21

if you do explicit object creation and destruction you don't need a GC to ensure type safety. You're thinking too low level. You can use references like java where it doesn't matter how memory is allocated, a reference to an object is always typesafe.

Name: Anonymous 2006-10-16 20:50

Pah. Stale pointers lead to undefined behaviour, instead of broken type safety. It's true though that allowing memory to be collected exclusively through GC results in never having a pointer to a block that has been reassigned, however the benefits (and indeed the typesafety argument itself) are purely academic.

Name: Anonymous 2006-10-16 22:02

however the benefits (and indeed the typesafety argument itself) are purely academic.
Segfaults are purely academic?

Name: Anonymous 2006-10-17 11:57

>>23
hi-5

Name: Anonymous 2006-10-17 16:00

>>22
Your view was widely accepted 20 years ago. Reality has since caught up with academia. Enjoy being mocked by your peers for your outdated views. Loser.

Name: Anonymous 2006-10-17 16:03

>>20
loooooooool, more shitty material from university teachers who never used C++ in the real world...

Name: Anonymous 2006-10-17 16:17

>>26
loooooooool, more shitty replies from highschool students who never used C++ in the real world...

Name: Anonymous 2006-10-17 17:40

After hearing so many horror stories about C++ (and dabbling a bit with the Half-Life code when I was younger), I was pleasantly surprised when I finally got around to learning C++. The more "late" aspects of C++ are actually quite good to work with, and Boost is just awesome =D

See also http://c2.com/cgi/wiki?LateCeePlusPlus

Name: Anonymous 2006-10-18 2:41

>>28
Indeed, most C programmers here are just K&R fanboys that can't accept any authority other than ANSI (lol) because that would make them unamerikan.

Name: Anonymous 2006-10-18 6:04

>>29
I know /prog/ doesn't exactly attract the most intelligent of posters, but you don't need to be _that_ stupid.

Name: Anonymous 2006-10-18 8:54

>>30
__that__

Name: Anonymous 2006-10-18 10:16

__that stupid()

Name: Anonymous 2006-10-18 14:30

>>30
def python_six(self):

Name: Anonymous 2006-10-18 20:20

>>29
I'm European and I use ISO C99. I'm also a K&R fanboy and want to kill Stroustrup.

Name: Anonymous 2006-10-19 9:28

So in what way could C actually be considered better than C++ these days? It doesnt have a speed issue anymore, and C++ allows for better structure within the code?

Name: Anonymous 2006-10-19 9:32

>>35
Elitism.

Name: Anonymous 2006-10-19 11:09

>>35
stdio.h >>> iostream

Name: Anonymous 2006-10-19 12:28

>>35

Some embedded systems don't have C++ compilers, only C

Name: Anonymous 2006-10-19 14:15

>>37
stdio sucks, I only printf with OpenGL, I'm l33t.

>>38
what are you waiting to write one? sitting on your lazy ass won't help you...

Name: Anonymous 2006-10-19 15:50

>>39
No I'm not wanting to write one. Look at the comment I was replying to, I was explaining where C can be considered better than C++, i.e. where C++ is not available because it's too complicated for the platform being programmed.

Name: Anonymous 2006-10-19 16:41

>>40
grammar please!

Name: Anonymous 2006-10-19 17:44

>>40
Isn't that just a matter of changing the compiler though? It's still just machine code in the end.

Name: Anonymous 2006-10-19 18:46

>>35
It's easier to analyze, and easier to prove.

Of course, that's not saying much (I, it's C for crying out loud), but there's a reason why reference crypto algorithms are written in C, not C++. It's also why things like splint can exist.

OTOH, not many people need that degree of clarity. What they need is abstraction, which C isn't all that hot at.

Name: Anonymous 2006-10-20 5:42

>>23
Segfaults qualify as undefined behaviour. Wanker.

Name: Anonymous 2006-10-20 7:48

>>44
And why is that, hmm?

Name: Anonymous 2006-10-20 8:43

>>44

You are a retard.

Name: Anonymous 2007-05-29 16:45 ID:nGUjtw+I

I don't think we actually came to a reasonable conclusion in this thread. It must be discussed further.

Name: Anonymous 2007-05-29 17:24 ID:Heaven

>>47
C fails, C++ fails even harder. Thread over!

Name: Anonymous 2007-05-30 3:34 ID:EWpXySy3

penis :D

Name: Anonymous 2007-05-30 6:50 ID:gk1bMz70

>nested templates

WHAT.

FUCK.

Name: Anonymous 2007-05-30 10:50 ID:1ag7E8Nq

C is better than C++ because it's SIMPLE.

Analogous arguments that may be more or less true than the above statement:
Python is better than Perl because it's SIMPLER.
Scheme is better than Lisp because it's SIMPLER.
Programs with fewer lines of code than larger programs that do the same thing have less security holes because they're SIMPLER.

You can read the C specification in an hour and understand everything about the language. Sure, it doesn't support every paradigm of programming out there (neither does C++!), but the result is that the idioms are quickly recognizable by other programmers.

C is much easier for static code analysis tools like lint to work with.

More people know C than C++.

C++ has plenty of nice ideas shoehorned onto C (the best of which were added back to C to make C99), but I'll stick with the C's workhorse rather than C++'s sprawling "elegant" object/template/rtti/abstract container classes (all that and you still don't get closures! oops!)

Name: Anonymous 2007-05-30 11:01 ID:Heaven

Programs with fewer lines of code than larger programs that do the same thing have less security holes because they're SIMPLER.
IF THEY DO THE SAME THING THEY HAVE THE EXACT SAME SECURITY HOLES YOU IDIOT

Name: Anonymous 2007-05-30 11:04 ID:Heaven

>>52 has WMF and ANI exploits in his firefox on linux

Name: Anonymous 2007-05-30 14:15 ID:fG/+K8/P

Q: Why C?
A: Embedded programming.

Name: Anonymous 2007-05-30 14:17 ID:Heaven

>>53
Firefox doesn't do ANI and WMF.
THUS THEY'RE NOT THE SAME THING

Name: Anonymous 2007-05-30 14:58 ID:ceAWXN6/

C is older than you are, bitch, and it'll still be around when you are long dead.

Name: Anonymous 2007-05-30 14:58 ID:Heaven

This resurrected thread is funny.

There were a number of lucid, well-thought out posts that I agreed with. Then I realised they're posts I made. Whoops.

Name: Anonymous 2007-05-30 15:10 ID:Heaven

embedded systems are stupid and shouldn't be the reason for anything besides suicides.

Name: Anonymous 2007-05-30 17:17 ID:yBKzHetj

>>13

More like people high on crack need high level language because they can't think straight enough to use C, right?

Name: Anonymous 2007-05-30 19:52 ID:tdLcJZYp

Who are you going to believe >>51 OR AN IDIOT WHO OVERLOADS BITWISE OPERATORS(Stroustrup) ?

Name: Anonymous 2007-05-30 20:39 ID:Heaven

>>58
Kill yourself, lol.

Name: Anonymous 2007-11-07 22:52

I think Objective-C is a better OO language then C++ except you are forced to use that retarded NObject library.

Name: Anonymous 2007-11-07 23:13

Let's have some facts here

1) C and C++ can't do everything; However they can do anything any other language (except asm) can do.
2) C offers very little abstraction, C++ a bit more
3) C++ is more complicated than C.
4) Takes years to learn C. Twice the time to learn C++.
5) Using higher level languages that offer more abstraction allows people to concentrate to real problems rather than trivial ones that have been solved so many times before
6) Learning C or C++ and solving trivial problems for the sake of practice & knowledge is fine; else you're the cancer killing programming.
7) C++ is retarded

Name: Anonymous 2007-11-07 23:17

>>63
Oh, and 8) i forgot to add
8) C is not faster than C++. There's no speed in languages, only in algorithms and actual code. And assembly. In assembly it's documented how many cpu cycles each mnemonic takes, however in C or C++ or any other language they don't tell you that + is 'faste'r than *.

Name: Anonymous 2007-11-07 23:31

>>63
1. Your definition of "do anything" is wrong.
2. Well yeah.
3. You're getting good.
4. Meh, perhaps.
5. Sure does.
6. I like you.
7. ♥

Name: Anonymous 2007-11-08 0:33

>>64
>There's no speed in languages, only in algorithms and actual code.

C, Java... same shit.

Name: Anonymous 2007-11-08 0:36

>>63
>>64
>>65
Stop trying to find excuses for using toy languages like LISP, just because you're too retarded to work with languages that are closer to the machine.

Don't get me wrong. Guys like you are needed. There will always be people who code in assembler and others who can only do PHP. Just be honest about it and stop lying to yourself.

Name: Anonymous 2007-11-08 0:48

>>67
You're a troll, i'm sure i know every instruction of the assemblers you've EVER HEARD OF.
SPARC, MIPS, 8086, Z80, PDP11, WHATEVER. BRING IT BITCH

Lisp offers great abstraction, and YOU'RE A MORON BECAUSE C OR C++ ARE NOT CLOSE TO THE MACHINE.
INFACT, THEY HAVE *NO RELATIONSHIP* WITH THE MACHINE.
YOU FUCKING NOOB.

Name: Anonymous 2007-11-08 0:59

>>67
If I want to be close to my machine, I'll unzip and code some assembler. Maybe C. But Sepples? That's for faggots who want to get high level but have an irrational fetish for doing what the computer should do, and who aren't bright enough to understand a real high-level language.

Name: Anonymous 2007-11-08 5:02

>>67
OMG closer to the machine! Hell yeah! Keep wasting your time, faggot ricer.

>>69
Truth

Name: Anonymous 2007-11-08 8:42

>>68
>>69
>>70
LOL angry LISPfags.

Name: Anonymous 2007-11-08 9:39

>>71
No. We take the sane approach by getting stuff that works well ASAP then continually refining it to make it better.

Name: Anonymous 2007-11-08 9:51

>>72
Yes LISPfag, you can't code and need a language that dumbs it down to MBA level. What else is new?

Name: Anonymous 2007-11-08 9:53

>>69
and who aren't bright enough to understand a real high-level language.
The higher the level, the less skill is needed. Also limits what can be done with the language of course, but not like enterprise fags really care.

Name: Anonymous 2007-11-08 10:04

>>74 I think >>69 has his terminology backward

>>58
Kiss your cellphone goodbye bitch. That and anything made by PLC or CNC or microcontrollers or... or...

There's a lot more use for embedded than enterprise shit.

Name: Anonymous 2007-11-08 12:08

>>73
Lol, this is such an hilarious troll. COBOL and Java are the business language, and MBAs are more likely going to understand C. No chance in hell of them understanding McCarthy's original Lisp, let alone a modern Lisp.

>>74
The higher the level, the less skill is needed.
Big failure. You either think high level = Visual Basic, or are a troll. You need different skills, which are sometimes harder to gain (but yield better and faster results once got, hence you prefer high-level languages).

Also limits what can be done with the language of course, but not like enterprise fags really care.
You're definitely ignorant. You think high-level = Spectrum BASIC. A high level language such as Python has access to the same things an OMG OPTIMIZED C program would, including POSIX (or Win32) and any library you can use from C, and it can even improve it as you can use these functions as first-class functions, introspect them, etc. They can also handle octet buffers and bit masks before you ask, and they support memory mapping, low-level sockets (even though there are much better ways to use them), ioctl, and absolutely everything you would do from C, except __asm { OMG EAX, [ECX*2+OPTIMIZED] } which is not C nor standard anyways.

Name: Anonymous 2007-11-08 12:16

One word, the optional but not forced low level of language, thread over

Name: Anonymous 2007-11-08 12:19

>>76
If you think LISP is hard, just go kill yourself.

Name: Anonymous 2007-11-08 15:38

Why do people use C when there's C++:

My main reason: Exceptions. I hate exceptions. When you realize that most people using computers are idiots, there can be no exceptions. Failure is a given. I recognize three exceptions, all three of which may not be caught by a compiler:

1. Stack Overflow. Been there, done that, had a program that would cause a stack overflow on Windows XP, but not on Windows 98. And the 98 computer had less RAM.
2. Segmentation Fault. Invalid Page Fault, whatever you want to call it. In a protected mode environment, accessing memory not owned by the program.
3. Integer Division by Zero. Nuff said.

Name: Anonymous 2007-11-08 15:48

>>79
When you realize that most people using computers are idiots,
there can be no exceptions
using computers are idiots, there can be no exceptions
there can be no exceptions
no exceptions

Name: Anonymous 2007-11-08 15:52

>>76
>low-level sockets
Well THERE'S your problem!

Name: Anonymous 2007-11-08 16:42

I recognize three exceptions, all three of which may not be caught by a compiler (...) Integer Division (blah blah blah)

The stupid and moronic examples you gave just show that you do not understand what an exception is.

Name: Anonymous 2007-11-08 16:45

20% des voitures sont responsables de 60% des émissions automobiles. Peugeot s'engage ! C'est chiant la télé :'(

Name: Anonymous 2007-11-08 20:27

>>83
gb2/thirdworldcountry/

Name: Anonymous 2007-11-08 21:48

real high level programming means working with more powerful abstractions. If you really think abstractions aren't useful, sure, maybe you better stick with c.

Name: Anonymous 2007-11-08 22:33

>>82

So, what is an exception? Enlighten us.

Name: Anonymous 2007-11-09 2:00

>>86

NO EXCEPTIONS!

Name: Anonymous 2007-11-09 4:22

"Why do people use C when there's C++ anyway? C is so... unorganised."

Lol...it's exactly the opposite.  C is simple and clean, there's one way to accomplish any task and few exceptions to the rules.  A complete and exhaustive description of C fits in the ~100 page kernighan and richie book.

C++ tacks a couple of things onto C that makes it a much a less elegant language IMO.

The bottom line is if you want to do procedural programming use C and if you want to do object oriented programming use java.

Java is a pure OO language and this adds a lot in terms of clarity and consistency of syntax.

That said, both C and C++ are saddled with a couple of anachronicities(gotchas) having to do with the way pointers are handled and which data types are first class that makes them seem much trickier than they really are.  Ones you know those the languages are cake.

Name: Anonymous 2007-11-09 4:33

>>88
Java is a pure OO language
int vs. Integer: the final showdown.

Name: Anonymous 2007-11-09 9:39

"Why do people use C when there's C++ anyway? C is so... unorganised."

When the features of C++ aren't needed or wanted. Is that so hard to understand?

Name: Anonymous 2007-11-09 11:49

>>88 Java is a pure OO language and this adds a lot in terms of clarity and consistency of syntax.
You spelled Smalltalk wrong.

Name: Anonymous 2007-11-09 15:59

>>91
Java is a pure OO language
The why doesn't

int i = null;

work?

Name: Anonymous 2007-11-09 19:42

null pointer exception

Name: Anonymous 2007-11-09 19:51

I don't really think that has much to do with OO purity. but yes, java is not really "pure".

Name: Anonymous 2007-11-09 20:51

See Smalltalk, Eiffel or Python for a ``pure'' OO solution.

Name: Anonymous 2007-11-09 21:58

>>95
Python? Pure OO? Moar liek pure hackery.

Name: Anonymous 2007-11-09 22:24

>>96
why? everything in python is an object. so why isn't is oo?

Name: Anonymous 2007-11-09 22:47

Nothing is enforced, it's as much OO as PERL is. >_>

Name: Anonymous 2007-11-09 22:50

>>98
true, because python is multiparadigm. still, is way more OO than java.

Name: Anonymous 2007-11-09 22:57

Indeed, one look no farther than this statement to prove that:

int i = 0;

Name: Anonymous 2007-11-09 23:48

>>100
100GET

Name: Anonymous 2007-11-10 0:11

var i:Integer=null;

Name: Anonymous 2009-03-06 13:21


They're not enclosed in!

Name: Anonymous 2009-08-17 0:43

Lain.

Name: Anonymous 2010-11-02 13:41

Name: Anonymous 2011-02-03 6:18

Name: Anonymous 2012-03-28 2:23

my farts burn my anus
it hurts
in a good way

Name: Sgt.Kabuʁ麃kiman 2012-05-28 20:37

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List