« first day (830 days earlier)      last day (4136 days later) » 

11:00 PM
IIRC, there are still some operations you can perform in VB but not in C#
 
@DeadMG XML literals.
Which... yeah.
 
@Ell phew, we don't have to stone you with ANSI C books just yet :)
 
nah, it was something more intrinsic
like some type system difference
 
The type system is set by the CLI.
 
not entirely.
 
11:00 PM
VB had better COM interop until C#4.
 
Ok, now pls tell me your no1 reason why c++ is better than java.
 
Ell
Not always
RAII
 
@R.MartinhoFernandes KILLER FEATURE
 
But now it only has the XML literals.
 
@DavidFrank RAII, (closely followed by control: value types and pointers)
 
11:01 PM
@CatPlusPlus I know, right.
 
@DavidFrank Well, honestly, there are so many core features that Java would have to have... it's hard to pick one.
 
@DavidFrank It's not Java
 
but I think I'd have to go with lambdas.
 
Java has lambdas
 
user142019
This is my opinion.
 
user142019
11:01 PM
.---------.----------------------------.
| God     | Haskell, Erlang, Python    |
| Top     | F#, CoffeeScript, C#, Perl |
| Meh     | C, Objective-C, C++        |
| Shit    | PHP, VB.NET                |
| Kill me | Java                       |
'---------'----------------------------'
 
@DeadMG You will have to change your mind next year!
@CatPlusPlus Not yet released.
 
nah
 
Writing Java makes me want to claw my eyes out
 
@Zoidberg How come you put c# in top but java in kill me, they are almsot the same
 
user142019
@CatPlusPlus Double
 
11:02 PM
c# has some additional features
 
user142019
@DavidFrank they are not almsot the same.
 
also, java has some features c# lacks
 
C# has like 400% of expressibility over Java
 
@DavidFrank That completely change the entire paradigm of the code you write.
 
11:02 PM
@DavidFrank generics are terrible in java, better in C#. (I'm not really aware of other differences)
 
C# is now almost, but not quite, entirely unlike Java.
 
Java is as expressible as poop
 
If you say otherwise, you haven't written any C# worth mentioning.
 
This article compares Microsoft's C# programming language with Oracle's (formerly Sun's) Java programming language. While the focus of this article is mainly the programming languages and their features, such a comparison will necessarily also consider some platform features and some library features. For a more detailed comparison of the platforms, please see Comparison of the Java and .NET platforms. The comparison focuses on areas where the languages differ. In fact the two languages and their platforms are more alike than they are different: Both are (primarily) statically, strongl...
 
@R.MartinhoFernandes No true scotsman fallacy.
 
11:03 PM
Maybe you tried to write it as you would in Java.
 
just look at the table of contents on the wiki page
 
@MooingDuck what desides you have to wrap primitive types?
 
@DeadMG So what?
 
user142019
C# is well-designed.
 
It's little things that add up
 
11:04 PM
true enough. I'm not arguing that you're wrong :P
 
user142019
Java is badly designed with the assumption all programmers are fucking morons.
 
@DavidFrank not sure what you said there
 
@DavidFrank Principally, the fact that you have to wrap them shows that you have a fucked design.
 
How is c++ generics better than java generics?
 
user142019
11:05 PM
@DavidFrank lol
 
@Zoidberg ?
 
user142019
C++ has like, templates.
 
Ell
Something about type erasure.
 
C++ has templates.
 
@DavidFrank C# generics are better than Java generics because it doesn't let you put an int in a list<string>
 
11:06 PM
I mean templates
 
user142019
It lets you write Turing-complete pure-functional programs at compile-time.
 
let me start
 
Ell
At runtime Java uses object? Just adds compile time checks?
 
@DavidFrank templates are different in every way
 
in Java generics, you basically can't do anything useful whatsoever with the type argument.
 
11:06 PM
@Zoidberg That's not necessarily a good thing.
 
user142019
@Ell Java generics are just syntactic sugar. Generics are type-erased in Java.
 
C++ templates are strongly typed
you can introspect the type and perform all the same operations on it as a non-template type.
 
Templates are codegen, generics is just fluff to hide casts
2
 
Pretty much what the Cat said.
 
for example, specializations, and type metaprogramming
 
11:07 PM
C++ Templates > C# generics > Java generics.
 
You cant add a string to an int list
 
user142019
throws java.lang.Exception lol
 
Amazing
I'm totally sold
 
user142019
@DavidFrank oh Integer. Wonderful how the compiler can't understand it may need to box an int.
 
You can't add a string to an int list
 
11:09 PM
 
user142019
Also one thing where C# shines over Java.
 
@MooingDuck Java generics are only about type safety.
 
actually, you can.
 
@MooingDuck Ninjaed.
 
11:10 PM
@MooingDuck @DeadMG You are not using generics in that example
 
user142019
@MooingDuck lol same as puppy.
 
You'll get a warning for that.
Its for compatibility reasons.
 
@DavidFrank Absolutely I am. The original variable was created with a generic parameter.
 
user142019
Oh?
 
@DavidFrank right, that's WHY GENERICS ARE BAD
 
user142019
11:10 PM
I don't see no warning.
 
the hole is that Java generics decay when they really, really shouldn't.
 
@MooingDuck Meh, no, it isn't. (which doesn't make it any better, but, well)
 
Ell
Omg. That is awful
 
@Zoidberg it doesn't show warnings if it compiles
 
11:10 PM
1. Spend an hour arguing that Java is more ~secure~
2. "Hey, you totally don't use generics here"
 
@R.MartinhoFernandes it doesn't even throw an exception!
 
@MooingDuck Yeah, but that's Machiavelli. Generics are poor even in non-pathological cases.
 
@DeadMG related: the Java code at my work does this everywhere. >.<
 
List is like List<Object>, you can put anything in it
 
Yeah, that's the problem
 
user142019
11:12 PM
You rarely want that.
 
If you want type safety, you have to use List<TYPENAME>
 
The a) root class type
The b) fact you can cast type-safe List<T> to List or List<Object> and throw the type safety out of the window
 
Somehow I am reminded of Russell's Paradox
 
And you don't even get a warning
 
@DavidFrank The problem is that Java allows you to implicitly cast that safety away.
 
user142019
11:13 PM
@ObsessiveSSOℲ nice interrobang.
 
it's not actually safe at all.
you could pass it to some third party code and have absolutely no guarantees whatsoever.
 
This is a language where you've got this on one end and checked exceptions on the other
 
not just from someone intentionally screwing you, but a tiny accident.
 
It's fucking ridiculous
 
user142019
ly.
 
11:14 PM
@Zoidberg Thanks!
 
checked exceptions are a fine principle; the problem is that Java's implementation of them is so, so bad.
 
How can you pass an argument in C++ of type vector, which contains X or any of X's descendants?
 
void f(boost::ptr_vector<X> const&)
 
@DavidFrank std::vector<X*>& (depending on ownership)
 
user142019
std::vector<wheels::value_ptr<X>> const& or std::vector<std::unique_ptr<X>> const& depending on what you want.
 
user142019
11:16 PM
Or std::vector<std::shared_ptr<X>> const& in rare cases.
 
Stop abusing inheritance for one
And then it solves itself out
 
agree
inheritance is a bad tool that should very rarely be used.
 
Okay, 9 hours to write a 3D rasteriser
In JAVA
 
Ell
When do you think it should be?
 
[rmf@persephone ogonek]$ grep virtual include src -R | wc -l
8
[rmf@persephone ogonek]$
 
user142019
11:17 PM
@Ell When it's the right tool for the job. :L
 
When you really need it (TM)
 
Those 8 occurences are the virtuals for type erasure in any_text.
 
What's wrong with inheritance?
 
@Ell When templates are unusable.
 
@CatPlusPlus have fun :)
 
11:18 PM
@TonyTheLion I want to die
 
user142019
@CatPlusPlus just do it in C++.
 
Are you insane
 
user142019
Or Haskell.
 
user142019
Or whatever you like.
 
11:19 PM
Oh, right
 
@CatPlusPlus Wait a thousand years, and you can use a Futurama-style suicide booth.
 
You are
 
@MarcusStuhr Nothing in particular. People were mostly complaining about misusing it.
 
user142019
@DeadMG you can already make those.
 
11:19 PM
@DeadMG Yeah, if he waits a thousand years he won't need one :P
 
@Zoidberg a) It's uni assignment
 
Ell
@deadmg for runtime stuff then basically?
 
b) I don't want to wrestle with windowing
 
user142019
Your uni is terrible.
 
user142019
And so is mine.
 
11:20 PM
Every
 
@Ell Yep.
 
C++'s manual memory management is a pain in the neck.
 
C++'s what?
 
@DavidFrank That's why only noobs use it.
 
but also consider the difference between public and private inheritance.
 
11:20 PM
RAII
 
Ell
I don't understand why suicide isn't legal in a lot of places, the world is overgrown
 
for example, std::function is implemented by inheritance, but it's not public, so it's much better.
 
user142019
If I quit school before February, I won't have to pay the government any money back.
 
user142019
Might just well do that.
 
I'm pretty sure you won't be arrested if you kill yourself
 
user142019
11:20 PM
@Ell who the fuck cares whether it's legal.
 
[rmf@persephone ogonek]$ grep new include src -R | wc -l
7
[rmf@persephone ogonek]$
 
user142019
You're dead anyway; nobody can arrest you or whatever.
 
@R.MartinhoFernandes Whats your alternative?
 
@R.MartinhoFernandes Seven? I'm surprised.
 
Ell
Assisted suicide I guess
 
11:21 PM
Unless you go to hell, the home of the lawyers
 
why not only one for make_unique?
 
user142019
Hell is a fairy tail, like heaven.
 
Ell
but yeah good point. Derp derp
 
@DavidFrank Basic C++ features like RAII.
 
Fairies don't have tails
 
11:21 PM
Yes, that is basic C++.
 
@DavidFrank That "destructors" thing.
 
Templates are basic C++ too
 
@DeadMG Actually, I am too.
[rmf@persephone ogonek]$ grep new include src -R
include/ogonek/text.h++:                return handle_type { new holder(*this) };
include/ogonek/text.h++:        : handle { new holder<EncodingForm, Container>(text) } {}
include/ogonek/text.h++:        : handle { new holder<EncodingForm, Container>(std::move(text)) } {}
include/ogonek/text.h++:            handle = handle_type { new holder<EncodingForm, Container>(text) };
include/ogonek/text.h++:            handle = handle_type { new holder<EncodingForm, Container>(std::move(text)) };
 
user142019
Jun 10 '12 at 20:31, by StackedCrooked
My theory is that good C++ programming is founded on thinking in terms of ownership and object lifetime.
 
Ok, they are all in making unique_ptrs in any_text or placement new in small_vector.
 
11:22 PM
@R.MartinhoFernandes You still have to monitor your dynamic memory allocations.
 
No rule of zero was harmed.
@DavidFrank I don't.
 
Ell
Have you found out what tests it has failed yet?
 
user142019
No, you don't.
 
@R.MartinhoFernandes Could still use make_unique in those places, no?
 
user142019
You wrap resources in RAII objects.
 
user142019
11:23 PM
And they keep track of them.
 
user142019
And free them in their dtors.
 
@Zoidberg Can you tell me more about that?
 
[rmf@persephone ogonek]$ grep delete include src -R
include/ogonek/byte_order.h++:        static void map(DoNotConvert) = delete;
include/ogonek/byte_order.h++:        static void map(DoNotConvert) = delete;
[rmf@persephone ogonek]$
@DavidFrank See, I really don't have a single delete to clean up memory in my code base.
 
user142019
2048
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

 
I have no leaks.
 
Ell
11:24 PM
I quite like leeks
 
Only Claptraps leak
 
user142019
Which raises a question in my head.
 
@Zoidberg I'll have a look.
 
user142019
If I have a cyclic undirected graph.
 
user142019
Who owns the objects?
 
11:25 PM
you'll have to hand-roll a collector.
 
Ell
Shared?
 
user142019
@Ell cyclic
 
@Ell Only good for acyclic.
 
Ell
I will think my internet is going to dissapesr at midnight :(
 
@Zoidberg How do I know. Their owner.
 
11:25 PM
Make a graph object that owns all the nodes
 
user142019
Ah yeah.
 
user142019
Of course. Thanks.
 
@DeadMG Yeah. Maybe I should do that some time.
 
user142019
I've been wondering about this for quite some time.
 
Would you use C++ for a web app?
 
user142019
11:26 PM
No.
 
I would if there were serious web frameworks
 
user142019
Write one! :D
 
What would you use then?
 
I use ASP.NET
 
I don't make web apps.
 
user142019
11:27 PM
CoffeeScript or Python or Ruby or Perl.
 
Cause java has many nice web frameworks.
 
bwahhahaha
I would never, ever consider using Java.
 
Java web frameworks are awful
 
You can make a chat engine in ~30 lines.
 
user142019
11:29 PM
I'd use Erlang.
 
Amazing
 
user142019
A chat motor?
 
*engine
 
the number of LOC are quite irrelevant.
 
user142019
I can make a chat server in ~5 lines.
 
11:29 PM
30 lines and 10MB of XML
 
You don't have to write any xml
 
I challenge thee.
 
Ell
In ruby I can make a http server in 2 lines
 
user142019
@Ell One line in CoffeeScript.
 
$ python -m SimpleHTTPServer
@Ell No lines harmed in Python.
 
11:30 PM
This is not a http server, this is a working web page, with form, and output
 
In Chatlang I can make a chat engine in one character
c
^ entire program
 
user142019
require('http').createServer
 
user142019
HTTP server.
 
What about c++ ?
 
user142019
Not that it listens or does anything useful.
 
11:31 PM
@DavidFrank I am honestly curious about how a 30-lines of Java chat server would look like.
 
C++ is awful too
 
user142019
@DavidFrank given a decent framework not too much either.
 
@DavidFrank C++ is does not have suitable tools for web dev.
We told you before.
 
user142019
There exist no suitable tools for web dev at all.
 
user142019
And web dev is terrible.
 
11:32 PM
Terrible?
 
This entire Java/C++ thing is false dichotomy
 
user142019
Yeah, you know. Terrible. Bad. Horrible.
 
They're both bad choices
 
Most of the new projects are for web.
 
user142019
Who the fuck cares?
 
user142019
11:32 PM
It's still terrible.
 
user142019
"SO MANY PEOPLE USE PHP IT MUST BE SO GOOD."
 
Ok, as you wish.
 
I only write for web if I'm getting paid or have a gun put to my head
 
What's going on here?
 
user142019
Moronic Java/C++ comparison/fight/whatever.
 
11:33 PM
@DavidFrank FWIW, they are not for web because the programmers will it so, they are for web because money.
 
Thankfully gamedev is mostly web-free
 
@R.MartinhoFernandes the world isnt about writing nice programs which are completely useless
yes, its about the money
 
user142019
Gamedev is also terrible.
 
You're right, it's about bad programs that are completely useless
 
@DavidFrank How does that make a difference?
 
11:34 PM
And are for web
 
user142019
I like networking and shit.
 
@Zoidberg Whatever
 
@DavidFrank My point is that it does not make web development any less terrible or great.
 
user142019
But not webdev oh God.
 
@R.MartinhoFernandes You have to create programs which make money, even if you dont like it, even if its web
 
11:35 PM
Or you can have a job you actually like
Crazy thought eh
 
@CatPlusPlus eg?
 
@DavidFrank Yeah, doing something I don't like certainly makes it not terrible.
 
user142019
@DavidFrank well, not web dev, e.g.
 
Ell
Like documentation writer
 
user142019
lol
 
11:36 PM
@Ell Seriously?
 
Some management position and boss people around
No code writing ever again
 
user142019
Meh.
 
I think I have a new dream
 
user142019
I like writing code.
 
user142019
lol
 
11:37 PM
Game dev is quite fun
 
Ell
@David yeah, I enjoy writing documentation
 
user142019
Cat Plus Plus as boss.
 
@CatPlusPlus Do you get such jobs when you graduate? You must be a god
 
user142019
@MarcusStuhr no. In your opinion ~.
 
Yup
I'm the king of the lounge for a reason
 
11:37 PM
Of course it's my opinion -- what else would it be? lol
 
Ell
You aren't king of the lounge :L
 
user142019
The topic is a meme featuring me. I'm the king here.
 
You don't have the authority to defy the king
 
@CatPlusPlus if you were king of the lounge the topic would say so
 
@Feeds HAHAHA
 
room topic changed to Lounge<C++>: CatPlusPlus is the lounge peasant, he will do all your homework for you. [c++] [c++11] [c++-faq] [get-out] [no-questions]
 
user142019
 
user142019
@DeadMG LOL /cc @Feeds
 
11:39 PM
@Feeds lmao
 
I know, ironic timing, isn't it
 
Guys, it was nice talking to you, gotta go now.
See you next time!
 
I think I'm going to fail CG again
 
again ?
 
@DavidFrank Have fun.
 
user142019
11:41 PM
Carbage gollector?
 
user142019
Oh computer graphics.
 
lol, a @Feeds message with 5 stars.
 
user142019
@DavidFrank Please bring something more interesting than Java next time. Also goodbye friend.
 
Hmm, make_unique has the annoying bits of not being able to use private ctors.
 
Hm.
 
11:43 PM
> 2013-01-24 00:43:13 [INFO] [Minecraft] [@lucdanton: Saved the world]
4
 
Camera should probably not be part of the engine.
 
Ell
I want in on mine craft sever :(
 
@ThePhD Yup
 
@CatPlusPlus I refuse to let you fail again. What do you need to learn to make it happen?
 
11:46 PM
How to dilate time
 
Done.
What else?
 
[rmf@persephone ogonek2]$ grep new include src -R
include/ogonek/text.h++:                return handle_type { new holder(*this) }; // :( private ctor
include/ogonek/detail/small_vector.h++:                ::new(&storage) small_storage(std::forward<Args>(args)...);
include/ogonek/detail/small_vector.h++:                ::new(&storage) large_storage(std::forward<Args>(args)...);
[rmf@persephone ogonek2]$
@DeadMG better :)
 
agreed
 
Ooh, are you two
working on ogonek together? :o
 
you know what would be even better?
 
11:47 PM
@ThePhD No.
 
placement_new<T>(args);
 
Ah.
 
@DeadMG What's the benefit?
 
Ell
He is working on a Unicode standard suggestion thing
 
@R.MartinhoFernandes When you grep for new, you only get 1 hit for placement new, no matter how many you use.
 
11:48 PM
lol
 
@R.MartinhoFernandes I'm using in_place_factory everywhere now.
 
@DeadMG FWIW, you would actually get more: new is not anchored with word boundaries :P
 
@R.MartinhoFernandes then name it something else, like, I dunno, inplace_constructor :P
 
why does google link to the old boost docs? :(
@DeadMG or boost::in_place_factory
 
@MooingDuck Maybe they haven't changed since then.
 
user142019
11:50 PM
I don't understand applicatives.
 
user142019
I understand pure but not <*>.
 
@MooingDuck That is for replacing emplace stuffs. I don't see the point here.
 
user142019
I know what it does but not when it's useful.
 
There is no non-aesthetic benefit over placement new when I have variadics and perfect forwarding.
 
emplace sounds better than in_place_factory
 
11:51 PM
@R.MartinhoFernandes for some reason I thought it helped, I can't recall why now
 
Sorry, had a question. I'm trying to adapt a really complex existing piece of software(whose C++ source I have), and once it has initialized, and done a ton of stuff I really can't remake well, is it possible for me to hook in from another executable and call some functions in-place as part of the code? If this sounds really stupid, feel free to ignore.
 
Plus, even if I did not have variadics and perfect forwarding, I could write the three or four overloads I need, since that is used only internally; I never forward stuff from the outside directly to the placement news.
 
@ObsessiveSSOℲ if you have the existing code, you can recompile it as a dll/static library, and then pull in existing functions.
 
In line with what I said: Would I be able to rename main( to something else, and call it after linking?
 
11:54 PM
@ObsessiveSSOℲ yes
 
@MooingDuck Oh, just saw your reply.
 
user142019
@ObsessiveSSOℲ That is possible.
 
user142019
Ohh I understand applicatives. Awesome.
 
OK. The thing is the program has some weird data structures set up, so I need to somehow call the functions in the correct "scope", if that's the term I shoudl be using,
 
@ObsessiveSSOℲ can't help you there, that's application-specific
 
11:56 PM
@MooingDuck Ah, OK. Thanks! Is there a way to jump into code at a certain point, such as in the program's main loop?
 
@CatPlusPlus Should we go with a whitelist or what? In any case I'm making backups.
 
Yeah, whitelist would be good
 
@ObsessiveSSOℲ no, you have to call functions
 
OK.
In that case, I'm probably going to use a little bit of shared memory and a polling behavior within the main loop. If the sharedmem/whatever communication method contains a request, it'll run a command.
 

« first day (830 days earlier)      last day (4136 days later) »