« first day (528 days earlier)      last day (4436 days later) » 

2:00 AM
can u recommend me a book from which i can learn such things?
its more complex than int x;
and stuff
 
980
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...

There you go.
 
I picked them up from SO, but there's a great question somewhere
 
thnk you
 
Avoid any book by Herb Schildt
 
Which books did u guys learn c++ from?
 
2:02 AM
I willed the knowledge into my head through my sheer balls
 
i cant read 20+ books :)
 
I learned modern C++ techniques from Effective C++
But that book assumes you already have a basic knowledge of C++ syntax
 
@DavidFrank They're sorted by knowledge level, so you don't have to read them all, just one that's appropriate.
and, honestly, you could just pick one for your current level and go from there
 
For you Accelerated C++ is probably a good starting place
 
Right now I have an intermediate OOP knowladge, a standard C knowledge + some C#
and advanced php
 
2:03 AM
Bjarne's book is also good
 
+ basic c++
 
unfortunately, advanced PHP is really not saying much
 
And does it teach modern techniques as well?
 
Both the Accelerated C++ book and Bjarne's book teach modern techniques
 
Ok, ill have a look
Thank you
 
2:05 AM
they won't cover C++11, though
 
Yeah, neither will talk about lambdas
 
Thats no problem for me
 
most books haven't been updated to a new version that covers the newer features
 
these books were released before C++11 was finalized
 
At uni we are required to write standard c++ code, tho
 
2:05 AM
C++11 is Standard
 
lambdas are standard C++
 
it's literally the Standard.
 
just not standard C++03
 
C++11 is the Standard for C++ code. That's it's definition.
 
So if I write c++11 code on exam, they have to accept it?
 
2:06 AM
if they say "Standard C++", then yes.
 
@DavidFrank: Ideally, yes.
 
it says c++
 
then yes
 
But if your professor doesn't know about lambdas then probably not
 
Write a c++ program which ...
 
2:06 AM
best to ask first
 
+My "professor" did not even know why functions are not virtual as default in c++
 
Ask first. The graders may not be as good at C++ as DeadMG is.
 
but if he doesn't specify any particular variant of C++, then C++11 is the Standard, and you can use what you like from it
oh
well, that's really, really bad
no wonder you're struggling to pick up the language
 
Oh my goodness
 
you're being taught by a monkey
 
2:07 AM
well, ive been learning it for like 3 weeks
so its not that bad hopefully
 
3 weeks is a lot of time in university terms
 
well, if your prof doesn't know why they're non-virtual by default, then he obviously doesn't have a clue what he's doing
 
so I wouldn't be too disheartened by not getting C++ quickly or easily under such circumstances
not everyone can be as ridiculously intelligent as me
 
@DeadMG: Speak for yourself. :-)
 
2:10 AM
kekeke
 
@DeadMG How did get ur knowledge?
 
I divined it from the ether with my raw skill and massive reproductive organs
 
@DeadMG you said you were attending a crap university
 
@DavidFrank I assure you, they did not teach C++.
 
My university taught proper C++ but I tested out of it
 
2:13 AM
What do you think, which is the prog lang which u can get the furthest with?
 
Perfect score on a final I didn't study for
 
depends
 
My college actually taught modern, proper, clean C++. My university doesn't, but I'm competent anyway, so I don't care.
 
C++ is the language for me, because those other wussy languages like Java just piss me off with their pathetic limitations
and some others like Haskell are just strange and not really my style :P
 
@DavidFrank A bunch of them. Remember: one size does not fits all. You have to be careful.
 
2:14 AM
yeah
 
@EtiennedeMartel: I was pleased to know that the CS classes in my university taught modern C++ and not C with classes
 
C++, for instance, is @DeadMG's golden hammer.
 
what do you mean by that?
 
It's your magical cureall.
 
@Insilico I am afraid of were learning c with classes
 
2:15 AM
At least until Wide hits production.
 
The bad thing is that we dont use classes properly
 
What's this Wide thing I keep hearing about?
 
All examples were about A and B classes, and the examples were about which constuctor gets called
 
@EtiennedeMartel Not really. I'd love to use WPF for my in-game UI. If only it was cross-platform and didn't suck.
 
WPF is way to damn complicated for what I would use it for.
 
2:16 AM
@Insilico It's a language I am building.
 
@Insilico Too bad it was made for a UI.
 
@Insilico The list of things which are suitable re-usable components for an in-game UI is very, very limited.
for some reason, as soon as you introduce "game", people start orgasming global variables and Singletons all over the place
it's horrendous
 
@DeadMG: Can I see a Hello World example of Wide? :-)
 
@Insilico void main() { Standard.IO.Output("Hello World"); }
 
@DeadMG Ogre3D says hello.
@DeadMG Is there some sort of using statement or do you have to manually type all those namespaces?
 
2:18 AM
I haven't totally defined many things yet, but I don't think that includes anything under construction
@EtiennedeMartel There is a using and I suspect that eventually, when I have a using that isn't horrifically broken like C++'s, I'll get more into the habit of using it.
 
Are you familiar with EBNF?
 
@Insilico Vaguely. Why?
 
In computer science, Extended Backus–Naur Form (EBNF) is a family of metasyntax notations used for expressing context-free grammars: that is, a formal way to describe computer programming languages and other formal languages. They are extensions of the basic Backus–Naur Form (BNF) metasyntax notation. The earliest EBNF was originally developed by Niklaus Wirth. However, many variants of EBNF are in use. The International Organization for Standardization has adopted an EBNF standard ([http://standards.iso.org/ittf/PubliclyAvailableStandards/s026153_ISO_IEC_14977_1996(E).zip ISO/IEC 14977])...
 
One more question: how do you do the following in c++: I want to have a map or smthing like that which is indexed by string and contains classes(not objects, but classes). All these classes will inherit a base class. And I'd like to make a function which has a string argument and returns a base type. But the actual type would depend on the passed string. Can I achieve this in c++?
 
Just wondering if you were using EBNF to specify the Wide language's syntax
 
2:20 AM
@DavidFrank Sure.
 
@DavidFrank: But for what?
 
@Insilico No, I'm using Bison, which is an extended YACC, which is, I believe, a BNF variant.
 
I can't see how what you're doing is useful
 
I want to convert instructions to instuction objects
 
but the means of syntax specification isn't really a big deal
it's more the syntax itself
 
2:21 AM
its some kind of a modeling
 
I have many semantics and too few syntactic elements
very ambiguous
 
need moar keywords
also, I hate LR parser generated code
many reasons to hate the Bison output
 
class Base { /* ... */};
class X : Base { };
class Y : Base { };
class Z: Base { };
 
what I'd really need is an algorithm in the middle between LR and LL
 
2:22 AM
i have these classes
 
@DavidFrank You can't do that out of the box (i.e. classes or types in general don't work as values in C++), so the usual moral equivalents are some form of polymorphism, e.g. through inheritance and/or type-erasure.
 
So what you want is a factory?
 
i want to achieve this:
 
But again, I don't quite understand what you're trying to achieve though
 
Base myfunction(char* str) {
...
}
 
2:23 AM
char* str? owwchh
 
std::unique_ptr<Base> create(const std::string &name);
 
i know
but we cant use std yet
its an assignment
 
kick your lecturer in the balls
repeatedly
 
and for now its prohibited
 
Tape a grenade to your foot before you kick him in the balls.
 
2:23 AM
well, the assignment is not about this :)
 
lol
 
its only one thing i need
 
@EtiennedeMartel I like it :P
usually, you use something called a factory to perform such conversions
 
i have to model a von neuman computer in c++
 
@EtiennedeMartel: Unfortunately my feet is too valuable for that. :-)
 
2:24 AM
but the only reasonable means of specifying them for more than a small number is through Standard containers
 
If you're a man, your foot will survive.
 
ive heard about that
i could do this:
 
@EtiennedeMartel: Doesn't work too well when I need to operate a car or a bicycle though
 
lets assumer str is string, not char*
 
wait
are you reading in binary opcodes?
or textual instructions
 
2:25 AM
if(str == "x") { return X; }
textual
 
ok
 
like MOV, ADD, etc.
 
Works if you use std::string. If str is a const char *, then you'll need something like strcmp.
 
then a mass of if/else is pretty much your only choice
 
then
 
2:26 AM
there are more advanced ways to do it with Standard containers
but without them, you don't have much choice
 
what about each class has a static create method?
and i put those method pointers in an array
 
@DavidFrank There's no way to index into that array except manually.
 
the base would have that static create too
ok, then ill have to use mass if..else?
 
That sounds like a very convoluted solution to interpret a bunch of instructions
 
yes
 
2:28 AM
its just modeling
 
A big if...else statement is the easiest way to deal with it
without the use of standard facilities
 
but thats ugly
and hard to extend
ok not that hard
 
I recall seeing an old trick that initializes a static member variable with the result of a static member function that registers the class in some sort of map and then returns a dummy value that is used to initialize said variable.
 
but looks ugly
 
It was hacky as hell.
 
2:29 AM
It's your professor's fault for not allowing the use of standard facilities
 
well, you're being artificially constrained.. a simple unordered_map<std::string, std::function<std::unique_ptr<Base>()>> would be O(1) and super-fine
and super-easy to extend
but, if no std::unordered_map, no std::string, no std::function, no std::unique_ptr..
then you basically have no tools
so unless you want to write your own replacements from scratch, you don't have any choice but to use the most brute force approach
 
what is unique_ptr used for?
 
It's like std::auto_ptr, but not broken.
 
how are there different form standard pointer?
 
2:31 AM
thx
 
smart pointers are an essential C++ tool
 
You have this thing called search engines
Take advantage of them
 
i use them often
:)
 
@DavidFrank The type conveys information about ownership, while T* doesn't.
 
Thank you guys for teaching me(ur better than my prof), now i have to leave
uni starting in 5:30 hrs
 
2:32 AM
Good luck with your assignments!
 
thx
Will you be here at other times too?
 
I'm rarely not here
 
Its nice to talk to you
good bye for now
 
have fun and good luck
 
Xeo
2:54 AM
Aaaaand.. there goes my last TVTropes tab.
Another fun ride in another part of TVTropes.
 
@Xeo: So you've been in TVTropes this entire time?
 
Xeo
Mell, mostly.
A bit on the Zelda wiki too
 
So was it a breadth-first search or an in-order search? :-P
 
Xeo
Mar 12 at 20:44, by R. Martinho Fernandes
@Xeo Btw, what's your preferred method of trope binging? BFS or DFS?
Mar 12 at 20:44, by Xeo
Usually a mixture of both.
Mar 12 at 20:45, by Xeo
Depending on the immediate interest in the trope name
 
Clearly I wasn't here on March 12th. :-)
 
Xeo
2:58 AM
That's why I quoted. :)
Anyways, time for some sleep. G'night
 
Nite
 
Hey guys. Is the C++11 standard document stand-alone, or is it an "addendum" to C++03?
 
that's a TC
and it's stand-alone
 
technical corrigenda
 
3:08 AM
It's a standalone. For those who may not have noticed but were waiting for it, it's now available from the ANSI webstore for only $30, instead of the $300+ originally being charged. webstore.ansi.org/…
 
Terrible Constipation.
 
@JerryCoffin : Thanks. I saw your SO answer, and came here to find out if I need the C++03 standard to make sense of the C++11 standard.
$30 is a good deal.
 
Nope -- just lots of time and devotion (1300+ pages and densely written).
@EmileCormier Yeah -- much more bearable than the $350 or so.
 
1300 pages?? Sheeesh. It's in electronic format, right?
I thought the USB spec was bad.
 
@EmileCormier yes -- PDF. You can get a hard-copy, but it's still $300+, not $30.
 
3:12 AM
@EmileCormier Isn't it free on Github?
 
@EtiennedeMartel : I think its the draft versions that are free - i'm not sure
 
The draft versions are good enough if you're looking through it casually
The final drafts is what you use if you're writing a compiler
 
O_O ....
 
Or I can just ask SO whenever I hit an obscure part of the language. Probably faster, lol.
 
@EmileCormier: Not really, since I do a PDF search when I need to answer those questions
So you might as well do it yourself. :-)
 
3:18 AM
What I really want is a reference manual of C++11 features, written for the programmer.
 
@EmileCormier:
C++11, also formerly known as C++0x, is the name of the most recent iteration of the C++ programming language, approved by ISO as of 12 August 2011, replacing C++03. The name is derived from the tradition of naming language versions by the year of the specification's publication. C++11 includes several additions to the core language and extends the C++ standard library, incorporating most of the C++ Technical Report 1 (TR1) libraries — with the exception of the library of mathematical special functions. C++11 was published as ISO/IEC 14882:2011 in September 2011 and is available for a fee....
 
The wikipedia article is not bad, but I wouldn't mind something more akin to "The C++ Programming Language".
 
Is Bjarne Stroustrup working on a 4th edition right now?
 
@Insilico The content is identical, but obviously the price isn't even close. Basically, each standards body publishes its own version at its own price (and obviously, they don't follow a common standard for the price).
 
Bjarne's FAQ on C++11 is not bad either: www2.research.att.com/~bs/C++0xFAQ.html
 
3:21 AM
@JerryCoffin: So a person who doesn't look hard enough is screwed over ~$300
 
I'm pretty sure most of the usual authors (Bjarne, Dave Abrahams, Herb Sutter, etc.) are all working on new books (or updates to old ones). Come to think of it, maybe I should work on one...
@Insilico That, unfortunately, is all too true (of course, assuming they don't accidentally pick the really expensive one, and pay $700 extra).
 
What's the point of selling the British one on an American National Standards Institute store?
 
British spelling?
 
@Insilico I'm not sure, but keep mind that they all work in cooperation under the ISO...
 
@EmileCormier: For $700 more?
So is there anything that prevents somebody not in America from buying stuff from the ANSI webstore?
 
3:25 AM
@Insilico: British-spelled words are slightly longer. :P
 
@Insilico They're all ISO's bitch.
 
@Insilico None of which I'm aware, as long as you have a credit card they accept.
 
When I worked for a medical device company, I remember there being a standards reseller that was actually cheaper than ISO.
 
How does that work?
 
It had "street" in the name... trying to remember. It might have been techstreet.com
global.ihs.com was another one.
I don't know what the arrangement was between them and ISO.
 
3:32 AM
Is it possible to get a hardcopy of 14882 from the ANSI webstore?
Or is it cheaper to go to Kinkos to print them out?
(Kinkos --> Fedex Office now apparently)
 
Please, don't. Save the trees.
 
@EtiennedeMartel: Oh, I don't intend to print them out. :-)
Just wondering if I could get a hardcopy if I really wanted
 
@Insilico Yes, but it costs (a lot) more. I suspect Kinkos would still be cheaper though -- at 10 cents a page, it would only cost $133.80 US.
 
At $300, maybe it's handwritten by monks.
 
With such impeccable handwriting, that's a steal. :-P
 
3:39 AM
What's the name for those fancy big letters they draw at the beginning of each chapter?
 
N3337 (draft) is mainly the current C++11 standard with tupos corrected.
N3290, no longer legally available for free, is the current standard.
 
@EmileCormier Actually, looking again, I may have been wrong -- I'm almost certain I've seen it available in hard copy, but can't find it now. Maybe the monk had a heart attack when he saw how long it was...
 
One can also build one's own standard from freely available source. Reportedly requires some patience.
 
In a written or published work, an initial is a letter at the beginning of a work, a chapter, or a paragraph that is larger than the rest of the text. The word is derived from the Latin initialis, which means standing at the beginning. An initial often is several lines in height and in older books or manuscripts, sometimes ornately decorated. In illuminated manuscripts, initials with images inside them, such as those illustrated here, are known as historiated initials. They were an invention of the Insular art of the British Isles in the eighth century. Initials containing, typically,...
It's called Initials apparently
Also called Drop Caps
 
@Insilico : Thanks, I also found Illuminated capital letter: en.wikipedia.org/wiki/Illuminated_manuscript
 
@CheersandhthAlf: I wonder how long it'll take to compile it
 
uhm, dunno
what i remember reading was that it is an iterative process. loop until it's okay.
 
I wish I could fall asleep during normal human hours.
 
@EmileCormier: If you figure out how to do that, let me know.
 
3:52 AM
I think I maybe have that
 
Hmm... that might require a doctor to fix
 
I'm sure there's an evolutionary advantage for people like us. Maybe we were the ones that watched out for lions at night. :-)
I've fantasized about taking up some kind of night watchman job where I could take a laptop with me and program stuff.
 

« first day (528 days earlier)      last day (4436 days later) »