« first day (743 days earlier)      last day (4221 days later) » 

7:00 PM
Could someone who strongly knows the right answer clear this up? stackoverflow.com/questions/13111477/…
 
you are quite correct
mr __cdecl is wrong, although right-hearted
 
@DeadMG, Thanks. Sometimes my mind starts running away and I lose the logical thought process that led me to my point.
 
well, in this case it's fairly simple
you quote the Standard, he tries to infer from some implementation-defined thing which has nothing to do with what's going on
therefore, you're correct by definition
 
user142019
@DeadMG does Wide have const and volatile?
 
const, yes.
volatile, idk but I expect so, haven't really looked at that
you have to have const, really, because there are too many situations in which writing is bad
such as the key of an associative container
 
user142019
7:09 PM
Hmhm.
 
else I'd drop it in a heartbeat
I hate const.
but Wide's inference will make dealing with it easier
 
user142019
I think I’ll only allow references and pointees to be const.
 
How about making everything const by default, and use mutable to allow mutation, like in F#? :)
 
user142019
@FredOverflow I have also considered that.
 
user142019
But that would be rather annoying in an imperative language. Or not, maybe.
 
7:15 PM
Scala is in the middle ground; var and val both need three key strokes.
@Zoidberg'-- nice :) "Need a language? Why not Zoidlang?"
 
user142019
def main():
    foo:Array<String>
    push(foo, "Hello!") # Error, sucker!

    bar:Mutable<Array<String>>
    push(bar, "Hello!") # WINRAR
 
user142019
@FredOverflow hehe. :P
 
I'm a mutable kind of guy
 
user142019
I’m considering.
 
I use immutability but I would hate immutable default
srsly, you use <>?
 
user142019
7:19 PM
I use <> for generics.
 
user142019
What do you use?
 
()
 
Scala uses [] which is also nice.
 
user142019
«» :P
 
@FredOverflow You know Scala?
 
7:19 PM
@Borgleader Have been playing around with it a bit lately, yes. But no project above 100 kb of source code yet.
 
user142019
bar:Mutable[Array[String]]
 
user142019
That isn’t too ugly, actually.
 
@FredOverflow That's cool, I'm learning it in a web class in Uni atm.
 
user142019
def main():
    foo:Immutable[Array[String]]
    push(foo, "Hello!") # Error, sucker!

    bar:Array[String]
    push(bar, "Hello!") # WINRAR
 
@Borgleader What is a web class? A class about the web, or an online class?
@Zoidberg'-- What is the hash symbol? Comments?
 
7:21 PM
@FredOverflow A class about web, HTML5, CSS3, ...
 
user142019
@FredOverflow Comments.
 
user142019
I find // rather ugly.
 
@Borgleader Wouldn't you be better off learning JavaScript instead of Scala, then? ;)
@Zoidberg'-- Haskell uses -- :)
 
user142019
@FredOverflow I know.
 
Is that why your nick ends with --?
 
user142019
7:22 PM
No, that’s just decoration.
 
@FredOverflow Well we learn Javascript as well. But Scala is for the server side code. In fact, we're learning about a neat thing called Lift. Where the templating system doesn't involve any "code" in the html page at all and is all done behind the scenes.
 
user142019
You know.
 
I've heard about Lift.
 
user142019
I’ll only allow for const references and const pointees.
 
pussy
 
7:24 PM
@Zoidberg'-- Little Bobby Tables?
 
user142019
Or just const pointees.
 
user142019
Or just no constness at all.
 
then what are you gonna do about things which must be immutable?
 
user142019
Common sense.
 
such as the key of an associative container
 
user142019
7:29 PM
How are you going to modify the key?
 
user142019
Keys cannot be references, so you cannot modify them anyway.
 
user142019
foo:Map[String, Integer]
foo["meh"] = 42 # How are you going to modify the key?
 
user142019
I can do volatileness through the standard library and compiler magic.
 
user142019
No need for a language construct for that.
 
@Zoidberg'-- So I can't get a reference to the key?
 
user142019
7:38 PM
@DeadMG no, why would you want that?
 
I either can't obtain it at all, or I have to get a copy?
 
user142019
You’ll get a copy, which the compiler can optimize out.
 
What happens if you iterate over the map? What is the value_type? In C++, it's std::pair<const Key, Value> or something.
 
1
Q: Implement binary search

Carlj901This is my binary-search: int binarySearch(int arr[], int value, int min, int max){ int pos = -1; while (max >= min && pos == -1) { int mid = (max+min)/2; if(arr[mid] == value){ pos = mid; }else if(arr[mid] < value){ min = mid +1; }else if(arr[mi...

thoughts?
 
@Zoidberg'-- Uh, I don't think it really can.
 
user142019
7:39 PM
@FredOverflow Tuple[K, V]
 
@Carlj901 No drive by linking please
 
the compiler can't prove that I did or did not mutate the copy. That would be solving the Halting Problem.
 
user142019
Oh maybe a reference then.
 
so it would always have to copy
 
user142019
And if you modify it, UB.
 
7:40 PM
ah
 
user142019
:P
 
@Zoidberg'-- Hello Java.
 
so you're happy for a whole shitbunch of UB?
instead of nice compile-time safety?
 
I'll take compile time errors over UB any day of the week
 
But not on Saturdays and Sundays? ;)
 
user142019
7:41 PM
Okay I’ll add const references.
 
@FredOverflow I said week, not work week ;)
 
user142019
Foo& # Reference to object of type Foo.
Foo^ # Reference to immutable object of type Foo.
 
user142019
Bluh
 
hmm
looking for more examples of bad stuff in the Standard Library
so far I only ripped on std::string and iostreams
 
user142019
7:55 PM
iota
 
user142019
make_unique
 
std::result_of.
 
should have been more specific
bad OO design
 
Why is iota bad
 
ranges?
 
7:58 PM
Overspecialised maybe, but still
 
user142019
std::vector<bool>
 
All OO design is bad
3
That should make your job easier
 
eh
not using objects would mean not using integers, floating-point, strings, lists, etc.
and I dunno about you but I think those are kinda fundamental
 
user142019
Who needs a type system anyway?
 
user142019
Use bash.
 
8:00 PM
Integers are very OO yes
 
they're an abstract representation with a specific interface
 
Dat interface
 
user142019
[a] > std::vector<T>
 
If you conflate the 'object' from the object model of C and C++ with the 'object' in OO I don't know what to say.
 
?
@LucDanton I don't even know what the object model of C and C++ is.
 
8:01 PM
It's what make ints objects.
 
user142019
An object is a region of storage, with the exception of functions which are not objects even though they may be a region of storage.
 
I decided for myself that they are objects
I mean, it's kinda obvious
 
Xeo
Quick guys, I need a symbol that's not in the basic character set!
 
user142019
@Xeo Ø
 
user142019
> 1.8 The C++ object model
 
user142019
8:03 PM
> The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object is a region of storage. [ Note: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. — end note ]
 
particularly considering that there is no way to differentiate between int and an instance of some class X, given that X attempts to imitate int's interface.
so either "Being an object" is some worthless abstract characteristic with no actual meaning in any code, ever, or, int must be an object
 
user142019
ugh
 
user142019
I’m terrible at reading.
 
int doesn't have an interface.
 
You can't subclass int. Ergo, int is not a class and instances of int are not objects. Case closed.
 
user142019
8:05 PM
@Xeo œ∑´®†¥¨ˆøπåß∂ƒ©˙∆˚¬Ω≈ç√∫˜µ
 
@LucDanton You can't subclass sealed classes in C# either, but instances of those classes are still objects.
 
Xeo
Haha, thanks
 
and C++11 has a very similar construct too, IIRC
to which the exact same argument applies
 
@DeadMG Fine. Doesn't make int any more of a class.
 
it's just a class provided by the language- there's nothing inherently special or different about it compared to any other class
 
8:06 PM
C++ type system is bad anyway
 
It's second-class because you can't subclass. That's to what purists object.
 
user142019
I like Haskell’s type system.
 
you can write other classes that have that feature too
 
user142019
And to a lesser extend Python’s type system.
 
I know.
It doesn't change a thing. I don't see why it would.
 
8:07 PM
and secondly, you can't effectively subclass classes without virtual functions, either
and thirdly, you can still use a template.
 
I know.
 
int doesn't respond to any messages. If it were a class, it'd be an useless one.
 
user142019
int is final.
 
so it's a meaningless argument
 
It's not.
 
8:07 PM
it is
 
Also standard says it's not a class type so
 
Ell
what is Haskells type system like?
 
there are many classes which I effectively cannot subclass, and int is just one of them, but you'd still agree that an instance of std::vector<T> is an object.
 
Ell
I don't think int is a class either
 
user142019
@Ell Haskell’s type system is like bacon: awesome, orgasmic and everything you’ll ever need.
 
8:08 PM
I don't even know why you're talking about subclassing
 
@DeadMG Nope.
 
nor do I
 
Class with no interface is irrelevant and useless and might as well not exist
 
Simply put C++ is a very poor fit to OOP. Let's not try to shove it in please.
 
user142019
Everything is a very poor fit to OOP.
 
8:09 PM
OOP is very poor fit
 
Ell
why?
 
what, cause nobody ever used templates for abstraction or anything like that, right? And subclassing/interfaces is the only way to go.
 
user142019
Especially languages that use Simula-style OOP.
 
user142019
Smalltalk-style is reasonable.
 
enforced reference, must subclass everything! that's OOP right there.
 
user142019
8:09 PM
But still terrible.
 
Ahahaha is this the moment where you tell us Obj-C is acceptable language (because it's not)
 
user142019
No.
 
C++ has no multiple dispatch. Case closed.
 
You can argue that OOP is impractical and that a language should not be pure OOP, but you can't retrofit OOP to fit practical languages. Derive a different concept from it, like Practical OOP, but let's not rewrite history and make all the work of previous authors vanish.
 
And values are overrated, yes
 
8:10 PM
What's the point.
 
user142019
But Python is acceptable.
 
I don't even remember what the topic was but I'm having fun
 
Ell
what's multiple dispatch? also how about return type overload resolution?
 
C++ can't overload on return type
 
Ell
I know, do you think it would be useful?
 
user142019
8:13 PM
You send a message to an object and the object figures out what code to execute. If that’s what you mean by “multiple dispatch”.
 
It's not.
 
I've used it couple of times.
Playing with fundeps is fun.
 
user142019
@LucDanton Then I got the terminology wrong.
 
user142019
Meh.
 
Multiple dispatch or multimethods or function overloading is the feature of some object-oriented programming languages in which a function or method can be dynamically dispatched based on the run time (dynamic) type of more than one of its arguments. This is an extension of single dispatch polymorphism where a method call is dynamically dispatched based on the actual derived type of the object on which the method has been called. Multiple dispatch generalizes the dynamic dispatching to work with a combination of two or more objects. Understanding dispatch Developers of computer software ...
Not that hard
 
user142019
8:15 PM
Ahh.
 
Ell
I dislike internet conversations in that you would never tell someone in real life to google it
 
I can, would, and do.
 
I totally would.
 
user142019
Me too.
 
Ell
8:16 PM
how do you not just hit a wall in every conversation?
 
"Sweetie, do you still love me?" -- "Google it!"
 
by speaking
it's not that hard
 
Ell
like "google it" "errm okay. I guess we will have to change topics now"
 
when you have RL conversations they're with people without instant access to Google?
 
Ell
you can't google things while you're having a conversation
 
8:17 PM
sure you can
 
Google it on the laptop or phone you always have around geez
 
user142019
@Ell their problem, not mine.
 
Otherwise I promise to look it up on their behalf and later tell them the result.
 
Ell
you seriously make people get out their phones and google something, stalling the conversation until they do so as opposed to giving a quick explanation?
 
yep
 
8:18 PM
I can talk and use the computer.
 
Ell
how do you guys have any friends?
 
Ahahaha, I never talk about programming unless I'm in work or very drunk
 
all my friends have phones which can Google things quickly
 
If you do, I don't know what to tell you
(Also no, and real life conversations are totally the same as Internet ones, I can see why you brought this up in the first place0
 
Ell
@deadmg so what do you talk about to people?
 
8:22 PM
stuff that happens to me and them
 
user142019
Food he shouldn’t have eaten.
 
Ell
right okay. do you ever talk about topical things? the news?
 
sometimes
 
Ell
meh I think I'm just on a different wavelength to you guys
 
user142019
My friends and I talk about chicks and stuff that has happened.
 
user142019
8:23 PM
And how foolish some morons we know are.
 
the trick to "Just Google it" is to always have Google to hand, like a smart person
 
Ell
conversation must move extremely slowly
 
2hy?
the news reports the facts, we don't need Google to get them
 
Who cares about news
 
user142019
When with friends we watch TV or play the PlayStation 3.
 
user142019
8:27 PM
We don’t have extensive conversations on boring topics such as the news and programming.
 
user142019
And conversations about programming must be held in English anyway.
 
Ell
well googling something takes much longer than a quick explanation
 
I think you suck at googling.
 
no it doesn't
 
@jalf You haven't been able to hire a Java guy yet?
 
user142019
8:30 PM
Java <3
 
you're just trolling
 
user142019
I know.
 
@ManofOneWay if you pay me, I will write java stuff for you. don't tell my mother
 
user142019
> Written by a good programer, software in C is like a poem. Using Java, even a good programer produces software that looks like a law contract.
 
Nobody is Googling anything
Written by anyone, anything in C is buggy garbage
 
Ell
8:31 PM
I think you suck at conversation
 
user142019
@CatPlusPlus nah.
 
user142019
Nope.
 
C is a perfect language for writing bugs
 
user142019
@Ell I think you suck at both conversations and Googling.
 
8:32 PM
I prefer: "There are only 2 types of languages, the ones that people bitch about and the ones nobody uses."
 
user142019
@CatPlusPlus inb4 PHP.
 
It's not a very useful distinction
 
user142019
There are only two types of languages: the ones that suck and the ones that are Haskell.
 
That makes no sense
 
user142019
whoops :P
 
user142019
8:34 PM
brainfap
 
That still makes no sense, there is only one haskell.
 
user142019
Template Haskell!
 
user142019
And there’s a couple of dialects.
 
user142019
There are only two types of languages: the ones that don’t suck and the ones that are not Haskell.
 
user142019
Revised, ugh.
 
Ell
8:38 PM
Haskell sucks.
4
 
user142019
People who star that suck.
 
with that assessment I cannot but concur
 
Ell
there are lots of types of languages, amongst them are those that are used for practical applications and those that aren't
 
user142019
I don’t see how Haskell isn’t suitable for practical applications.
 
user142019
And no, that video doesn’t apply anymore.
 
user142019
8:41 PM
It’s obsolete.
 
user142019
You can do side-effects using IO.
 
Functional programming is cool, but I won't tell anyone to use it for anything such as making applications or anything.
 
Ell
@zoid never said Haskell wasn't practical, you're jumping conclusions. is that a guilty conscience? ;)
 
user142019
You meant that.
 
I just noticed conscience is spelled con-science. I've never spelt it wrong but that looks weird now.
 
8:45 PM
@Zoidberg'-- That doesn't mean anything. You can write a bug-free program in C but it ain't gonna happen in reality.
 
Hi peeps, I got a problem.
 
user142019
Me too.
 
@DeadMG int main(){return 0;} //better not take any chances
 
user142019
@DeadMG I don’t see how C is relevant, pun not intended.
 
I have a std::unique_ptr that points to something that, according to the VS debugger, is meaningful. I need to pass that to some C++/CLI code in another assembly, so I get the inner pointer with get(), wrap that in a IntPtr, send it, then on the other end, I cast it back to the appropriate type.
 
8:47 PM
my point is that just because you technically can write side effects using IO doesn't make it even remotely feasible to actually do so.
 
Well, I shit you not, the pointer manages to become shit in the meantime.
 
user142019
@DeadMG Why not? If I need a side-effect, I’ll need to do something in order to make that happen.
 
user142019
And I can do that using the IO monad.
 
well, for example, you might find that writing IO everywhere is exceedingly tedious and much slower than just using a normal language
 
@melak47 Ya blew it (once again), that's not guaranteed to work. Try int main(void) {}.
 
8:48 PM
@LucDanton darn it
 
@LucDanton No! void main(void) {}
 
user142019
@DeadMG You don’t need to write it anywhere due to type inference.
 
user142019
Only in some rare places, actually.
 
or you might find that having to make pretty much everything IO defies the point of even having a functional language
 
@Rapptz You think that's funny :|
 
8:49 PM
or you might find that it's fucking slow.
 
user142019
It’s not fucking slow.
 
@LucDanton I have a rather weird sense of humour.
 
@Rapptz You better stop before void void(void) {}
 
@Zoidberg'-- Not what I read.
oh, and you might also find that the Windows support is shitty, like I did
and a rather large dearth of useful tools
 
user142019
Who cares about Windows.
 
8:50 PM
it's only 90% of all desktops
 
user142019
Who cares about desktops. :P
 
oh, and laptops
and servers
 
Most servers run on Linux. IIRC
 
I think they're about equal
 
Not with the DeadMG definition of 'server'!
 
8:52 PM
but the point is the same
 
@DeadMG Because you don't. Geez
 
user142019
Oh an 90% of phones don’t run Windows.
 
I merely meant to say that Windows doesn't only run on desktops
not that it holds 90% share everywhere else
 
iOS is garbage
Android is garbage
 
Coincidentally Windows Server is garbage too
 
user142019
8:53 PM
Windows Phone is terrible garbage.
 
I've never used it so I can't comment.
 
user142019
Symbian is the only decent OS for phones.
 
user142019
Because Symbian is made for phones.
 
Does that have 0% mobile market share? I think so.
 
user142019
And iOS and Android and Windows Phone are made for desktops.
 
8:54 PM
Also really if you write anything that's not OS glue in IO in Haskell, you're really terrible at Haskell and functional programming in general.
 
user142019
Phones are for calling and SMS’ing.
 
user142019
And Symbian rocks at calling and SMS’ing.
 
@Zoidberg'-- not any kind of desktop I'd want to use
 
iOS and Android were made for mobile phones.
 
@CatPlusPlus But I really don't want to program functionally.
 
8:55 PM
Because you're terrible.
 
no, because I prefer a choice
 
user142019
I have a phone running Symbian and after three weeks it still has 80% battery power.
 
What choice
 
user142019
@DeadMG use unsafePerformIO. :P
 
@Zoidberg'-- Probably because it can't do anything useful
@CatPlusPlus A choice to program functionally or not as I see fit.
 
user142019
8:56 PM
@DeadMG It can call people and receive calls and send and receive texts.
 
@Zoidberg'-- Are you seriously comparing a "dumb" phone to a smartphone?
 
user142019
The only thing you should use a phone for.
 
That's what IO gives you. :psyduck:
 
:psyduck:
 
Psyduck confuses itself. Psyduck faints.
 
8:56 PM
Hmm. And I've been hand-coding assembly lately.....
 
hmm
so IO is full of mutating libraries? and Haskell is full of mutable containers?
 
user142019
Assembly is terrible.
 
user142019
No type system.
 
One thing you can't do in C++ is write bootloaders.
 
8:57 PM
@DeadMG ???
 
Yes you can
 
user142019
@DeadMG you can write mutable containers if you want.
 
You just make it two-stage
Like any sane bootloader does anyway
 
user142019
And for in-function mutable state you can always use ST.
 
@Zoidberg'-- Is completely not comparable whatsoever, as I'd have to invest a cockload of time into writing them myself and getting them right.
 
Ell
8:58 PM
yeah. just the assembly for the first initial jump isn't it?
 
To clarify IO is not a big centralized module.
 
user142019
@DeadMG there are probably already implementations.
 
oh, and re-implementing all the algorithms, too
 
Ell
or changing it to real mode or something
 
and then I'd have to drop support for the only platform that matters to me and go and code on the crappiest one around
and then I'd gain... what, exactly?
 
user142019
8:59 PM
@DeadMG You learn new techniques you can apply in other languages if you cannot use Haskell for whatever silly reason.
 
There are mutable containers
 

« first day (743 days earlier)      last day (4221 days later) »