Why is C++ hated so much here in /prog/? Many good software are written in C++.
I'm aware that there are some problems in the language and it is considered "hard" to master it, but why do so many people hate it? What harm has it done?
Software can be written much quicker when using some scripting languages like Python. Software can be writte slightly quicker when using some managed language like Java. But when using those languages, the resulting program will require more resources to run. So there is place for C++.
For example, I bet the web browser of 99% people browsing /prog/ is written in C++. It's not perfect language, but it is the best language for complex program with relatively small CPU and RAM requirements.
For example, I bet the web browser of 99% people browsing /prog/ is written in C++
They usually develop their own class libraries instead using standard ones. And they use only a subset of C++. Thus you end reinventing the wheel. C++ is only useful for very big projects like web browsers, where every megabyte of memory and every cpu cycle is important to compete in a industry where every microsecond in a benchmark counts for marketing purposes.
But also take a look at memory leaks and bug reports on these C++ written browsers. Then you'll see why using that language is just wrong.
C++ is bloated OOP C done wrong. It's not compact, it's not as fast as it could be, it's not easy to develop, it's full of pitfalls, feature creep, overly complicated and not portable enough. It gets low-level things wrong and thus ruins the high-level abstractions it tries to give the programmer.
>>1 Many good software are written in C++.
They might be as well written in Brainfuck. That doesn't make Brainfuck a good language. I'm aware that there are some problems in the language
Too many problems. and it is considered "hard" to master it,
It's not hard to master, it's unnecessarily complex. but why do so many people hate it? What harm has it done?
The same harm COBOL, BASIC and FORTRAN did: it hinders the development and use of better languages. But when using those languages, the resulting program will require more resources to run. So there is place for C++.
We need better languages for system programming, C++ is not one of them. Until recently, nobody cared about making better system PLs, because if they did, they would just be discarded for being ``not C++''. And this is part of the harm it has done, along with C, COBOL, FORTRAN. For example, I bet the web browser of 99% people browsing /prog/ is written in C++.
Again, it might be as well written in COBOL, it doesn't make COBOL any better.
Name:
Anonymous2012-01-08 13:11
>>13
Ok, could you list some of the worst problems that C++ has? Some problems that make it worth hating?
>>17
Anything with a module system is better suited for large project than C++.
Name:
Anonymous2012-01-08 13:21
>>15 Have you read your C++FQA today?
I read some of the "Big picture issues" there. Most of them are just claims without exaples or proof.
It's a little outdated, since C++11 fixes some problems, and introduces some of its own.
So is there any point in that page in that case? I think not. New projects should use C++11 standard anyway.
>>11 web browsers, where every megabyte of memory and every cpu cycle is important LOL!
Name:
Anonymous2012-01-08 13:22
>>16
There are many problems with garbage collection. It isn't suited for most of the projects that C++ is good in.
Name:
Anonymous2012-01-08 13:26
>>19 New projects should use C++11 standard anyway.
And not be able to compile their projects?
Name:
Anonymous2012-01-08 13:28
Alternatives to C++:
Objective-C is much better than C++. And Apple has invented for the latest version of the compiler this nice automatic memory management that inserts free() calls (well, the ObjC release message) at compile time so you end with code without GC.
C# is good too. It compiles to native code using ngen.exe. But unfortunately it's controlled by Microsoft.
>>24 Objective-C
No, No, NO! HORRIBLE! Even C++ has nicer syntax.
C#
It's okay I guess... as a language. But the resulting program is slow because of the GC.
Java is shit.
Nah, just slightly worse than C#.
Name:
NIGGER2012-01-08 13:35
Why all da hate, mah niggaz? Learn to accept each other.
A hold tight all mini-van people
It name mini-van people gone to jamaica
One driver a dozen conductor
Yeah! mini-van people gone to jamaica
One driver a dozen conductor yeah!
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know hey
Now mi go a whisper mi nuh fi go ketch a mini-van
Some a hold on pon mi shirt and some a hold on pon mi hand
Some seh tek this mini-bus home seh tek this mini-van
This one to westmoreland this one to portland
This ya one out to trelawny this one to st ann
And the quickest way fi mek a dollar inna dem hand ya know
Mini-van people gone to jamaica
One driver a dozen conductor
Yeah! mini-van people gone to jamaica
One driver a dozen conductor tree!
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know hey
Now mi left from work with one intention
Mi fi ketch a mini-van and go to portland
I will need rest from midday come three young woman
One a hold on mi shirt and one a hold on pon mi hand
Mi haffi put down mi bag and stand up as a man
And tek di conductor dem my position
One a go a westmoreland and one a go a st ann
But my destination is to portland
Give thanks to di mini-bus association
Who set di jolly business out a action
Name mini-van people gone to jamaica
One driver a dozen conductor
Yeah! mini-van people gone to jamaica
One driver a dozen conductor yeah!
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know hey
Now mi go a whisper mi nuh fi go tek a mini-van
Some a hold on pon mi shirt and some a hold on pon mi hand
Some seh tek this mini-bus home seh tek this mini-van
This one to westmoreland this one to portland
This ya one out to trelawny this one to st ann
And the quickest way fi mek a dollar inna dem hand ya know
Mini-van people gone to jamaica
One driver a dozen conductor ya know
Mini-van people gone to jamaica
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know hey
Now mi left from work with one intention
Just fi ketch a mini-van and go a portland
I will need rest from midday come three young woman
One a hold on mi shirt and one a hold on pon mi hand
Mi haffi put down mi bag and stand up as a man
And tek di conductor dem my position
Dem a go a westmoreland and one a go a st ann
But my destination is to portland dem name
Mini-van people gone to jamaica
One driver a dozen conductor
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know
Dem have big one, small one, middle size one
Dem even a new one dem deh quarter million
Seh big one, small one, middle size one
Dem even have a one dem value quarter million dem name
Mini-van people gone to jamaica
One driver a dozen conductor
Mini-van people gone to jamaica
One driver a dozen conductor
Name:
Anonymous2012-01-08 13:36
>>26
Don't let the syntax scare you. It's a very nice language.
>>25
Why would anyone want to use that freetard shit?
Name:
Anonymous2012-01-08 13:55
>>25
So you would seriously recommend that a large project would try to use C++11 despite there being no compliant compilers yet? Not only that, you would recommend that a large project should rely on some bleeding edge unstable software that might or might not support parts of the language, and is untested?
Name:
Anonymous2012-01-08 14:16
>>28
But I enjoy coding in C++. C++ has better support and I really don't see any benefit in Obj-C compared to C++.
>>29
Because it's a good compiler. VC11 has pretty ok C++11 support as well.
>>19
No examples? What. Look at the rest of the FQA. So is there any point in that page in that case? I think not. New projects should use C++11 standard anyway.
Most of the points are as valid as ever, and, as I said, C++11 introduces flaws on its own.
>>37 expecting the creator of C++ to say anything logical about C
keep your bloat to yourself
Name:
Anonymous2012-01-08 15:28
C++ is used for games, if only because of the rate of growth and refinement of gaming technologies and the advance of hardware is pressuring game makers to improve their graphics and engines to a level like never before, requiring more power, and thus, to use a language needier on CPU than C++ would be a fallacy.
>>54 when going for/against a language, don't forget practical arguments as well as "BUT ITS LITPPPPPPPPPH"
Sure, but would you mind define what makes a programming language ``practical''?
Lots of libraries? Then no new language will ever be practical.
Standard C FFI interface? It may be impratical to implement if the platform isn't C-based.
Standard C API? Then I either must write the implementation in C the way the interface, or implement the interface and pay some performance overhead because my internal API does not map 1:1 with it.
Standard ABI? Then I'm stuck with that ABI, and I can't improve on it without breaking everything. Also, portability issues.
Standard FFI? It must be flexible/abstract enough to accomodate any platform and calling convention that existed, exist, and will ever exist.
Is this just mental masturbation? C will be the standard for at least another 20 years? See the Y2K problem. 20 years are fucking nothing.
I like C++ and there's nothing you can do about it.
I know C++, C, Python, Java, C#, Javascript, PHP, PL/SQL plus some BASIC craps. From these, C++ is my favourite. I very much enjoy writing C, which is very different from writing C++, and it's not very productive. I also enjoy very much writing Python, which is fast to write, but ridiculously slow. I very much enjoy writing in C++, which is more productive than C and as fast C (if programmed well).
Of course, the chosen language depends on project. For most web stuff and misc scripting I would use Python. For desktop most applications I would use C++. For embedded micro chip programming I would use C.
Also, Lisp is shit.
Also, even though GC is shit, I'm planning on learning some FP language.. maybe OCaml or Haskell.
It may be impratical to implement if the platform isn't C-based.
Most high level languages are a superset of C-based. It is hard to find high level language that doesn't have some equivalent to the function call stack. If a language was designed to work well with such architectures, the restrictions would be evident, and you would only want to put up with the restrictions if you were writing code for that architecture. It's true that it woulnd't make sense to use a FFI for C in this scenario, but you probably wouldn't want to use the language on different architectures.
Name:
Anonymous2012-01-08 18:41
>>64
>c++ is as fast as C
You obviously don't know shit, so your opinion is now irrelevant.
Name:
Anonymous2012-01-08 18:42
It is hard to find high level language that doesn't have some equivalent to the function call stack.
Stackless Python.
>>65 Most high level languages are a superset of C-based. It is hard to find high level language that doesn't have some equivalent to the function call stack.
Cactus stacks, segmented stacks, stack implemented as a linked list of activation records instead of a contiguous block of memory, and even CPS exist today.
C's (most) calling conventions are not suitable for tail calling (and, thus, CPS), multiple arity functions, and Lisp-style varargs (put everything in a list, which is the same as Python's).
Implementations must either jump through several hoops to get C interop, or maintain two stacks (the C stack, and its stack), or rape the C stack and use that.
Name:
Anonymous2012-01-08 19:45
>>70 stack implemented as a linked list of activation records instead of a contiguous block of memory
That's how the IBM System/360 and System/38 and their descendents do it. Arguments are also passed as a pointer in a specific register and stored in an entirely different location than the return address stack, and automatic variables are allocated from a heap and then deallocated before the procedure returns.
Name:
Anonymous2012-01-08 19:47
>>65 Most high level languages I know are a superset of C-based
fixed that for you!
Name:
Anonymous2012-01-09 9:47
>>66
Well, actually one can make cleaner and faster code in C++ than one can with C. Templates are very useful.
Name:
Anonymous2012-01-09 9:51
>>73
Templates are fucking slow. Debug them low-level if you can. So no, try again.
>>74
eh?? they only slow down the compilation process. They are not processed runtime.
Name:
Anonymous2012-01-09 10:05
>>64
DKIYT, but other than JavaScript thats a pretty blubby list of languages. You should at least try some of the symbol manipulation languages more (Haskell isn't really one of them, Lisp is).
>>73
Templates are absolute shit. The merits and demerits of C++ are surely somewhat debateable, but templates being garbage is an objective fact.
Name:
Anonymous2012-01-09 10:40
>>77
Hmm.. I might try some Lisp at some point, but Haskell seems more interesting right now. As a toy language of course, since C++ is for real stuff ;-) (don't take it too seriously)
>>78
Your "fact" seems to be quite subjective actually.
>>79
Haskell is definitely not a superset of C-based, though.
Name:
Anonymous2012-01-09 14:00
>>73
templates are a very bad solution for generic programming.
they have inconsistent implementation across compilers (even today, 20 years after templates have been "standardized"), horrible compile-time implications, absolutely impossible to debug (try debugging a boost class, I dare you) - even the compilation errors they cause require some skill and experience in order to decipher.
there are much better attempts at generic programming - .NET generics / dynamically-bound languages like python, and in some cases - even C macros are a better choice.
Name:
Anonymous2012-01-09 14:10
>>76
they also cause serious code bloat, which leads to more RAM consumption,paging and cache misses
here's a nice example: compile hello world using printf, and using cout. you'll see that iostream example results in a 10-20 times larger binary
I mean, what's keeping someone else from just choosing a random tripcode and use the name kodak_gallery_programmer? I'd believe it was you (I'm assuming the person I'm talking to actually is you, kodak) as long as they regularly called people mental midgets and told them to scrub another toilet.
C++ programs are larger by definition mainly because of static initializations and exception frames. In ELF targets, these things go on separate code sections, which enlarge the binary a bit further because of headers and alignments. Usual GNU-produced ELF targets are ridiculously bloated when compared to the average PE executable (just take a look at the number of sections generated for a simple Hello World C program).
If one strip out exceptions (-fno-exceptions in GCC) and avoid static initializations, the final executable has about the same layout any C executable would. The C++ boot code is also more complex, since it needs to walk through the initializer list and perform the forementioned static initialization, which is non-existent in C. This adds a bit more in its size.
The worst problem in C++ is the toolchain and the utterly ridiculous standard library. The language design is ok, put apart a number of warts (such as the need for three damn cast operators).
Once you get rid of the fat standard library, C and C++ programs are as slim as assembly-language programs to a great extent. Putting apart the standard C++ library is not a great loss, and it is rather easy to implement the necessary things in freestanding C++, both in Windows and Linux. (In Windows, by the way, the freestanding environment is actually the default one.)
Name:
Anonymous2012-01-10 3:59
>>81 .NET generics
Not as powerful as C++ templates.
C macros
They are powerful, but harder to read (for humans) compared to C++ templates. C++ templates are slightly safer.
>>15
I only read some random part a while ago, which turned out to be the part about why operator overloading in C++ is broken. Such utter BS. Didn't bother to read anything else after that.
Name:
Anonymous2012-01-10 4:52
Actually I made up the term ‘object-oriented’, and I can tell you I did not have C++ in mind.
— Alan Kay
“There are only two things wrong with C++: The initial concept and the implementation.
— Bertrand Meyer
"Fifty years of programming language research, and we end up with C++ ??" - Richard A. O'Keefe
"C++ is an insult to the human brain." - Niklaus Wirth
"Whenever the C++ language designers had two competing ideas as to how they should solve some problem, they said, 'OK, we'll do them both'. So the language is too baroque for my taste." - Donald Knuth
"C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it." - Linus Torvalds
Usual GNU-produced ELF targets are ridiculously bloated when compared to the average PE executable
Is there a gcc option to link and merge all sections into one? This is easy with MSVC and the /merge option.
>>96
Are you saying that it results in large binaries? Otherwise I don't see what you mean.. How would you avoid this bloat when implementing the same functionality (or the subset you need) in C++?
``As dinosaurs (who code exclusively in C) are becoming extinct, you will soon find yourself alone with attitude like this.''
- dude's reply to torbals
>>102
I quoted:
- Alan Kay, inventor of Smalltalk, object-oriented programming and colaborator on the first GUIs at Xerox
- Bertrand Meyer, inventor of Eiffel
- Richard A. O'Keefe, computer scientist author of researching and books on logical programming and Prolog
- Niklaus Wirth, inventor of Pascal and Modula/Modula-2 languages.
- Donald Knuth. What should I say about this man? He've won a fucking Turing Award and he's written The Art Of Computer Programming. I bet you don't even know this book existed.
- Linus Torvalds, creator of the Linux kernel and git.
Maybe you didn't know these people or what they've done. But you should at least listen to what these people have to say. Because they have actually archieved something in computer science and engineering.
Name:
Anonymous2012-01-10 12:00
C++ introduces more problems to software development, it has a low quality standard library that nobody uses in large projects, it's slow, because the only thing it brings from object-oriented languages is Vtable dispatch, so you end up with a language that is as slow as a native/JIT-compiled high-level object-oriented language without the features of a true high-level object-oriented language, can't even define pure virtual/interface-like methods without a "virtual ... = 0;" weird syntax, no big OS brings a C++-base API (Windows uses C, Apple uses Objective-C, GTK+ uses C, only Qt uses C++ but without using the standard C++ library, and take a look at how full of bugs KDE releases are sometimes).
C++ is the main culprit of how big projects like Firefox need constant updates and bugfixes to fix memory leaks and security holes.
Name:
1022012-01-10 12:11
>>110
I knew 3 of those people (and now I know all of them). Yeah, they are smarter than me. That does not mean they are correct when they're saying C++ is horrible. Many smart people C++ is good (or at least ok) language.
I bet you don't even know this book existed.
I do know it. I bought the first chapter few months ago. I've just read maybe 50 pages (trying to figure out at least some of the exercises... ok it's fucking collecting dust in the shelf, too 'busy' right now).
C++ is not perfect. But there is no real alternatives to it, high level, compiling to native code and fast runtime (GC is too slow for some cases). Maybe Ada? Maybe not.
>>129,131
A subset can include the empty set if the original set does. I think you're confusing it with the power set or something. A subset is not a set of sets unless the original set is.
>>134
Nah, this comes from a programming project at work. I had a case where every elment in A and B were such that A was an element of B. But the rest of the idiots on here wouldn't know about such things because they just work general labor jobs -(.
Name:
Anonymous2012-01-10 15:59
>>136
I said "I believe" you fucking mental midget. Geeze, go google more shit instead of looking for a job.
Name:
Alpha Male!gD3Op2fhHs2012-01-10 16:02
>>135
You jelly that I am aesthetic and intelligent while you're just an ugly manlet that too dumb to understand even basic mathematics?
>>137
I work as an X (for some X), therefore the subset of a set is uncomputable.
Name:
Anonymous2012-01-10 16:07
Where performance is critical, C++ is a pretty good choice. Anyone care to say otherwise? C is good also in this respect, but I prefer C++ because of its extra features (OOP, template metaprogramming, function overloading to name a few). Its downside is its bloat.
Name:
Anonymous2012-01-10 16:10
>>142
Smalltalk did a much better job at OOP than what C++ did.
Name:
Anonymous2012-01-10 16:15
>>143
I haven't used Smalltalk personally. In what way did it do a better job?
One more thing I forgot to mention about C++. The thing that brings it down the most is its header/source model. I heard C++11 was supposed to have modules, but now it's expected for TR2.
>>142 Anyone care to say otherwise?
Me. Better languages can give the compiler much more optimization hints than C++.
You don't imagine how much time and resources we spent on making C and C++ go fast.
>>137 I had a case where every elment in A and B were such that A was an element of B.
I can't tell what you're trying to say. It sounds like you googled the definition of subset, tried to paraphrase so it didn't look like you were just copying and pasting, and failed miserably.
Also, going back to >>129, what does the empty set even have to do with subsets? {∅} is a subset of {∅,2}, just like {1} is a subset of {1,2}.
>>138
So if you say "I believe", nobody can call you on being wrong? Nice.
go google more shit
This is pretty simple stuff. I wouldn't be challenging other people's knowledge if I didn't even know what a proper subset was.
>>149
You're right, I'm a senior Comp Sci major. But apparently being a programmer doesn't teach you shit about set theory, because you have no clue what you're talking about. Since you're so smart, stop it with the ad hominems and answer the next part of my post. I'll post it again, since you conveniently missed it last time.
What does the empty set even have to do with subsets? {∅} is a subset of {∅,2}, just like {1} is a subset of {1,2}.
Name:
Anonymous2012-01-10 16:24
>>146
Try to ignore him, he's just another code monkey with no mathematical ability or talent, as a result he lacks the understanding of things like clear notation or logical thought.
I mean any person who writes
I had a case where every elment in A and B were such that A was an element of B.
clearly has no training in mathematical thought, and would be straight out laughed at by anyone with a basic level of knowledge.
Name:
kodak_gallery_programmer2012-01-10 16:26
>>151
There are several no trivial programming situations where the empty set is included in the subset. Also, you little fucking know it all moron, there is a vast difference between "googling shit" and "the real world".
>>153 So now, have many job offers have you gotten?
Several, and non-trivial.
Name:
Anonymous2012-01-10 16:28
>>145
Could you name these better languages? I can think of a few things C/++ could do to help the compiler, but I can't think of a language that actually has them (possibly because I don't know too many :p).
>>148
Well, implementing lambda's wasn't difficult at all. It actually works out quite nicely consider C++ already had functors.
@People talking about sets: A class of sets contains the empty subset. You can't consider a set in its own right to contain it.
A proper subset is a subset that isn't equal to its superset.
>>155
Does that mean that Starbucks offered you a position of janitor, while McDonalds made an offer for a cashier position, and you find it non-trivial to decide?
Well, implementing lambda's wasn't difficult at all. It actually works out quite nicely consider C++ already had functors.
What the hell are you smoking?
Name:
Anonymous2012-01-10 16:31
Kodak is a fucking retard, that he doesn't know basic mathematics illustrates that. The only highlight of his life is that some shitty company settled for him when they were looking for disposable code monkeys and when someone has a better job than him he just says that he doesn't believe them.
>>128 Hey Kodak, remind me what a subset is again? >>129 One that doesn't include the empty set?
...
>>153 There are several no trivial programming situations where the empty set is included in the subset.
That's it, I'm done. You are so fucking stupid.
Name:
Anonymous2012-01-10 16:34
>>160
Lambda's in C++ are essentially anonymous functors. What's missing, exactly?
Name:
Anonymous2012-01-10 16:34
>>162
I'm not the idiot that doesn't work as a computer programmer. Now go run off scrub another toilet. Again, you have no possible future as a computer programmer.
>>162
Remember, no logical thought and no clear syntax. I think he actually might be brain damaged since his English is riddled with mistakes as well and he seems to forget what he typed just a minute ago.
>>156
Immutable-by-default and mutability annotations would be a start.
First class support for statically checked contracts (with dynamic checks when needed) on functions and data structures.
A better type system, and an effect/region system. implementing lambda's wasn't difficult at all. It actually works out quite nicely
You cannot make polymorphic lambdas, so no.
Name:
Anonymous2012-01-10 16:43
>>172
What has that got to do with what he said? He's right, every subset of a countable set is countable.
Name:
Anonymous2012-01-10 16:46
>>173
That you have no clue as to what you're talking about. Now, for the 10th time, what do you do for a living?
Name:
Anonymous2012-01-10 16:46
>>175
I never said he wasn't right. I'm just saying he's a tad bit confused on what he just "googled".
wtf this thread just went to shit
BTW: if you're not a complete tool or have atleast a hint of logical thinking you can do stuff even without knowing 'big bad math buzzwords'
Name:
Anonymous2012-01-10 16:48
>>176
Are you completely incapable of following a simple mathematical evidence? The statement that every subset of a countable set is also countable is a proven statement, most proofs are just a single sentence long actually. Why do you continue to deny it?
>>179
I mean this thread was shit to begin with, then went to shit a couple of times,
the shittiness of this thread increases exponentially everytime someone posts
Name:
Anonymous2012-01-10 16:50
>>170
THIS IS WHAT THE JEWS WANT YOU TO BELIEVE IT'S ACTUALLY NOT TRUE KODAK HOLDS THE REAL TRUTH
#EVERYSUBSETOFACOUNTABLESETISALSOCOUNTABLEDENIERSDOTORG
KEEP FIGHTING THE CONSPIRACY
Check out posts 75 and 76 (where you also say that the interval [0,1] is a subset of the natural numbers) in 129 you say that the statement breaks down under certain conditions.
Name:
Anonymous2012-01-10 16:57
>>187
Go scrub another toilet you mental midget I'm done with you.
Name:
Anonymous2012-01-10 16:57
>>187
You're problem is that keep asserting absolute truth.
Name:
Anonymous2012-01-10 16:58
>>189
But it is absolutely true, have you no idea of what a proof is?
Name:
Anonymous2012-01-10 16:59
>>188
I'm not the idiot that doesn't understand what they're reading. Come back again when you understand what you just read.
Name:
Anonymous2012-01-10 16:59
Let us call a set "abnormal" if it is a member of itself, and "normal" otherwise. If N is a set of all normal sets, is N normal or abnormal?
Name:
Anonymous2012-01-10 16:59
lolol kodak cant do maths
Name:
Anonymous2012-01-10 17:00
>>190
Absolute truth, in math, would imply necessary and sufficient. You haven't provided both. Now go scrub another toilet.
>>198
Look at him, there he goes again trying to sound smart by posting something completely unrelated and full of errors, look at him and laugh /prog/.
>>205
And now what happens if I extend this to some large number N? How would I determine how many {1}'s I have in this case?
Name:
Anonymous2012-01-10 17:09
>>205
that would be a surjective mapping. i don't know what your point is
Name:
Anonymous2012-01-10 17:09
>>204
Go 'lol' some more for your grade school friends you fucking retard.
Name:
Alpha Male!gD3Op2fhHs2012-01-10 17:10
Hey Kodak this might not be a good moment to tell you, but I kind of banged that chick you think is cute, you know that chick from work? Good luck though brah, I'm sure if you scrub some more toilets that you'll be able to afford that leg extension operation you wanted so you'll no longer be as much of a pathetic manlet, you'll still be beta though so no chicks will bang you except for perhaps 3/10 chicks that are drunk.
>>207
The point is that I can't determine how many {1}'s I have in this set. In other words, it would be uncountable.
Name:
Anonymous2012-01-10 17:12
>>205
Nothing, {5}, {7} and {9} are all countable just like {1,2,3,4,5,6,7,9,10}, so the proposition is still true. Keep trying and failing though.
Name:
Anonymous2012-01-10 17:12
>>209
Yeah, that's about the extend of your IQ. BTW, you're still a huge fucking faggot.
Name:
Anonymous2012-01-10 17:13
>>210
Well then whatever set you're talking about isn't a subset of {1,2,3,4,5,6,7,9,10} so you have proven nothing, if it were then it would be countable.
>>214
Then you're not talking about any subset of {1,2,3,4,5,6,7,9,10} so you've achieved nothing. The proposition states that any subset of a countable set is countable, how is this difficult?
Do you even know what a subset is?
Name:
Anonymous2012-01-10 17:15
>>215
You still don't get it, do you. Again, do I determine the number of {1}'s in this kind of scenario?
Name:
Anonymous2012-01-10 17:16
>>216
Still, what is your point? Neither {5} or {1} is in {1,2,3,4,5,6,7,9,10} so neither of those are subsets.
Name:
Anonymous2012-01-10 17:16
>>217
I want how I would determine the number of {1}'s that are generated from this set of numbers.
>>218 Again, do I determine the number of {1}'s in this kind of scenario?
I have no fucking clue but it's completely irrelevant to the matter at hand.
Name:
Anonymous2012-01-10 17:18
>>221
Your question has absolutely nothing to do with the proposition that every subset of a countable set is countable, so there's no point in answering it.
>>222
That's why you have no future as a computer programmer. You don't know when this kind of situtation would arise nor do you know how you would approach such a programming problem.
>>225
What the fuck are you smoking you fucking retard? What you asked has nothing to do with the statement that every subset of a countable set is countable.
Name:
Anonymous2012-01-10 17:21
>>226
It's a programming problem from work you mental midget.
>>229
And what does it have to do with the statement that every subset of a countable set is also countable? Because that's still fucking true, it will always hold true and you're a fucking retard for denying it.
>>242
It's also broken, or you didn't understand the question. The problem lies in you.
Name:
Anonymous2012-01-10 17:29
>>243
This is coming from some fag who just knows how to google shit.
Name:
Anonymous2012-01-10 17:30
>>245
The inverse of a set doesn't make any sense, do you mean the inverse of the map? That's impossible of course, it has multiple values that map to a single value, yet this has absolutely nothing to do with the statement that every subset of a countable set is also countable.
Name:
Anonymous2012-01-10 17:31
>>246
No and no. The reason why you can't see "this" is because don't have programmer blood in you. Now run along and go scrub another toilet.
Name:
Anonymous2012-01-10 17:32
>>248
Yeah, the inverse of a map. Let's say we can determine the inverse. How many {5}'s, {7}'s, and {9}'s would I have?
Name:
Anonymous2012-01-10 17:33
>>249
So your inability to form coherent questions and well defined mathematical problems lies with him?
You still haven't disproved that every subset of a countable set is countable, go along and do that now. You just need a single instance and the statement is false, find me a single instance of a countable set which has an uncountable subset, go ahead.
Name:
Anonymous2012-01-10 17:34
>>250
And with a little imagination, you can have something like
Mary --> 5
Jenny --> 7
Kay --> 9
Name:
Anonymous2012-01-10 17:34
>>250 Let's say we can determine the inverse
You can't it's not well defined as there are several values that map to 1. You have yet to form a subset that isn't countable though.
Name:
Anonymous2012-01-10 17:35
>>251
Again, pleasee shut up and let the adults talk you unemployed faggot.
Name:
Anonymous2012-01-10 17:35
Ok, I'll be nice. Let's say these 1s are independent. 1-subscript-0, 1-subscript-1 etc. And basically these 1s belong to the set Y, and f:X->Y. It has to be a one-to-one correspondence if we consider these 1s independent, so the cardinality of Y is equal to X's. If X is countable, Y is countable. If X is uncountable, then Y is uncountable.
But what point are you getting at?
Name:
Anonymous2012-01-10 17:35
>>254
No please, enough with the ad-hominems, prove the statement wrong, you've stated that the statement is false, now show us why.
Name:
Anonymous2012-01-10 17:36
>>253
Well, isn't the inverse uncountable? I mean, I could have 7 {5}'s or 10,000,0000 {5}'s map to {1}.
>>245
the function f : {1,2,3,4,5,6,7,9,10} -> {1}; f({5}) = {1}; f({7}) = {1}; f({9}) = {1} is:
- Not well defined, because neither {5}, {7}, {9} are in {1,2,3,4,5,6,7,9,10}. It's a function from {{5},{7},{9}}.
- Not injective, since there exist an x and an y such that f(x) = f(y) and x != y.
- Not invertible, since it is not bijective (it is not injective).
Name:
Anonymous2012-01-10 17:38
Why is he trying to disprove something that is true?
http://en.wikipedia.org/wiki/Countable_set Proposition: Any subset of a countable set is countable. Proof: The restriction of an injective function to a subset of its domain is still injective.
Doesn't he know how mathematics work or something?
Name:
Anonymous2012-01-10 17:38
>>257
Since it's a surjective mapping, there is no inverse in the first place. You can't have 7 {5}s or 10,0000000 {5}'s... sets can't have duplicates.
Name:
Anonymous2012-01-10 17:39
"oops my bad, I had a brain fart". Is that hard to say?
Name:
Anonymous2012-01-10 17:39
>>257
No it's neither countable or uncountable, it's not defined at all. Let's say that it was, how is the function a subset of {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}?
>>252
Now that's a bijection!
let A be the set {Mary, Jenny, Kay}, and B the set {5,7,9}.
The bijective function f : A -> B is defined as: f(Mary) = 5
f(Jenny) = 7
f(Kay) = 9
The inverse f-1 : B -> A is: f-1(5) = Mary
f-1(7) = Jenny
f-1(9) = Kay
>>271
Well, given you're clearly too stupid to work as a computer programmer. Now again, shut up and just go "google stuff. Again, you don't have what it takes to write software for a living.
Name:
Anonymous2012-01-10 17:47
Kodak, the proof is in >>259. What do you have to say now?
>>275
I'm sorry, but it's you that's clearly googling stuff. And you're pretty bad at it too.
Name:
Anonymous2012-01-10 17:48
>>275
And you don't know how to do elementary mathematics apparently, what a shitty workplace you must have, how could a company ever settle for someone as retarded as you? I guess they're not relying on you, or perhaps they are, considering Kodak is going bankrupt.
>>280
It's not me that said that a function can be uncountable.
Name:
Anonymous2012-01-10 17:52
So Kodak modus operandi,
- make a false statement
- try to lie about it later
- when shown evidence that he's lying try to write some random bullshit strawman arguments
- get proven wrong
- ad-hominem attacks on the people who proved him wrong
- get faced with mathematical evidence that he's wrong
- ignore it
- claim that he's superior because he works at some shitty company who hires programmers without mathematical ability
- write some more random bullshit about undefined mathematics and pretend it's correct
- write some unrelated bullshit
- get told
And most importantly of all
- never admit to any mistake ever
Name:
Anonymous2012-01-10 17:52
Yes, and this is why we hate C++.
Name:
Anonymous2012-01-10 17:53
>>283
After what you've displayed of the talent there? No thanks, I'd rather not work with incompetent programmers.
To be honest I think Kodak has some serious mental issues, since he can never admit that he's wrong he's probably suffering from Narcissistic personality disorder or something to that effect. I think you guys should leave him alone and stop making fun of him.
Symptoms include:
- Reacts to criticism with anger, shame, or humiliation
- Tends to exaggerate their own importance, achievements, and talents
- Imagines unrealistic fantasies of success, beauty, power, intelligence, or romance
- Requires constant attention and positive reinforcement from others
- Easily becomes jealous
- Is easily hurt and rejected
I'm going to leave him alone, I don't want Kodak to hurt himself or anything, I had no idea he was a mental patient.
>>301 Reacts to criticism with anger, shame, or humiliation
It's hard to tell over the internet, but I don't think that's what is going on. I think he's just so stupid, he doesn't even realize that he is being proved wrong. The second, third and fourth are spot on, though.
>>313
If he's got NPD, he's not going to kill himself because some lowly creatures on an internet textboard think he's wrong.
Actually, it's the other way around, if we ignore him it will get bad for him. (assuming a closed environment where Kodak-kun's only social interaction is posting on /prog/, which is highly unlikely)
Now if you do a little digging you'll find that the mail belongs to a certain Matthew Harren. I don't know if kodak knows this person or not but I'm not taking any chances, I'm going to write a concerned mail to this Matthew Harren, and to someone who knows Matthew Harren in case it's actually him, I'm also going to mail Kodak that I'm very concerned about one of their employees, that they might be suicidal and I'll include as many details as possible about him.
>>325
According to http://www.cs.berkeley.edu/~necula/ this matthew harren graduated in 2007 and now works at Google. The interesting part of this is that one of the patents he has filed for Google had him listed as being from Fremont, CA, this is interesting because Kodak has said hella a couple of times, which is native to northern California.
Name:
Anonymous2012-01-10 19:00
>>328
I'm not sure, but why would he chose a random PhD student though? I'm going to assume that this person might know who Kodak is.
>>330
No, I just said that I live in northern California. Believe it not, I'm a Wisconsin native.
Name:
Anonymous2012-01-10 19:05
>>330
Okay I'm mailing this Necula fellow to tell him that I'm very concerned that someone who might be Matthew Harren is mentally unstable and quite possibly suicidal.
Okay so I have written and sent two very concerned mails to both Necula and Google's Fremont branch about a poster that identifies himself as Matthew Harren that seems to have suffered from some sort of mental breakdown and might be at risk of harming himself. I'm going to wait sending mails to Kodak and Harren himself till I get some sort of feedback from Necula. I'm going to bed now and will post results in the morning.
So,
* matth@eecs.berkeley.edu!!8TAzbhVOfn9F0d0 seems to be kodak_gallery_programmer!!kCq+A64Losi56ze (Kodak-kun).
* Kodak-kun has several tripcodes: !!+smk517PP2af+Xn, !!kCq+A64Losi56ze, !!RUok9kNlfAMW6vT, !!V98H8hw9ydTWLgo, !!VIk1pgCZf9P/QBQ, !!1ILcdKBYf7nyXyy, !!M8okqD4wRfs+xmp = ##kodak, !!NOuIr5+Z3dDMZ1a.
* Kodak-kun may be related to the constant jews spam (like >>350, we know it's you, Kodak-kun) of early/half 2011.[9]
* Kodak-kun may be related to the constant autism spam of the second half of 2011.[10]
* matth@eecs.berkeley.edu's address belongs to Matthew Harren, which graduated in 2007,[1] and is from Fremont, CA. He works at Google.
* The tripcode !!8TAzbhVOfn9F0d0 is generated by ##911evanshall
* 911 Evans Hall is the office of a berkeley math professor, Alexandre J. Chorin.[2]
* Kodak-kun worked as a Java programmer for Kodak Gallery at Emeryville, CA,[3][4][5] and then for Yahoo as a web monkey.[5]
* From the information we've got from various threads, he worked at Kodak Gallery at least from 2011-05-30 to 2011-07-21.[3][5]
On 2011-08-16, he was working for Yahoo, in Sunnyvale.[6]
On 2012-01-01, he was working again for Kodak Gallery, at 1480 64th st, ste 300, Emeryville, CA. He was there at 15:23 /prog/ time.[8]
Kodak Imaging Network
1480 64th St., Suite 300
Emeryville, CA 94608
510-229-1200
There's no Kodak Gallery on Hollis Street
dis.4chan.org/read/prog/1307886348/43 I'll be up in my cubicle at Kodak Gallery in Emeryville, CA
Senior Software Engineer only gets a cubicle?
The best part is that he never posts what floor he's on and he expects you to be able to walk in and write right up to him somehow. I'm also sure kodak has security as well to restrict random people from walking right into workspace and thus even if you knew the floor he was on you'd never make it to him and thus you will never find kodak-san.
Unless he posts a badge or something unique to that employer then he's full of shit. Probably some 20 year old drop out jelly of nearby Berkeley grads that do cirlces around his java shit.
Name:
Anonymous2012-01-11 5:22
So there is no good language to code in for such purposes.
C is obsolete. C++ is shit. C# is retarded.
Thanks /prog/, now I need to pick a new career.
Name:
Anonymous2012-01-11 5:23
So there is no good language to code in for such purposes.
C is obsolete. C++ is shit. C# is retarded.
Thanks /prog/, now I need to pick a new career.
Name:
Anonymous2012-01-11 5:23
So there is no good language to code in for such purposes.
C is obsolete. C++ is shit. C# is retarded.
Thanks /prog/, now I need to pick a new career.
>>367
3/10
What syntax? I can overload almost every operator! Fuck your syntax!
Name:
Anonymous2012-01-11 10:51
>>367
That's what you have a problem with? Provided you follow conventions, I don't see what the issue is.
Name:
Anonymous2012-01-11 11:28
What is convention in a language that uses bitshift operators for IO in the base language? Should "string" << 3.0f be a concatenation per convention? It would seem to be the behavior that would satisfy the principle of least surprise best, cout << "string" << 3.0f prints the string and number in succession after all... By extension 3 << 2 really should result in "32"?
Name:
Anonymous2012-01-11 11:53
Operators in C++ can be overloaded, which means that the "<<" operator is not the bitshift operator in every case, for the same reason the "+" operator can mean "concatenation" in some cases. Curiously, people go apeshit about "bitshifting" file objects but they don't speak a word about "summing" strings.
Whether overloading operators is good, it is a matter of personal opinion. The fact is that C++ is not the only language which implements it (Python also does, IIRC), but C++ has surely acquired some permanent critical target status due to no apparent reason than mere butthurtism.
The choice of the "<<" and ">>" operators for I/O have a rationale (which the committee has released, but probably no one has ever read it). One good reason for using (or abusing) operators is that it becomes easier to chain I/O calls:
but, besides it being yet more verbose, it's less intuitive (in my opinion) than to use any sort of operator, which is expected to be used in associative contexts.
It's a matter of taste. I don't think choosing operators for this task are an spectacular design choice, but I don't see many problems with them, either. One thing I think is very bad are the "manipulators" (std::hex and such). These are indeed very bad design choices in my opinion.
Just remember: when blindly criticizing C++ operators, take a look around. Look at Haskell operators, for example. Be amused for a while. You'll see that the world is much more dark and horrible than what mommy has told you, yet C++ inherits all the debt.
This is a good point. I'm sure the committee has thought on that possibility. My guess is that they would not change the core language because of a library issue. After all, how would syntactically be this operator? What would be its meaning outside an I/O context?
Name:
Anonymous2012-01-11 12:49
>>371
I work with some ex Oracle weenie who thinks overloading operators in C++ is the greatest thing since control top pantyhose.
>>371 Just remember: when blindly criticizing C++ operators, take a look around. Look at Haskell operators, for example.
Haskell operators work, unlike C++'s. They don't need to be associated with a class, and they don't need friends to write cout << "Hax" << " my " << "anus";.
That's because they're simply variables, they're not supposed to be a -> b -> c functions, for some a, b, c. (<<) :: Handle -> [Char] -> IO ()
(<<) = hPutStrLn
cout = stdout
endl = "\n"
main = cout << ("Hax" ++ " my " ++ "anus" ++ endl)
Name:
Anonymous2012-01-11 13:27
>>370
"cout << "string" << 3.0f" doesn't concatenate anything, though. It's called the insertion operator for a reason. It writes, or "inserts", "string" to the stream, which returns the cout instance, so then you can write 3.0f to the stream.
Name:
Anonymous2012-01-11 13:34
>>377
C++ operators don't need to be associated with a class, and they don't need to be friends. They're normal functions, which respect the normal access control for members, as any function would.
I don't see why C++ operators "don't work", put apart what the average emotionally-based, highly subjective opinion against them claims.
Wondered what the fuck is a << operator in C++? Now wonder what the fuck a ++ or a >@> in Haskell is. That's the point.
>>379
I hope you get to work with someone who exchanges >> and << in classes you need to use or that the ostream operator is uses ().
Name:
Anonymous2012-01-11 14:00
>>380
Conventions, conventions, conventions. Any decent team will establish them, although you'd think that it would go without saying, considering that << is the insertion operator and should only be used for inserting, >> is the extraction operator and should only be used for extracting, and () is for function objects. There's no need to put a restriction on operators. It's not the same as weak typing, where the lack of restrictions can lead to errors even if you're trying to be sensible.
I hope you get to understand that someone who exchanges >> and << is mind-crippled and C++ is not designed to fix bugs buried deep inside the human brain.
>>379 C++ operators don't need to be associated with a class,
Can I write template<typename A, typename B> int operator+(A x, B y) { return 0; }?
This is a serious question, I don't know.
Now wonder what the fuck a ++ or a >@> in Haskell is. That's the point. That's the point.
I might as well wonder what the fuck is a vasnprintf or strtok. That's not the point.
Let me clarify one thing, I'm not one of those retards that think of cout << "something" as a bitshift to a file. I'm one of those retards that think that C++ operator overloading is an ugly hack.
And you still need friends to make cout << "something" and cout << 12 work.
Name:
Anonymous2012-01-11 14:15
>>383
Yes, operator functions can be free functions.
You don't need friends, since you don't need to access it.
>>382
Wouldn't it be wonderful to have a language that automagically discards that mind-cripple as the mind-cripple it actually is instead of compiling? I must be dreaming, there cannot be in any way such a language.
Name:
Anonymous2012-01-11 14:18
I meant you don't need to access its members, sorry.
Also, how is operator overloading an ugly hack?
Name:
Anonymous2012-01-11 14:19
>>383
vasnprintf doesn't exist as it wouldn't offer any extended functionality over vsnprintf.
strtok is just what it says it is, it extracts tokens from strings.
Name:
Anonymous2012-01-11 14:21
i always hated how C functions would write to a global static buffer.
Yes, you can write them as free function, and as templates as well.
Why do you think it is an ugly hack? Operators are simply member methods or free functions. If one can overload methods and functions, why can't them overload these operators?
Being able to overload them does not mean you must overload them in every situation. But there are many legitimate uses. Think, for example, if you had a class to represent a mathematical vector. You could, for example, overload operator * in order to make it work as a vectorial multiplication, and as a multiplication with a scalar. The correct one would be used depending on the context. In the end it's just syntactical sugar, really.
Again, you don't need friend for operating with cin, cout or any other class. You only need them if you need to access any private members. If you do, then you're either violating encapsulation (revealing an object's state) or actively developing an internal/library function (which inspects the object's state nevertheless).
#include <iostream>
class C {
public:
C(int x = 0): x(x) {}
int getX() const { return x; }
private:
int x;
};
std::ostream &operator <<(std::ostream &stream, const C &c) {
stream << c.getX();
// If c.x was accessed directly, 'friend' would be needed.
return stream;
}
int main(void) {
C c(10);
std::cout << c << std::endl;
}
friend declarations semantically bind the involved classes/functions into a "package" visibility (similar to Java). They're not intended to be used indiscriminately. They're intended to be used within the same library/package to give related (but otherwise different) classes another channel of communication, yet avoiding this channel to be exposed to the public.
The class should always expose in its public interface everything necessary to operate it, so that friend is not needed outside the package or library. This is not specific to C++, it's common OOP stuff.