« first day (88 days earlier)      last day (4854 days later) » 

5:22 PM
@DeadMG - while on the point of int, short, long etc being essentially useless... whats the point of unsigned?
unsigned is a lot like const
you are trying to implement a contract
 
I'm also going to agree with that
 
but with a very coarse tool
if I want a contract, I want to be able to say "this number must be between 1 and 100"
 
int is useless? Uh oh. I better go tell a million lines of code...
 
or -10 and +64,000,000
in the very general sense, int is useless.
int = 70000;
is ... undefined
int i = 70000;
 
I felt a great disturbance in the type system, as if millions of objects suddenly cried out in terror and were suddenly silenced. I fear something terrible has happened.
5
 
5:24 PM
int number_of_stocks = 70000; doesnt seem very useless to me
 
no
 
great
 
I didn't say that int was useless
I said that the rest were useless
 
until you read the section in teh c99 spec
 
int has a great place as the type of convenience
 
5:25 PM
and see that int is allowed to be as small as 16 bits
 
don't care about what C99 says
this is my opinion
 
c89 perhaps?
 
and even if I did care about the Standard of my language of choise
 
which is what c++ anything is based on?
 
choice*, rather
but C++ has it's own Standards and I don't conform to any C standards
 
5:26 PM
you have to care about the standard
 
so I triply don't care what C Standard says
 
caring about the standard is the only way to write actual c++ code
 
someone please explain to me how int is useless
 
you may as well quote the Lua Standard or the Ruby Standard
@John Dibling: Nobody said int is useless
 
otheriwse you just have a hodgepodge of undefined and implementation defined behhaviours
 
5:26 PM
@Dead: @Chris did
 
@John: I think he misread my opinion
int has an excellent place as the type of convenience
 
it has?
 
very short to write, large enough that overflows won't occur in the vast majority of circumstances
 
@Chris: Do you personally believe that int is useless?
 
and what is that exactly?
 
5:27 PM
but short, long, long long, they're definitely worthless
char only has a worth insofar as the C++ Standard isn't as Unicode as it should be
well
 
pfaugh. char can point to utf8 data
 
not quite
 
so it can be unicode if you want
 
the variable size of char only has a worth insofar as the C++ Standard isn't properly Unicode
 
c++0x will let you say
const char* utf8String = u8"stuffs";
and
 
5:28 PM
Oh boy, to what point we got.
 
this is insane
 
@ChrisBecke: I could do
but virtually every other API and language uses UTF-16
like Java, C#, the MS Unicode APIs
If I was picking a character encoding and set for a new language, the top pick would be UTF-16
 
so again. There are virtually no uses of int, that will allow you to write a piece of c++ code that is going to behave correctly on any c++ compiler
and thats just dangerous
 
what on earth are you talking about?
 
you cant store the result of pointer arithmetic in an int
 
5:30 PM
@ChrisBecke really? oh, we should stop programming right now.
 
you shouldn't be doing pointer arithmetic into an int anyway
pointers should stay as pointers
 
@DeadMG: actually virtually every other API is not windows, but Mac or Unix
 
huh
 
and on POSIX systems
all the char* passed to file io are utf8
 
you're right- I should design my language for less than 10% of the desktop market share and ignore compatibilty with the biggest current compiled languages apart from the one I'm trying to directly replace
 
5:31 PM
plus, the c++ standard doesnt even state that wchar_t is strictly a unicode code point
again, like char, its implementation defined as to the character set stored.
 
meh, I have u16char on msvc10, so yay for that
 
it should be utf16_t, unless I forget what c++0x was meant to have.
but yes. c++0x does actually introduce explicit types, and literals, for unicode text.
const char* str = u8"utf8 string literal";
const utf16_t* st2 = "utf16 string literal";
const utf32_t* st3 = U"utf32 string literal";
which I am really looking forward to
anyway
 
no utf16 or utf32 output though
not like cout or wcout
 
@Chris: So back to your "int is useless" claim. Are you saying it's impossible to write correct code using int?
 
I started programming on win16, which had a 16bit int and 32bit long. win32 and win64 on msvc, with 32bit int and long. and GCC on OS X and Linux posix systems, where a int stays 32, but long can be 64 bits
Yes I am
except in the subset of cases where the number is explicitly smaller than 16 bits
 
5:37 PM
`for( int i = 0; i < 10; ++i ){ // magic }
this is incorrect?
 
depends what you are using i for
 
what native integral/floating data type can you not extend this claim to?
 
int32_t
int64_t
 
sure, your claim is "int is useless unless you know the value will be < 16 bits"
 
at least you know that they can actually hold the numbers you need.
exactly
 
5:39 PM
with int32 you can say "int32 is useless unless you know the value is < 32 bits"
 
more importantly, you can say
 
and then, like const, you are using a coarse grained mechanism to enforce something that should be enforced contractually
the problem with int is, lots of people expect it to scale up to 32 bits.
 
"int is useless unless you know the value will be < 16 bits or I know that my code is only intended to be written on implementations where the value is higher"
 
or naively used to to be an array index.
With a 64bit build on windows, the max size of an int can't index an array
 
and if this is correct on all the platforms that a software system is deployed to, why then is it wrong?
 
5:41 PM
because
I frequently access arrays of above 2billion items in length
 
great, use uint64
 
and 64K will be enough memory for a PC
things change
and we end up using the same code in 10 years time
 
sure
 
so? static assertions ftw
 
so in msvc14, they will expand the size of int
problem solved
 
5:42 PM
I proudly present you the new primitive ∞-capable-integer-type -> lemniscata_t.
 
you are going to write code today that will still be in use 20 years from now?
 
static_assert(int is big enougn for the numbers I have)
 
lol
 
and, in 10 years, Moores law vaguely predicts that your arrays will be about 32 to 128 times larger than they are today.
 
@JohnDibling I've written code that will probably be around in 20 years and I've maintained a lot of 20 year old code. Of course, all of that code assumed int was at least 32 bits or so.
 
5:43 PM
actually
I'm pretty sure that in 10 years, my arrays will still be the same size they are today
as I'm not planning on revising my code
 
@James - youre a lucky dog.
 
@chris: moore's law pertains specifically to the number of ic's that can fit on a chip
transistors, that is
 
it pertains to the cost per transistor
and hence, hwo cheap it is to make memory
 
pretty sure it applies specifically only the quantity of transistors on a CPU
 
@ChrisBecke That software will never run on a system with an int smaller than 32 bits. It just won't. It was a very safe assumption.
 
5:45 PM
it has nothing to do with the amount of data your applications are required to process
 
and, given relatively constant spending habits, how much memory we are going to put in our systems
@John, im sorry for you then
But over the last 15 years
the size of my data structures has been tracking the amount of memory installed.
 
so this extends to all software?
 
Where a game written 10 years ago had 10 sprites
we now expect 10,000 sprites
 
sure
 
and in 10 years
 
5:46 PM
but you'd have to REMAKE the game
to update the quantity of sprites
if you don't update the game, it'll have exactly as many sprites as it had when you released it
 
it will be 1,000,000
so?
 
so who cares?
 
We develop software today
 
if I make a game now that has 10 sprites
 
that I originally wrote for Win16
 
5:47 PM
it doesn't matter that in 10 years, people expect more
 
@DeadMG No, no. Doom was fully configurable. You can just change a flag when you start it and suddenly it runs in beautiful 1080p, new bigger textures and everything!
 
because I won't be peddling that game
lol
 
but Doom didn't require new and bigger datatypes for that. Or aren't we still in that discussion? haha.
 
lol
 
maybe you like rewriting the same code over and over
but I like to think that if I choose the correct types now
 
5:50 PM
I do think that maybe it should be refreshed every decade or so
 
I can be using the same code in 10 years
 
@Chris: can't be done in the real world. as the real world changes, so must software
 
I spent a part of yesterday
 
How old 32 bit ints are? Just calculate it.
 
stripping the "huge" keyword from a number of pointers in a gif decoder routine
 
5:51 PM
GOD is real, unless declared integer
wow
I'm pretty sure that we haven't had near/far pointers since 32bit
that must be, what, fifteen, twenty years ago?
 
As I said - code I wrote for my employer, probably about that long ago - for Windows 3.1
 
does it actually decode modern gifs?
 
is now being compiled and run on 64bit OS X
the gif spec is stuck at gif89a
so yes.
 
then your world hasn't changed since 89. no wonder the code still works :/
 
@DeadMG Undefined symbols: "God", referenced from: humans in earth.o ld: symbol(s) not found collect2: ld returned 1 exit status
 
5:55 PM
lol
it's a FORTRAN joke
about implicit typing
 
@ChrisBecke It doesn't matter how good the code is. You'll inevitably end up rewriting it someday.
 
well
in this case
gif decoding is now done via gdiplus on windows
and the NSImage object on OS X
but the gif code is still building
and working
 
so your code doesnt actually do anything? i bet i could write some NOP code that still works in 20, even 50 years.
 
of files that are orders of magnitude larger than it started on.
it still gets built and tested via the unit tests.
 
lol
 
5:59 PM
hmm. probably they invented unit tests before win 3.1, and kept it secret. I wouldn't be surprised.
 
yes, I bet that int main() { __asm { nop; }; } can still be valid.
 
hell, anyone who programmed c++ before '98 has their own collection of map, string and array classes
 
@DeadMG: not if main returns an int!
because, as has been asserted and definitively proved, int is useless
 
sigh. Unfortunately not. 1. the gcc syntax for asm is different. and 2. msvc doesnt support that in 64bit builds
 
that doesn't matter
I'll just keep MSVC10 around
and compile it for 32bit
 
6:01 PM
@Chris: I programmed C++ before 98, and I threw all that aincent stuff away when I doscovered STL
 
i prefer unsigned int to int, in almost all situations. Does this make me a bad person?
 
no
if you want to write unsigned all the time, go for it
I pretty much only do it when the compiler bitches at me for comparing signed to unsigned
 
@Runcible: If you ask @Chris, he'll tell you your code is useless and can't possibly be correct on any C++ compiler
 
@Runcible if you don't need the signal, that's the right choice.
I tend to use size_t as counter/array-index in for-loops.
 
@jweyrich: by signal, you mean like negative numbers?
 
6:04 PM
@Runcible yep.
 
ah ha
 
alright, all this insanity has made me very hungry. lunch time!
 
I need to order food
 
I need to get my code to build...
 
I need to design my game
I had a game idea in min
 
6:05 PM
I need a new job.
 
then I changed it for no valid reason
 
i prefer std::set<bool> to unsigned int in almost all situations. Does this make me a bad person?
 
now I'm not entirely sure if either of the ideas were actually any fun
std::set<bool>, rofl
 
Hey can anybody recommend a Linux book for a Windows programmer?
 
Sure
it's called
"Stick to Windows"
"By DeadMG"
 
6:07 PM
lol, cant
 
lol
when you find it
tell me
 
dont really want to anyway. i like new challenges
 
i had to learn everything by reading the man pages
 
next you'll tell me vi is the only true editor
 
@JohnDibling what exactly are you after? gui apps? services? a general overview?
 
6:09 PM
@jweyrich: servers (no guis) and simple console apps
and a general overview
 
@JohnDibling networking?
 
lots of multithreading, system calls, etc. but no guis
networking, yes
lots and lots of networking
 
@JohnDibling great. The two UNIX Network Programming are the holy bibles, and you'll find pretty much you need about networking on Linux/Unix. You might also want to take a look on relatively-recent AIO mechanisms, which if iirc, aren't covered. But libevent and asio have a good documentation.
 
@jweyrich: Thanks!
 
@JohnDibling most of the syscalls have a counterpart on windows (the inverse isn't true), so you might feel familiarised, despite the different names. The most important differences IMO, are on the process & scheduler part.
@JohnDibling if you want a better overview of the system, from an inside perspective, Linux Kernel Development is my best recommendation.
 
6:20 PM
a good book on linux gui dev would help a lot
i feel far happier on windows with the ... well ... window manager doing all the windowing.
on linux I always get the impression that Im building the widget library into my app
 
@ChrisBecke the main choices are GTK and Qt, but I personally don't like GUI development, thus I can't say much.
 
@JohnDibling For multithreading, why not use the C++0x threads library? I think the latest GNU standard library implementation includes it (maybe?); otherwise I highly recommend just::thread (I've been using it mostly on Windows and it's worked great).
 
Thanks for all the suggestions. I'm opening a thread on programmers to widen my net a bit.
@James: We can't use C++0x in out codebase
 
@JohnDibling No worries, POSIX threads are super-easy to use.
 
@JohnDibling Oh. :(
If I recall correctly, you said no Boost too, right?
 
6:33 PM
I personally use the Visual Studio Concurrency Runtime
it's quite sweet
 
@DeadMG Is that the library built on top of the work stealing runtime?
 
@JohnDibling btw, if you don't rely on WSA* functions on Windows, porting network code to Linux/Unix is really trivial.
 
@James: Right, no boost
 
work stealing?
 
0
Q: Linux Books For Windows/C++ Programmers?

John DiblingI'm a Windows C++ programmer with a great deal of experience, and I'm looking for book recommendations to get up to speed with programming in Linux (specifically RHE 6). Ideally, I'd like a book geared specifically to my needs. Something along the lines of "Linux C++ Programming for Windows Exp...

 
6:35 PM
@DeadMG Yeah; I think Cilk was the first implementation of it. It's a huge advancement in multithreaded programming.
 
@JohnDibling oh, interesting. Do you work with financial transaction processing? X.25?
 
Not x.25, but yeah. I write stock market servers
 
@James: Never heard of it
but Wiki seems to think that the recent .NET concurrency upgrades are based on it
 
Basically, the idea is that you can spawn off tasks and the runtime will go and execute them on idle or blocked threads (i.e., the idle threads "steal work"). It means there is far less overhead in doing work asynchronously.
 
and I'm pretty sure I read that they're the same thing
yes
isn't that just a thread pool?
 
6:37 PM
No, because tasks can be run on any thread, including the thread on which they were spawned.
 
ah
interesting idea
I don't know if the VS ConcRT will do that
 
Herb Sutter pushed to ensure that the C++0x threads library could be implemented on top of a work-stealing runtime (hence why the default behavior of std::async does not guarantee that the work will be run on a different thread).
 
@JohnDibling nice! I worked with X.25 for nearly a year. Mainly in a pre-paid cellphone recharging system (used with POSs, etc). I enjoyed it a lot.
 
He also said that eventually the Visual C++ implementation of the C++0x Thread Support library will be built on top of a work stealing runtime.
 
it seems strange to me that MSVC10 doesn't implement std::thread
considering that they just built an easy runtime upon which to base it
 
6:38 PM
@jweyrich: sounds pretty low-level. i like low-level stuff :)
as in close to the hardware
 
@DeadMG There was a lot of uncertainty about the features that would end up in the final thread support library until about a year ago. Until a year ago there was still functionality to asynchronously terminate threads; that's now been removed.
 
ah
that would easily explain it
 
@JohnDibling me too. But I have no prior experience with embedded development, except for custom GNU/Linux running on diskless machines via NFS. But this isn't embedded :P
 
man
I wish they had variadic templates
I saw why they didn't add them, and I can't argue against those reasons (mainly time and such)
but I so wish they had them
I also wish they would fix those annoying member lambda and decltype bugs
 
ive thought getting in to embedded code would be cool. i think if i ever leave financial services, i may go in to medical software. like the kind in heart-lung machines, that kind of thing
 
6:41 PM
also, is it just me, or do MSVC rarely/never update existing compilers?
I posted a bug about std::hash, and the guy posted back saying it would be fixed in VC11
and I was like, hang on a second
I appreciate that it's kind of minor, but if you've done the work, you've done the work
 
@JohnDibling I didn't like working on embedded software. :-|
 
no, why not?
 
@JohnDibling I think a big part of it was that it was hard to see results. I mean, once we were "finished" (as finished as software ever is), it was cool to see the vehicle working, but the years it took to develop the software was monotonous and boring.
 
i can see that
 
@JohnDibling hrm. The closest to medical I went was wrapping an existing C DICOM library to be used by a Delphi app. But I cheated. Instead of wrapping the whole API, I adapted a command line utility that came with the library, which accepted tons of command-line-arguments, and wrapped that into 2 calls LMAO.
the developer just needed to learn how to use the command line to use my wrapper. Win-win! Something on the lines of DicomProcess("-o bla -i ble ...").
 
6:46 PM
hey, whatever works!
is that Beatles quotespeak i see there?
 
Ha ha ha
 
ack
my arm aches for no apparently valid reason
 
heart attack?
 
wrong arm
 
ah, good
 
6:51 PM
plus I'm much too young, no shaking or out of breath
 
Thank you, John "The Optimist" Dibling!
 
lol
 
LOL
just being safe!
 
I spent six hours in the ER two years ago because I had sharp, burning chest pain and nausea. In the end they said there was nothing wrong with me, gave me ibuprofin for the pain and said that the nausea was likely due to panic over the chest pain...
 
lol
 
6:52 PM
I may be wrong, but I believe sharp chest pain is not normally a heart attack.
 
Great, $1,000 to get some ibuprofin... but, yeah, it's best to be safe with that sort of thing.
 
@JamesMcNellis Oh, I guess I know. Weren't they software developers?
 
Usually its gas. :)
 
don't say "chest pain" anywhere near a hospital unless you want a huge bill :)
 
I need to extract 2 (or 3) wisdom tooth. But it requires surgery because they're lying down, so I'm postponing. I hate hospitals or anything that look like that.
 
6:57 PM
lol
 
@jweyrich When you do get it done, make sure you specify which: two or three. Otherwise, you'll be lucky if the dentist stops at just the wisdom teeth :-D
 
@Fred: The advantage to saying "chest pain" is you get right in to the doc! no waiting 6 hours in the emergency room waiting area :)
 
true
 
@JohnDibling Seriously. I was admitted within ten minutes.
 
@JamesMcNellis lol
 
6:59 PM
@jweyrich I still have my wisdom teeth and I'm ... (does math) 27, no, 28 – no, 27 until later this year
fuck new years
 
@FredNurk we're both late. I'm 26.
 
i had 4 impacted wisdom teeth pulled 2 days before i went to college. bah
 
oh, gotta go. bbl.
 
bb
 
7:52 PM
it's disturbing to realize answers of your own which you feel are important get neglected while trivial and obvious answers get tons of upvotes :(
 
this is always the way it is
 
More people understand the easy stuff, so it gets upvoted more.
 
suppose it just reinforces my thinking that voting sucks, downvotes doubly so
 
i have found that in written communication, people only read the first 15 words or so
 
I find it amusing when I try and answer a question throughly, to little upvote, then answer something trivial and see it soar to the top of my "answered" list :)
 
8:03 PM
I got to -4 on an answer a couple months ago and it was the only right answer given :-P It's now at +7 though, so it all worked out in the end.
 
James, some people can be moronically fickle :)
 
then they get bored and stop reading, or scan to the end to find an "executive summary" Chances are you're doing that right now, and nobody will ever read this. Over time I changed how I write corporate emails to include the executive summary first, then the important details later. If there was a "you must do blah" then those are the first words of my email. stackoverflow suffers the same. people read the first sentance and decide to upvote, downvote, or do nothing.
 
Truth.
 
I would agree with what you said, but I didn't read past "executive summary".
 
And leads to many arguments of... "Darling, are you coming to bed?" "NO! Someone is wrong on the internet..."
 
8:06 PM
@James: lol :)
@Moo: lol :)
 
My trouble is, and I shouldn't let it get to me, is the pervasiveness of C-like idioms being asked in C++ questions. It really shouldn't bother me, these are other coders, I'm not employing them... but sometimes it feels as though we're banging our heads against the wall sometimes.
 
@Moo: It's not like banging your head against the wall. It's more like playing whack-a-mole, only there are hundreds of thousands of moles, and you never get any tickets.
Whac-A-Mole is an arcade redemption game. A typical Whac-A-Mole machine consists of a large, waist-level cabinet with five holes in its top and a large, soft, black mallet. Each hole contains a single plastic mole and the machinery necessary to move it up and down. Once the game starts, the moles will begin to pop up from their holes at random. The object of the game is to force the individual moles back into their holes by hitting them directly on the head with the mallet, thereby adding to the player's score. The more quickly this is done the higher the final score will be. Origi...
 
That's even more depressing :)
 
8:26 PM
@MooJuice don't forget you have no idea of the context of their work, and many things make less sense out of context. they could be interfacing with a C lib, or required to provide a C interface, etc. – even adhering to convention of an existing, established C++ library can make new code look like it's using only previously fashionable idioms
incidentally, posters providing too little context like that (even after acknowledging they can't provide all relevant details) is the most common source of frustration I see on public forums like SO
 
has anyone here read the 2nd edition of the dragon book?
 
when was it published? if sometime before ~1998, then I have
 
ah, I thought they were on more than just 2nd
not I
 
i think i'll get it
there is no kindle edition, sadly :(
 
8:33 PM
I've been putting it off; an ebook would make that decision easier...
 
i have a hunch it will never happen
odd as it may seem, it strikes me that someof the smartest people in programming are also the biggest luddites. knuth, for example, doesnt have email
 
@JohnDibling u mean, u don't know his email address
 
i seem to remember readining in TAOCP that he doesnt use email
 
@JohnDibling but knuth doesn't have email because he hates distractions, not because he isn't used to "new" technology
 
@JohnDibling, it bothers me when I can't get it on kindle. Whilst code might be hard to read occasionally, the fact it's with me everywhere and sits on a desk easily, is great. Remember the days of trying to keep an 800-page book open at the right place and also type?
 
8:42 PM
he has an assistant or secretary (I can't remember) that screens his snail mail for importance, and he later handles the bulk of it in what he freely calls "batch mode"
 
8:53 PM
I find some of the questions very interesting and want to bookmark them or some thing like to my account instead of searching every time for them. How can I do it ?
 
ionly way i know it to mark it as a favorite
you could also bookmark it in your browser
 
@Mahesh I also just use browser bookmarks, each question has a feed if you want to be notified about activity; "favorites" seem useless – and misnamed
 

« first day (88 days earlier)      last day (4854 days later) »