« first day (982 days earlier)      last day (3959 days later) » 

8:00 AM
include <stdio.h>

int main() {
int anArray[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
printf("{");
for(int i=0; i<8; i++) {
printf("%d, ", anArray[i]);

} printf("%d}\n", anArray[8]);
}
opps
 
I view recommending type-unsafe libc to beginners as harmful.
 
Generally C isn't acceptable in time of modern C++ at all.
 
sorry that was a mistake
i meant to post something else
 
The tooltip on downvote hints: 'this answer is not useful'. It's not about breaking rules.
 
@raxman you can edit posts.
 
@raxman you can delete, or edit
 
It's the DOOM3 source code
 
C is a bad language.
 
written in C++
 
8:00 AM
what do they use, printf
 
Kotaku is horrible.
I wish that site would die.
 
"id doesn't use stringstreams. A stringstream contains probably the most extreme bastardization of operator overloads I've ever seen: <<."
 
@raxman and what does it prove exactly?
 
:cripes:
 
@raxman that's an opinion.
 
8:01 AM
it simply proves that other programmers mix C fuctions in C++ code when they prefer the C function
 
Game developers are generally bad at C++ too.
 
The whole article is opinionated.
 
@Rapptz Anything I should know about?
 
yes it is opinionated
 
the article says that id software uses C in C++ and that means that id software uses C in C++
 
8:01 AM
Jun 13 at 13:43, by thecoshman
New here? Why not spare some heartache and read the newbie hints.
 
An interesting meaning of 'proves'.
 
It proves that there are other bad C++ programmers.
printf is not type-safe. It's not acceptable, ever.
 
@raxman mixing styles is unacceptable
 
And "bastardisation of operator overloads" jesus who talks like that.
It's not about mixing styles.
 
"Side note: John Carmack has stated that static analysis tools revealed that their common bug was incorrect parameter matching in printf(). I wonder if they've changed to stringstreams in Rage because of this. GCC and clang both find printf() parameter matching errors with -Wall, so you don't need expensive static analysis tools to find these errors."
 
8:02 AM
it's even worse than using just C constructs, which is bad enough
 
but he does say that as well
 
It's about constructs that are inherently unsafe and unhelpful.
I.e. entire fucking C language.
And libc, the worst library ever designed.
 
@raxman why are you willing to use constructs that require additional tools to verify them?
 
i have a meeting to go to
back in 15 mint
minutes
 
I mean @raxman maybe I am stupid but I can't comprehend the "let's dig through warnings in our code and that's so much better that compilation error"
 
8:04 AM
And again, why do I care about other people being bad at this language I don't even use, aaaaargh.
Fucking SO.
Ruining my inner calm.
 
Xeo
Did you ever have one?
 
Fucking people who use "people use X therefore X is good" argument
 
Then I became a programmer on the Internet.
 
@CatPlusPlus because you may end up having to work with them in some way
 
8:05 AM
@BartekBanachewicz thanks for the tip
 
Xeo
@BartekBanachewicz Linus-rant... :D
 
@thecoshman Thankfully, unlikely.
 
that's like second time someone mentions Linus now and I still don't know what's going on
 
You don't know Linus' rant about why C++ is bad?
 
8:06 AM
@CatPlusPlus but indriectly
 
Which is, like, completely wrong?
 
I could've read it once, but I was struck by the amount of BS
 
JBL
@BartekBanachewicz Probably the post about Git...
 
But still unironically used to prove C++ is bad by people who know C++ just as well as Linus?
You don't know that rant?
 
Apparently my brain preferred to shut it out
 
8:07 AM
Oh the comment got deleted.
 
am I supposed to be able to cite it?
 
Yes. Memorise it.
 
2 hours ago, by Rapptz
@user2511129, please see my answer. Don't let the pedants fool you. Learn C first. It's a subset of C++ (that's why it has a ++). Read this post by Linus Tovalds, the creator of Linux about the evils of C++ harmful.cat-v.org/software/c++/linusraxman yesterday
 
@Rapptz oh my god he linked to it
oh my effing
oh no.
 
8:09 AM
From the site that also has following gems:
Weakness of STL over plain C types
Performance of STL vector vs plain C arrays
 
> If half of all the effort spent towards this course was directed at improving clang’s documentation, or writing desperately-needed modern C++ development tools, we might be able to make a difference in the industry, instead of writing a bunch of crappy compilers for the sake of passing a few unit tests and getting a pat on the back that ultimately means nothing.
It's like fresh air in the stink of idiocy.
 
wait... his leading argument against C++ is that there are bad programmers who use C++... by that logic as paedophiles and rapists breath air, we should get rid of the air
 
@thecoshman smooth.
 
oh gawd
 
lol TIL
 
8:11 AM
By that logic C is the same, but that's conveniently unmentioned.
Fuck programming.
Let's talk about something fun.
 
@Rapptz Well, he's right at least.
 
@CatPlusPlus it gave me cancer. Twice.
 
8:14 AM
@Rapptz Poe's law, I guess?
 
Yeah was just thinking that
 
I wouldn't be bit surprised if whoever is behind that site actually believed it.
I don't want to think about it, I'm getting stupider by proxy.
 
@CatPlusPlus haha
 
i'm back
i can edit my answer to try and make the protesters more happy
you don't know why Linus was mentioned because someone deleted my comment. several of my comments (and others were) weere deleted
were
 
> I got some of the ideas from X10, you know, X windows
o_0 X10?
@raxman for fuck sake man learn to god damn edit
 
8:20 AM
What do you think 11 stands for in X11?
 
Xeo
@raxman There's no reason to mention Linus, like, evar.
 
(It's major version)
 
i mentioned it because people repeatedly insist that I have to use C only or C++ only and can't mix the two together.
 
There's no reason to use libc in C++.
 
1
A: Initialising 2d dynamic Array

raxmanSave yourself the trouble and don't use 2D arrays in C. It's more convenient to use 1D arrays. #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { const int nstrings = 2; const int width = 20; //width of maximum string. char* array = (char*)malloc(sizeof(char)*n...

see my answer there
I defended C++
 
8:22 AM
It's awful.
 
I use MSVC...unless I typecast the malloc it won't compile
 
:cripes:
 
lol
 
I prefer having code that I write once and compile everywhere
 
@CatPlusPlus oh right, old article :P
 
8:23 AM
or at least try to
 
@raxman Latter part is not true.
 
which part?
 
Again, as the downvote arrow tooltip hints: the answer is not helpful.
You're free to use C and/or C++ any way you want.
 
std::vector<std::string> array;
array.push_back("Test[0]");
array.push_back("Test[1]");
 
The downvotes are not trying to prevent you from that.
 
8:24 AM
Your code is not exception-safe, not type-safe, and relies on magic fixed buffer sizes.
It's bad.
 
yeah, but it works
 
That's why it's pointless to bring examples that 'prove' you can mix C and C++, whatever it would mean. It doesn't make the answer more helpful.
 
@raxman aha
 
I really need an emoticon for "oh fuck it, throwing arms in the air".
 
@raxman well you can write good code.
 
8:25 AM
C programmers are the worst.
 
@raxman code that works can still be bad. what kind of argument is "it works"?!
 
look, this has to be the most inane question/answer ever on SO stackoverflow.com/questions/605845/…
 
@raxman it applies to C, not C++
We were talking about C++.
 
I typecast malloc and C and C++ because I won't my code to compile in GCC and MSVC
and = in
I use MSVC by day and GCC by night
 
you shouldn't use malloc in C++ if not needed
 
8:27 AM
i zip mycode, send it to dropbox, and in the evening I won't my MSVC code to work out of the box in GCC
 
if you use malloc you compromise type safety and cast won't help that really.
 
_mm_malloc is needed
 
@raxman that's one hell of Version Control System :cripes:
 
If you think both people and compilers are out to get you, you have issues.
 
Betting pool! Really unfunny trolling, or really that bad? Send a text message "FUCK C PROGRAMMERS" to 999998 or 999999!
 
8:28 AM
i use GIT for the big projects
 
JBL
@raxman For the trillionth time : edit...
 
i will edit
 
@CatPlusPlus I am speechless.
 
today
but I won't delete what I wrote
 
Get out!
 
JBL
8:29 AM
I'm crying blood.
 
nothing will make sense if I change everything
 
I'm going to meet friends, fuck programming.
 
@raxman you shouldn't answer questions about C++ if you don't know C++
simple as that.
 
(Flag the trolls out or something)
 
@CatPlusPlus at the meeting or at the exam?
 
8:30 AM
At the meeting.
 
i know C++ better than many
people
 
learn to edit
 
You don't, no.
 
:frogout:
 
@BartekBanachewicz at what point can you say you "know" C++?
 
8:31 AM
Anyway should probably stop participating in this lame conversation.
 
@StackedCrooked at the point your code won't make other users of C++ cry
 
because I used printf does not prove that I don't know C++
 
@raxman can you create C++ solution by yourself? I don't think so.
 
@raxman True, it proves you're terrible at programming and should leave right now.
bye
@ScottW Hey!
 
@ScottW oh
 
8:32 AM
@ScottW Yay! :)
 
I told you already, I have been doing C++ programming for over 10 years.
 
@raxman and I am telling you again nothing of this was C++.
 
JBL
@raxman That doesn't prove anything...
 
@raxman I told you already, I couldn't give two shits.
 
I'm doing C# mostly at work no ddays
nowdays
 
8:33 AM
can you show me 10 lines of C++ code you wrote?
C++, not C, not C with classes, not C subset of C++
 
thanks for the spelling correction
you mean on SO?
 
wherever, really.
 
I wouldn't dare to show 10 lines of C++ that I wrote here.
 
I don't care about C++, its terrible.
 
@StackedCrooked You've shown more!
 
JBL
8:35 AM
@StackedCrooked That's like bringing yourself to the pillory.
 
I'm looking for some code
 
My best code on SO would be a b-tree recursion function I wrote using my old account
But it gained me no rep because I was locked in a troll duel with a few others
 
I don't write code in my answers anymore.
 
@Telkitty猫咪咪 lol
@ScottW oh baby, maybe I should write such code sometime. :P
 
@TonyTheLion oh it's you Tony wuss the puss
 
8:36 AM
@raxman I find it funny that after 10 years of coding in C++ you still can't find 10 lines of your C++ code
 
@Telkitty猫咪咪 lol
 
you funny
 
so my age was incremented yesterday, I feel old now.
 
happy b'day <3
 
:)
<3 <3
 
8:38 AM
age = floor(year(m_days));
 
@ScottW yeah
 
@TonyTheLion oooh, happy b-day
 
@BartekBanachewicz thank you :)
 
room topic changed to Lounge<C++>: Happy Belated Birthday to Tony [c++] [c++11] [c++-faq] [no-helpdesk]
6
 
@ScottW oh hahahaha
 
8:39 AM
^^
 
have a star :)
 
@ScottW It's 4:40 AM!
Why are you up?!
 
@Rapptz because he's Scott
 
You actually quit?
 
and my moral support
 
8:40 AM
@raxman found anything yet?
 
@BartekBanachewicz course not, he's a troll
 
@TonyTheLion but he has 10 years of experience!
 
yes, I have not done anything fancy with C++ in a while so I'm looking
I have a raytracer I wrote in OpenCL
the host code is C++
and an Image processor
 
@raxman is it real C++ or C again?
 
It's C++
 
8:41 AM
silver star for trying
 
especially the image processor
For example I used the copy and swap idiom
i'm no C++ expert
i never claimed that
 
@raxman you managed resources by hand instead of using vector, huh?
 
sometimes
depends on what it is
 
also isn't copy-and-swap like totally useless with move semantics?
 
JBL
Late, but Happy B-Day @TonyTheLion !
 
8:44 AM
maybe
I'm not a programmer. I'm a physicist
 
JBL
@ScottW Wat ? Uh no ...
 
@raxman that's apparent
 
that has to do programming all day
 
@raxman However, you wanted to argue with us (programmers apparently) about programming, so we treat you as one.
 
JBL
I thought you already married Tony.
 
8:46 AM
you also used C in C++ answer which is in general very dangerous.
 
wanted to argue, I won't to be able to use a C function in C++ sometimes if I find it more convenient
they guy just wanted to print an array
he was having trouble doing something very basic
 
JBL
Finding C more convenient than C++ feels outright wrong...
 
you don't have to introduce him to generic programming so quickly when he can't even print an array
 
@raxman and you gave him the bad way to do that
@raxman introducing him to unsafe C functions is even worse
It's like giving matches to a kid
 
i don't know, I think my answer was very clean and simple and did the job.
 
8:48 AM
@ScottW oh thanks babe. <3
 
@raxman nothing using C or C functions is "clean" in C++ sense
 
he comes from python, he needs to learn that all that new power needs new responsibility
 
@raxman bullshit.
 
JBL
@TonyTheLion Am I expected to pop out of some giant cake ?
 
the code is easy to read
 
8:48 AM
Bullying somebody again? Oh, you are as predictable as I wish my programs were...
 
@JBL Yea basically :P
 
@raxman for you, maybe, but not for someone who comes from python
 
hey, i'm the one that's being bullied
 
@dsign lol
 
@raxman what code are you talking about again?
 
8:49 AM
(from a computer scientist working as a physicist....)
 
i never expected to get the best answer
 
@raxman and for a good reason.
 
but I don't think I deserve to be downvoted
 
you do. Especially because you pointed the beginner in the wrong way
that's our way of keeping him from using your code
because that way he might actually become a reasonable programmer
 
maybe he used printf in python
python is C friendly
 
8:50 AM
python has its own idioms that have nothing to do with C
@raxman for backwards compatibility mostly, again, not a beginners topic or problem
 
OMG, this conversation is turning worse at every turn
 
@raxman it has never occurred to you maybe you were downvoted so severely because of your comments not because of the answer itself?
 
I think its time to invoke the powers of PLONK
 
@raxman also please tell me what will you do when he comes back with an array of structs to print?
 
JBL
@TonyTheLion Put a PLONK on it ?
 
8:51 AM
Or simply an array of arrays?
 
don't use array of arrays
 
@raxman why shouldn't I use them?
 
you can use what you want
that's what i would tell him
 
JBL
Zzzzz.
 
ahem, so you would tell a beginner to use whatever he wants
but you would prevent me from using arrays of arrays
 
8:53 AM
I think Tony and Scott would make a good couple - similar age and interest (complain about your programming job every evening).
 
no I would show him how to use a 1D array to do what you would do with a 2D array
I have another important meeting to goto
 
@raxman what about an array of structs then?
 
i'll try and edit my answer
 
@Rapptz for (auto const& i : make_range(std::begin(arr), std::end(arr)))
 
8:54 AM
@ScottW so which one would be the wife, or the puss :p
 
@BartekBanachewicz Uh.. the original question had delimeters of commas and brackets around it.
I'm not entirely sure how a simple for range-loop would help.
And it's for(auto&& i : arr), I don't know what make_range is for but it's superfluous there.
Man it's hot and boring :(
 
@Rapptz uh, you're right.
@Rapptz cout << i << ',' ?
 
extra delimeter
 
ohnoes. I mean every language accepts those
 
@ScottW coming to visit me? ;)
 
8:58 AM
I wouldn't expect to print [1, 2, 3, 4, ]
 
you can remove last characters by hand
 
How?
 
on std::string or stringstream it should be just a decrement by two
 
Well then now you're back to square one :v
 

« first day (982 days earlier)      last day (3959 days later) »