« first day (441 days earlier)      last day (4511 days later) » 

2:00 PM
@NikiC C hat hat?
 
Yes, that external factor ;) PHP is written in C and thus it is preferable to write extensions using C too :)
 
no
it's preferable to just write a C interface over your C++ code
 
@NikiC it is preferable to burn PHP with fire
 
Xeo
Ugh, PHP
 
pro tip: every language can interface with C
the fact that you have to interface with C doesn't restrict you to C at all
 
2:01 PM
One day I'm going to define a language that can't
just to be contrary
 
oh by the way, jalf
I found that concurrency bug
I used the return value of insert the wrong way around :P
 
@DeadMG I know that. But I doubt that PHP allows C++ code in the repo, but I'll definitely ask back on PECL, maybe it's possible :)
 
the fact that it was concurrent was irrelevant
 
It'll say in the spec that "any attempt to interface with C code shall result in death and suffering and the code shall be malformed"
 
@jalf Great tip, especially from someone who probably never used any (recent) version of the language ;) I hate it (not PHP, statements like that).
 
2:03 PM
@DeadMG ah :)
 
if( interfacing_with_c_code ) emit_virus_code();
 
@jalf Which kind of explains why I couldn't find a fault in the concurrent logic :P
 
@NikiC why? PHP is a shining example of how not to make a language
 
You people seem to really like C ^^
 
Xeo
We hate C. And most of the time, C++ too.
 
2:04 PM
I used to use PHP4. Haven't used 5, but I know it doesn't fix the problems PHP has
 
C++ is horrific
but C is far, far worse
it's amazing that anyone produces any software with it, ever
 
@jalf Many things changed in PHP 5 and even more changed in PHP 5.3 (and even more will change in PHP 5.4). You probably have an old impression. PHP 4 was really really bad, I won't disagree with this.
 
PHP5 is really really bad
useless crap like variable variables, eval, that kind of thing
 
@DeadMG I don't want to start a flame war now, but I can't refrain either, so: Why?
 
you know what would make PHP less suck? being a strict static language
 
2:06 PM
@DeadMG is there any language that sucks less?
 
I'm sick of the interpreter not erroring on my code when I read a variable that doesn't exist or something obvious like that
what a pile of junk
 
Lol. Minor language change.
 
@rubenvb C++
 
@DeadMG You probably forgot to enable error reporting ^^
 
@DeadMG I meant "sucks less than C++", in the strict sense, in all aspects
 
2:07 PM
There's still no sane unicode support. It still offers all the wrong defaults for a web dev language (building db queries through string manipulation instead of parametrized queries, and requiring you to escape HTML output instead of defaulting to that, and allowing you to override it the few occasions where it's not necessary
 
Xeo
@rubenvb "WideC", apparently
 
@rubenvb The one I'm currently inventing
 
type safety is still nonexistent, and it still has stupid pitfalls like == being utterly broken
 
@NikiC No, errors are where the code refuses to execute.
 
It's still slow as fuck
 
2:08 PM
Are there statically typed languages used for web dev?
 
One with existing and more than one implementation I meant. Something that is usable now.
 
So no, I think PHP still sucks
 
not just produces the wrong error at run-time
 
Xeo
@jalf weak typing is utterly broken, imho
 
@StackedCrooked C#
for one
 
2:08 PM
Ah, yes.
 
@StackedCrooked Most ASP.NET sites use C# or another statically typed language
there's also esoteric stuff like Haskell Server Pages afaik
 
Wow, you people are funny, I like you ^^
 
@NikiC So, can you convince me that PHP is not broken?
 
oh, hey @edorian, did you bring popcorn?
 
in fact, can you tell me one single reason why I should consider PHP a good language? Just one advantage it has
 
Xeo
2:10 PM
Know what's the biggest difference between C++ coders and other languages' coders? We know and admit that our language sucks (most of the time, anyways).
 
@jalf Sure. If you think that variable variables are a bad idea, don't use them (I didn't see them in any professional code since years). Just like with C++, I'm very sure that it has some really bad stuff that you just don't use. Or?
 
As far as I'm aware, it is a mix of broken features and common features that every language offers
@NikiC So your defense of PHP is that "you don't have to use all the broken parts"?
but why would I choose to use it at all? What positive value does it have?
 
Xeo
@jalf Could get complicated
 
Is there an area where it is better than other languages?
 
also, I can't choose not to use shitty dynamic typing
 
2:11 PM
@jalf Sure, many: Easy to get in, runs everywhere, easily scalable, good documentation, large community ;)
 
@NikiC Yup. vector<bool> and a few others
 
@DeadMG Well, that's the same in pretty much any scripting language. Like Ruby Python etc. You consider those shit too?
 
Xeo
@NikiC The C part.
 
@NikiC Yes.
@NikiC So scalable, Facebook had to start trying to compile theirs to C++ because it was so fucking slow?
 
@DeadMG Ah, okay. You would prefer to code websites in C++?
 
2:12 PM
yes
 
@NikiC No, easy to create bugs in. As a language it picks all the wrong defaults so that newbies inevitably end up writing terrible unsafe buggy error-prone and unmaintainable code. Runs everywhere, sure, but so does Ruby. I'd assume Mono can let you run ASP.NET everywhere too, although I haven't checked
scalable? Hardly. No more so than any other language
 
@NikiC with a decent "standard web library" that could be very effective
 
And Ruby or ASP.NET have large communities too
@NikiC: what other languages do you know as well as PHP?
 
@DeadMG Scalable to a reasonable level. If you talk Facebook you are on an entirely different level. But also consider: Facebook still codes in PHP, not in C++. Should that tell you something about the language?
 
yeah, that they have a massive existing codebase they can't afford to convert now that they noticed it runs too fucking slowly
it also tells you something that they could do the conversion, because all the dynamic features of PHP are fucking useless
 
2:15 PM
@NikiC It tells me that when all you've been hiring is PHP coders and you have a huge PHP code base, then switching languages is kind of awkward
 
@jalf Actually, more. As PHP doesn't keep stuff alive between requests it is far easier to scale it without code rewrites ;)
 
Why do you consider PHP scalable? How is it easier to scale than, say, an ASP.NET site? Or a RoR one?
 
@jalf See previous post
 
@NikiC PHP keeps a shitton of data between requests. Have you heard of sessions?
 
all web technologies use the same basic stacks- sessions, cookies, requests
 
2:16 PM
@jalf I put them in DB, so don't mind much bout that ^^
 
Also, that is not unique to PHP. Do you think other web technologies keep more data between requests?
 
they won't be different between PHP, ASP.NET, Django or RoR
 
@jalf Yes! Most of them start up once and they keep accepting requests, so you have some stuff that's always alive
 
@NikiC You have a process that's always alive. That doesn't mean you have data that stays alive across requests
 
@jalf Usually it does. Never coded in Java, but I think that's their approach for websites ;)
 
2:18 PM
Also no, they really don't. They have a webserver that's always alive, and then a sane platform stack has a pool of processes and/or threads they can reuse for requests
 
@jalf Ah, okay, I did not know that. As I said, I never used Java ;)
 
which is both efficient and scalable :)
I'm not talking about Java
but web languages in general
 
Well one example where you keep data alive is node.js. You couldn't scale node.js without rewriting the whole app ;)
I don't really know about Ruby / Python so I won't say about that.
 
True about node.js. That's both its unique selling point and its #1 limitation
Most web frameworks do not work like that
 
@jalf Ui, it's great to agree on one point at least :)
Well, let me phrase it like that: The main reason why everybody (who never worked with PHP) hates PHP is because PHP is so simple to get in. Thus it is open to many people who don't really know how to program and thus produce shit code. LOTS of shit code. And that's what you see from PHP everywhere. Nobody seems to mentioned that one can actually write just as nice code in PHP as in many other languages.
 
Xeo
2:23 PM
I'd still take static typing over dynamic typing any day.
 
Not really. The problem is deeper than that. Python is easy to get into too, and that opens the door to many people who don't know how to program, and they produce reasonable code
far from perfect, but not utterly broken either.
 
besides
 
PHP is a minefield. Any time you do something the simple or intuitive way, it results in a bug, bad performance or a security hole.
 
I am an experienced programmer and I do know how to program, and even I can't produce decent code in PHP
 
The problem with PHP is that it is designed to make it easy to write bad code, not that it is designed to make it easy to write code
 
2:24 PM
This on the other hand is also a great strength. It's not coincidence that Facebook uses PHP. Probably that Mark Zuckerberg guy coded up some shit code that somehow worked and from that (shitty) start evolved something greater ;)
 
as a language, PHP simply does not offer safety, security, or performance
 
Of course you can write nice code in PHP, it's jsut so much harder to do than in every other language
@NikiC So, which languages do you know?
 
@jalf Not really, I would disagree ;)
 
@NikiC Well, which other languages have you written nice code in?
 
@jalf PHP and to some degree C(++).
 
2:27 PM
he doesn't know C++ for shit and only knows C, realistically, and won't use C++
so make that PHP and C
 
And that's it? I rest my case then: People who like PHP simply don't know better. If you've worked with other languages, you'll realize how much nicer it could have been
 
@jalf You might have a point there, it might be worth looking into other languages too.
@DeadMG Honestly, for me C++ is just another syntax.
 
C++ is so completely and fundamentally different to C that C code in C++ is considered bottom of the pile
 
And that's why I don't get all that language bashing at all
 
even inheritance abuse Java-style is better than C-style
 
2:29 PM
@NikiC It always is. The worst that can happen is that you learn something new :)
 
@jalf I did learn Lisp and Haskell at some point, though they are too different to compare ;)
 
@NikiC Good C and good C++ really have nothing to do with each others. Anything you know about C should be thrown away when learning C++, and vice versa
@NikiC Nah, that's what makes a comparison interesting
 
I never really looked at Lisp
but Haskell doesn't have the right style for me
 
@jalf Still my point remains that C++ is just another syntax. If you can "program" in some language (even PHP!) you should be able to get a good grip at C++ in two days.
 
@NikiC hahahahahahahahahahahahahahahahahahahahahahaha
 
2:31 PM
Well, you can't ;)
it's not just another syntax
 
C++ experts take years to get that way
if they're lucky
 
Trust me, I've tried.
 
@DeadMG I actually enjoyed Lisp quite a bit. It's really powerful. You probably wouldn't like it at all, for the same reasons you don't like PHP (I mean, variable variables are nothing in comparison to Lisp)
 
even I have spent over two years on the language now
@NikiC Actually, LISP macros aren't particularly similar
 
@DeadMG @jalf So the same design patterns that make for good PHP or Java code are not valid in C++? I doubt.
 
2:33 PM
@NikiC the difference is that in Lisp there are rules governing their behavior. It's not just random ideas vomited up by a group of people who couldn't program
 
@NikiC Not even remotely good C++.
C++ is strongly typed, value typed, highly performant, and completely deterministic, as a general rule
that's completely different to PHP or Java
 
@NikiC Some of them are, sure, but not all
and even if they were, the way you'd implement them is completely different
 
@DeadMG No? okay, then I'm at loss. I thought that DI/IoC makes your code good in pretty much any language ^^
@jalf See: Just syntax / implementation detail.
 
@NikiC Well, how do you write C++ code that doesn't leak memory? Do any Java design patterns tell you that? ;)
@NikiC Sure. Ultimately all code is just an implementation detail
the actual code that makes up Google, Windows or Facebook is just an implementation detail
that doesn't mean the differences can be ignored
 
@jalf No, but is it really so hard?
 
2:35 PM
@NikiC Not if you know the trick. But that's a C++ trick, and one you won't learn from other languages
and not one that beginners usually think of themselves
 
C++ is notorious for being very hard
 
(unfortunately, I might add. On that point, C++ and PHP actually have something in common. Neither language really makes the "obvious" path the right one)
 
@jalf But you still could easily learn it just like you could learn its syntax? Maybe I'm underestimating C++ memory management
 
C++ allows you to write code that's not even remotely possible in PHP or Java
things like void* pointer casting and other type safety subversions, and non-garbage-collected systems
 
@NikiC Of course you can learn it. But my point is that it's not just new syntax, you need to think in a different way
just like when you write Lisp, it's not just a new syntax over PHP, it's something fundamentally different
 
2:37 PM
fundamentally, you need to consider object lifetime and ownership
in Java or PHP you just make whatever you need for however long you need
 
@DeadMG In good PHP you will consider that too, but for other reasons ;)
 
Xeo
So, did you guys mention templates yet?
 
@Xeo nope :)
or partial specializations
 
@Xeo C++ templates? I love those. It's one of the nice features of C++ :)
 
Xeo
@NikiC: It's one of the best and most important features.
 
2:40 PM
and hard to use
 
anyway, IMO C++ is a nasty mix of two issues: (1) the superficial stuff, syntax and such, is really awful and inconsistent and hard to get right, and (2) the language also requires you to think in a very different way than you do in Java or PHP or most other languages. It's not just one or the other, you have to get a grip on both to be competent at C++
But don't underestimate the syntax of a 20-year-old language built on top of C. ;)
 
@jalf I come from PHP, and trust me, if you do PHP you can't underestimate that ;)
 
anyway, I've got to run :)
 
@jalf Bye, nice chat
 
3:05 PM
Hi all...
 
sbi
3:17 PM
Well, I hope you all have a nice New Year's Eve!
I'm off for now, visiting friends for the night. See y'all when (at least for me) it's next year!
 
bb
 
3:32 PM
@Maxpm It's not "clean", it's primitive.
Also, why Chrome model sucks balls: dl.dropbox.com/u/26824/temp/chrome.png (cold start).
 
Xeo
@CatPlusPlus Holy.. are those all different threads?
 
No, processes.
Thread count is right next to CPU time.
 
@CatPlusPlus óÒ
 
Xeo
Wait a second..
Wtf?
 
it's kinda safe - one web-page can crash only one process
 
3:45 PM
It's nigh useless.
 
use firefox
 
What's funny is that Chrome can pull several tabs into one process, but it insists on that silly isolation and there's no option to switch that off (at least that I know of).
 
btw, ie8 (or ie9) has multiple processes too
 
so chrome is same crap as ie
 
3:49 PM
Well, Chrome works, Firefox works. They do their thing great. Everyone has 2GB of ram these days anyways. Web browsing is memory hell.
wooptif*ckingdoo.
 
Xeo
I only have 2gig at home. :(
 
user142019
hi!
 
user142019
happy new year everyone
 
@Xeo there, fixed.
 
I don't mind RAM being used, I mind RAM being wasted on near-useless features.
 
3:53 PM
@CatPlusPlus ok, then fork Chrome and turn off those features :p
 
user142019
@CatPlusPlus or use Lynx.
 
I don't have enough RAM to build Chromium.
 
lol
then submit a patch to add the option, let their buildbots take care of the binary
 
user406009
Firfox sucks. Just yesterday it consumed 4 gigabytes of my video card memory(well of course most of that was stored in a giant xorg memory use) for no good reason.
 
user406009
I had to restart firefox and then wait about 20 minutes for the buffers to reset before the swapping stopped.
 
4:13 PM
Lol
 
boN
Hey DeadMG
 
hi
 
boN
I'm currently reading the book and just finished an exercise and wondered if you could look at it and see if it's an efficient way to generate permuted indices? ^^
 
I actually don't know anything about permutations
or rather, I did at one point, but I've since forgotten
 
boN
Well i don't think thats gonna matter t hat much as it's not really far into the book, just want general tips on the things i'm doing ^^
 
4:22 PM
lol, ok
post it and I'll feed back what I can
 
boN
Thanks :]
Here's the project compressed: filebeam.com/209b34ecd0f64249eac0cdaebd410b89
 
no
paste the source code on to something like pastebin
 
boN
Ah okay
 
@boN it's what std::shuffle does?
 
boN
@Abyx no idea about that really, it was just an exercise in the book ^^
 
Xeo
4:40 PM
So, anyone else not going to burn money tonight?
 
burn money? why?
 
Xeo
Well, what is getting shot into the air tonight all over the world? MONEY!
 
well.. so I will do
 
I'm not burning anything.
 
Xeo
5:25 PM
0
A: Is it waste of time to develop unmanaged C++ library which like .NET framework class library in design and architecture?

Jairo Andres Velasco RomeroI assume: That you like C++ for performance reasons. That you like .NET for productivity reasons. You can try, but finally you will note that C++ will not supply the language constructions possible in managed languages (features as delegates, native interfaces, variance, lambda expressions, LINQ...

Just... wow.
Seems that guy knows nothing about modern C++
 
@Xeo So what? The fact that nobody here knows anything about modern PHP doesn't prevent you guys from bashing it. So he's in good company, isn't he?
 
Xeo
So long PHP doesn't go to static typing, I'll bash it all day long.
 
@Xeo See, don't complain about such answers if you are not much different ;)
 
room topic changed to Lounge<C++>: Only a few moure hours until year++ [c++] [c++11] [c++-faq]
 
Xeo
@NikiC Well, does modern PHP change PHP from dynamic to static typing? I don't think so.
@FredOverflow moure?
 
5:31 PM
room topic changed to Lounge<C++>: Only a few more hours until year++ [c++] [c++11] [c++-faq]
 
Xeo
Oh, I thought that was an insider I didn't know.
 
evening all
 
Xeo
o/
 
@Xeo No, all I wanted to say is that one shouldn't pretend to know about something even though one doesn't at all. Or even worse base arguments on that :)
 
Isn't that what C++ bashers do all the time? :)
 
5:43 PM
@FredOverflow Yes. It's what (nearly) all bashers do all the time.
 
damn, my family piss me off
 
Except if by "bashers" you mean "people who use bash".
 
@NikiC The fact that PHP is not statically typed is inherently obvious to everyone
 
For example you can bash C if you want, as I assume that all of you have programed once in both. So you have some factual foundation with that. But nobody of you has every done any significant work in any recent version of PHP ... so there is no foundation for arguments.
 
Xeo
@NikiC Static typing > dynamic typing is a fact, no matter the language.
 
5:46 PM
@DeadMG It was referencing the issue in general as well as the anwer linked above.
 
@Xeo Uncle Bob doesn't agree.
 
Xeo
Who is Uncle Bob?
3
 
@Xeo What @Fred just said
 
@Xeo Are you serious?
 
@Xeo Clean Code / Clean Coder
 
cpx
5:47 PM
Robert Martin
 
Robert Cecil Martin, known colloquially as "Uncle Bob", is an American software consultant and author. Martin has been a software professional since 1970 and an international software consultant since 1990. In 2001, he initiated the meeting of the group that created Agile software development from Extreme Programming techniques. He is also a leading member of the Software craftsmanship movement. His videos "code casts" on Clean Code can be viewed on www.cleancoders.com. He founded Object Mentor Inc. , a consulting firm that specializes in training their clients in C++, Java, OOP, Patter...
 
Wow, I am really impressed that somebody who doesn't know uncle bob tried to tell me how crappy PHP code is. I'm really impressed.
 
you're right
his knowledge of one random author totally changes his arguments against PHP
what the fuck are you smoking?
an argument is an argument, whoever the fuck made it
unless Uncle Bob wants to come down here and fucking defend his fucking point of view, then I don't give a flying fuck what he says or thinks
 
"one random author" ^^
 
there are a lot of people who write software books
 
Xeo
5:49 PM
@DeadMG You never give flying fucks. I wonder if you give walking fucks though? Or swimming?
 
he's just one
 
@DeadMG I don't smoke, sorry ;)
 
Xeo
@NikiC You fail to note that I only bash dynamic typing, not PHP in general.
The fact that PHP uses dynamic typing makes it a target of my bashing, nothing more.
 
@Xeo Indeed I failed to note that.
 
Xeo
@DeadMG Is IQ an unsigned integer? It would wrap around then. I wonder...
2
 
5:50 PM
Does anyone know of a remedy to stop sneezing?
 
disproof by counter-example
 
Xeo
@StackedCrooked Blow your nose? :P
 
@Xeo In that case though I may assume that you have done substantial programming in both types of languages and from that followed you conclusion? Or is the usual "I only worked in C++ so static typing is obvious better".
 
I wish that helped.
 
Xeo
snuff tobacco is also great for that.
 
5:51 PM
I guess I should finally start vacuuming my room.
I'm allergic to dust.
 
@NikiC I worked in Lua for a couple of years
 
Xeo
Oh, house-dust allergy?
In that case cleaning the room really helps
 
@DeadMG So now we're talking.
 
we were anyway
you were just too fucking stupid to notice
or do it remotely correctly
 
@DeadMG I do start to feel offended by now.
 
5:54 PM
good, you should be
everyone else has been making rational, logical arguments that you've basically been ignoring
then you've jerked off on something utterly irrelevant
 
@DeadMG I had the same feeling, just the other way around ^^
 
and invoked some guy who can't possibly defend his opinion
thus massively wasting the time of everyone who wants to hold a logical, coherent discussion
 
so I'm glad that you're finally paying a smidgeon of attention
 
@DeadMG I never had that impression to be honest.
 
5:57 PM
well, I went and ate and played Terraria for two hours and you were still having the exact same discussion as when I left
 
Did I hear "modern PHP"?
 
that doesn't really smack of logical progression to me
 
Can I laugh now?
 
and it went a little like this
C++ room: logical argument you: nothing of any substance
 
Xeo
@DeadMG Ah, I need money. I want to play Terraria too. :(
 
6:02 PM
So how was the meetup with sbi?
 
lol
@Xeo: Just wait for the final day and it'll be on sale for pennies
 
@DeadMG No, not still, but again ;)
 
Xeo
@StackedCrooked Cool. We had a nice little chat about all kinds of stuff. :)
 
@Xeo That's nice. I'd come too if it was a little closer. I've been in Berlin before but it was a 10hr drive from where I live.
 
Xeo
@StackedCrooked We plan to do another general SO meetup sometime in january, hoping to gather more people. :)
 
6:06 PM
Cool.
Perhaps, I'll manage somehow. Like Tony did last time.
 
@Xeo Where?
 
Xeo
No idea really.
But somewhere in Germany I'd guess. :)
 
well, I will be travelling through London in early January
so that would be mediumly convenient for me
 
@DeadMG I'm not really able to follow you (you know, with my -50 IQ). Some people here said several times that statically typed languages are superior but I didn't see any backup on that thesis, so I'm not exactly sure what you mean by "logical argument" there. So, please, stop insulting me all the way long. Anyways, dinner now, and have a good new year everyone, including you.
 
How noble.
 
6:14 PM
@NikiC happy new year to you too :)
 
6:54 PM
 
lol... I didn't even see that one...
 
Xeo
@MrAnubis One? All.
And when I'm bored, I still do the light switch thing.
 
Xeo
7:18 PM
5 hours till new year in GMT+0, no suprise there
0
Q: Class Hierarchy for Colors

berserkguardI am having trouble determining which class structure to use for storing RGB/RGBA color information. I am making a very simple 3D game engine for fun and to hone my OO-programming abilities. I would like my engine to have support for both RGB and RGBA colors. On top of that, I would like to hav...

OOver-engineered much
 
7:45 PM
@Xeo oh damn, I'm most likely not around to come over in Jan
else I'd have come over again, was really fun last time
 
 
1 hour later…
8:59 PM
hi
 
9:09 PM
@Xeo don't make fun of others :\
@DeadMG hola:)
 
9:26 PM
12
A: Setting an int to Infinity in C++

Etienne de MartelIntegers are inherently finite. The closest you can get is by setting a to int's maximum value: #include <limits> // ... int a = std::numeric_limits<int>::max(); Which would be 2^31 - 1 (or 2 147 483 647) if int is 4 bytes wide on your implementation. If you really need infinity...

I don't think I deserve that many upvotes.
 
Xeo
Damn, Windows Media Player needs incremental search in the playlist view..
 
@Xeo WMP is probably one of the worst pieces of software ever written.
It's worst than iTunes, and that says a lot.
 
Xeo
I know, but I don't have anything else at my disposal right now (I'm on a friends laptop).
I was actually thinking of using this opportunity to create a small music player
 
@Xeo Like foobar2000?
 
Xeo
Don't know that one
 
9:36 PM
It's a free media player with low memory usage.
 
Xeo
I don't care so much about memory, but rather about a nice interface to use. Oh, and speed when switching tracks
 
Try it. If you don't like it, then make a better one.
 
Xeo
I already like foobar2000. It supports portable installation. :)
 

« first day (441 days earlier)      last day (4511 days later) »