« first day (305 days earlier)      last day (3702 days later) » 

11:07 PM
0
Q: Is my simple string tokenizer wrapper orthogonal?

SparkyI always learn something from Code Review, so if anybody could point out any bad practices in design, violations of DRY, or orthogonality problems I would be extremely grateful! #ifndef TOKENIZER_H #define TOKENIZER_H #include <iostream> #include <string> #include <sstream> #include <vector> c...

 
Hello @Morwenn
 
@syb0rg Hi, how are you? :)
 
@Morwenn Good! How are you?
 
@syb0rg I'm fine too.
I was somehow trying to harvest some votes on one of my answers on StackOverflow.
 
@Morwenn I have one vote left for the day, let's see what answer in your profile I can spend it on.
 
11:10 PM
Seems that some C++ guidelines changed.
1
A: Can/Should i inherit from STL iterator?

MorwennAs of today (C++11/C++14), the standard seems to say that it isn't a good idea anymore to derive from std::iterator and that we should give up this practice. Here is a brief explanation, from N3931: Although the Standard has made this mistake almost a dozen times, I recommend not depicting di...

It could be useful for anyone trying to review iterator-based stuff here :p
Thanks^^
 
@Morwenn Have you seen my most recent C question?
 
@syb0rg Which one?
 
15
Q: Ultimate Tic-Tac-Toe in C

syb0rgHere is my attempt at the UTTT code-challenge (in response to the the Weekend-Challenge Reboot). Here is what I would like critiqued: I tested the code a few times for bugs, but I may have missed some. I feel like I have duplicated code in some places (with only minor changes being the differe...

 
Nope, I did not see it. Gotta take a look.
I see a GCC extension.
 
@Morwenn Hmm, I didn't expect you do recognize that. It turned out I shouldn't have used it anyways. Just me trying to be too fancy :P
 
11:16 PM
Haha, I will put a small answer about it. It will be good for anyone reading the answers :)
 
Sounds good. It'll have to wait a bit for my upvote though ;)
 
No problem.
 
@JerryCoffin - Morwenn's answer above - makes the language 'confusing' ... +1 to Java ;-)
When experts can't agree ;-)
 
The new C++ standard came out today?
 
Ouch ... karma ... just lost an accept for today ....
 
11:21 PM
@rolfl The designers of C++ created a beast more powerful than predicted and are still trying to control it.
 
@Morwenn Mention that I shouldn't use the case ranges, because it restricts portability.
 
@syb0rg The final draft came out. It still has to be validated by ISO.
 
@Morwenn - I am having a (I believe) good-natured back and forth Java vs. C++ banter ... tomorrow we are going to schedule an emacs vs vi encounter.
 
@syb0rg Ow right, it is so obvious that I forgot to tell -_____-
@rolfl RIP
 
All rest is peace ....
 
11:23 PM
@syb0rg No--won't officially come out until next year (probably). Was approved by the committee about a week ago, and the unofficial draft became available on their web site a day or two ago.
 
I wonder if this will invalidate some of my books... :/
 
C14, C.XIV or C-14 may be: * Autovia C-14, a highway in Catalonia in Spain * Fokker C.XIV, a 1937 Dutch reconnaissance seaplane * HMS C14, a 1908 British C class submarine * LSWR C14 class, a * Ramal C-14, the Argentinian track of the Salta-Antofagasta railway, famous for the Tren a las Nubes * Sauber C14, a 1995 racing car * C14, well-known nationalists' network in Ukraine, also known as "Medobory-Firm" * The 14th century * C 14-class missile boat, a light missile boat of catamaran design and also: * Carbon-14, a radioactive isotope of carbon ** C14 dating, a method for dating events * I...
Looks good. :-)
 
I hope there isn't a new C standard coming out yet. People have barely started using the C99 standard...
 
I hate it when I am forced to use C89 and I can't declare my variables anywhere.
 
@Morwenn When are you forced to?
 
11:30 PM
@syb0rg During practical lessons where teachers have no idea what C99 is.
 
@rolfl Not really a matter of "can't agree". It's a matter of something old having been rendered obsolescent by features that have been added since. Imagine a question about Java asking whether one should use AWT. Really old answers would probably say: "if you want windowing, yes." New answers would almost certainly say: "Not unless you're really masochistic."
 
@Morwenn This is where you raise your hand and say - "Umm, my compiler won't let my do that, because no one uses C89 anymore."
 
@Morwenn ...or when maintaining compatibility with Microsoft's compiler.
 
@JerryCoffin I like the comparison.
@JerryCoffin Well, they at least improved C99 support for the latest version.
 
@Morwenn Yeah--finally.
 
11:35 PM
@JerryCoffin They were doing a pretty bad job until there, but it seems that they are trying to be almost up-to-date now, which is pretty good actually :)
 
@syb0rg You do realize the C11 standard was released?
@Morwenn I don't recall seeing anything about supporting C11...
 
@JerryCoffin Yep. Which is why my mind is blown when people are still using C89.
 
@JerryCoffin I wouldn't surprised if they began supporting it in the next version.
On other hand, I wouldn't be surprised either if they did not...
 
@syb0rg I actually find it fairly easy to believe. In the (few) situations where C is a good choice at all, you don't really gain a whole lot from C11 over C89.
 
Anyway, I'm sleepy. Good night - or whatever - to everybody!
 
11:39 PM
@Morwenn G'night.
 
Thanks :)
 
@JerryCoffin It's more useful than you think, you just sometimes have to use some external libraries ;)
Most of the problem is that people are being taught to use the older standards, and not the newer ones.
 
_Generic seems really fun.
 
@syb0rg C and C++ both suffer from this. Most classes on either are tacitly "Introduction to doing low-level programming poorly", so they frequently impose all sorts of artificial restrictions like not using vector, string, etc.
 
It's not even always that there is a restriction. In my classes, there were never any restrictions. The problem is, we simply didn't discuss these things very much.
 
11:46 PM
C++ seems to be taught universally poorly
 
The no restrictions thing was really funny when for the first part of the semester, my C++ and ObjC classes, which had the same instructor, had identical assignments...
 
@Yuushi It's the "superset of C" approach which causes poor teaching.
 
@Morwenn Yeah, definitely
 
So, in C++, reading in and parsing a CSV takes a loop and you have to read line by line till you've read the whole file.
In Objective-C, reading in and parsing a CSV is three method calls, and you could nest them and fit them all 3 on the same line without horizontal scrolling or word wrap if I remember correctly.
 
@syb0rg I dunno. I was primarily a C programmer for a long time, but I can barely imagine going back to it now (for anything but a really small system).
 
11:49 PM
@JerryCoffin I wholeheartedly agree with that
 
@JerryCoffin Mainly the reason I embraced it was for development on the Raspberry Pi. But now I think I'm started to return back to OOP languages.
 
@JerryCoffin: My assumption was that professors feel that, for instance, learning how to make a linked list is more important than just using std::list. Perhaps these classes should just teach C instead.
 
Can't you dev Raspberry Pi in OOP?
 
@nhgrif Template everything and cross-compile.
 
@nhgrif Yes, but you have to be a ton more conscientious about object usages and memory management, since there is so little of it.
C dominates speed-wise.
 
11:51 PM
@nhgrif This isn't really a characteristic of the language itself though-it's purely a situation where the code to read that particular format is in one standard library but not another.
 
@nhgrif Of course you can ... Java ! ;-) (back to the corner for me)
 
gah, 20 points away from 3L :(
3K
 
I'll get you in 8 minutes @JeffVanzella
 
@syb0rg Not necessarily...
 
Got my last vote ;-)
Welcome to 3K
 
11:52 PM
thanks!
 
Oh, not yet.
premature
 
doh, just noticed
 
DVLR .... gaahhhhh
 
@Jamal Right--the problem isn't with the basic idea of teaching people low-level programming, it's mostly with claiming to teach C++ but then prohibiting using C++ at all well.
 
@JerryCoffin This isn't specific to CSV format. It was just example. A lot of the ObjC foundation classes have methods for instantiating an object from a file.
 
11:54 PM
I haven't learned any of the standard library in school. If not for the Internet, I might've still been unaware of it.
 
@nhgrif Ahh, I was going to eventually point you towards that question to answer it. I was eyeballing it so see what I could review, and only saw minor stuff.
1
A: Console monster battle game

nhgrifFirst and foremost, the best way to make this "more Objective-Cesque" would be to develop a UI for it. Whether OSX or iOS, the tools available for develop UI are really quite good... but let me look at the rest of your code... ;) I can't see any good reason for your Monster class properties (...

 
@syb0rg In the hands of anybody who knows what they're doing, C++ can always be at least as fast as C, and often faster.
 
@JerryCoffin Agreed
good example is std::sort vs qsort
 
@JeffVanzella welcome to 3K
 

« first day (305 days earlier)      last day (3702 days later) »