|
Nomnom Cookie posted:isn't timsort in c++ stdlib? it is in java. ofc if you took out the reinvented wheels 90% of c++ code would cease to exist timsort is used for sorting objects in java, but they use a two pivot quicksort for sorting primitives, iirc. (hooray it's unstable but it doesn't matter)
|
# ? Oct 10, 2013 14:18 |
|
|
# ? May 26, 2024 20:41 |
|
i still keep reading my posts and for a moment go 'oh look tbc has replied'
|
# ? Oct 10, 2013 14:23 |
|
there's only one kind of equality for java primitives, so...yeah. i hope you weren't being sarcastic. you'd have to box the primitives to be able to distinguish stable from unstable
|
# ? Oct 10, 2013 14:24 |
|
Nomnom Cookie posted:there's only one kind of equality for java primitives, so...yeah. i hope you weren't being sarcastic. you'd have to box the primitives to be able to distinguish stable from unstable yep, it is just java iirc uses a stable sort (timsort), but will use an unstable one when it doesn't matter. I think this is rather neat. also i think that two pivot quicksort is quite neat.
|
# ? Oct 10, 2013 14:25 |
|
Nomnom Cookie posted:thats because experienced c++ programmers have a personal library of hacked up containers they c+p into every project no that's c programmers
|
# ? Oct 10, 2013 14:31 |
|
tef posted:timsort is used for sorting objects in java, but they use a two pivot quicksort for sorting primitives, iirc. (hooray it's unstable but it doesn't matter) excuse me but some 2s are warmer than others and I need my sort to preserve that order
|
# ? Oct 10, 2013 14:32 |
|
Shaggar posted:excuse me but some 2s are warmer than others and I need my sort to preserve that order should go and use a p-lang then instead of java
|
# ? Oct 10, 2013 14:36 |
java is a disease of the brain
|
|
# ? Oct 10, 2013 14:48 |
|
tef posted:yep, it is just java iirc uses a stable sort (timsort), but will use an unstable one when it doesn't matter. I think this is rather neat. Collections.sort uses mergsort because it has to work on Collection so u can def find some bad sorting in java stdlib. but it does good sorting if you use arrays, the best data structure
|
# ? Oct 10, 2013 14:50 |
|
|
# ? Oct 10, 2013 14:51 |
|
Zlodo posted:no that's c programmers a c++ programer is a c programmer who thought "i'll just use a class in this one place where it makes sense"
|
# ? Oct 10, 2013 14:52 |
|
two years later they're unironically writing move constructors and there's nothing to be done at that point but find them a job reinventing something. current makework project for the c++ team at work is serialization
|
# ? Oct 10, 2013 14:54 |
|
Nomnom Cookie posted:Collections.sort uses mergsort because it has to work on Collection so u can def find some bad sorting in java stdlib. but it does good sorting if you use arrays, the best data structure timsort is a mergesort
|
# ? Oct 10, 2013 14:56 |
|
Nomnom Cookie posted:Collections.sort uses mergsort because it has to work on Collection so u can def find some bad sorting in java stdlib. but it does good sorting if you use arrays, the best data structure Collections.sort in 7 uses timsort, idk what it uses in 6 (normal mergesort or modified). It also works only on Lists, not Collections since Collections are not necessarily ordered
|
# ? Oct 10, 2013 14:57 |
|
Shaggar posted:Collections.sort in 7 uses timsort, idk what it uses in 6 (normal mergesort or modified). It also works only on Lists, not Collections since Collections are not necessarily ordered must be 6 i'm remembering then. and what if i want to sort a set? this method signature is not suiting my needs
|
# ? Oct 10, 2013 15:01 |
|
use a treeset or other sorted set
|
# ? Oct 10, 2013 15:05 |
|
i dont want a treeset i want a hashset, trees are slow. sorted hashset
|
# ? Oct 10, 2013 15:16 |
|
treesets are slow because their sorted.
|
# ? Oct 10, 2013 15:25 |
|
Nomnom Cookie posted:a c++ programer is a c programmer who thought "i'll just use a class in this one place where it makes sense" oh no... oh god no... im becoming a c++ programmer
|
# ? Oct 10, 2013 15:30 |
|
Nomnom Cookie posted:two years later they're unironically writing move constructors and there's nothing to be done at that point but find them a job reinventing something. current makework project for the c++ team at work is serialization i dunno whats peoples beef with move constructors and rvalue references in a nutshell: only temporaries will bind to a rvalue reference function parameter, and a rvalue reference that have a name is considered a normal reference. you can use the std::move helper to turn something into a rvalue reference as an explicit way to hand it over to some other function, knowing that the object will be in an undefined but valid state after the call that's all you need to know for 90% of uses
|
# ? Oct 10, 2013 15:40 |
|
Shaggar posted:treesets are slow because their sorted. right thats why i want a sorted hashset
|
# ? Oct 10, 2013 15:54 |
|
Zlodo posted:i dunno whats peoples beef with move constructors and rvalue references ty for providing an example of a c++ programmer
|
# ? Oct 10, 2013 15:55 |
c++ really sucks. a lot. at least, that's what you think until you eventually realise that every other programming language is poo poo as well, perhaps even shitter.
|
|
# ? Oct 10, 2013 16:14 |
|
Nomnom Cookie posted:i dont want a treeset i want a hashset, trees are slow. sorted hashset LinkedHashSet http://docs.oracle.com/javase/7/docs/api/java/util/LinkedHashSet.html onl;y maintains insertion order, so you need to insert in-order
|
# ? Oct 10, 2013 16:21 |
|
Nomnom Cookie posted:right thats why i want a sorted hashset you cant have one
|
# ? Oct 10, 2013 16:22 |
|
OBAMA BIN LinkedIn posted:c++ really sucks. a lot. at least, that's what you think until you eventually realise that every other programming language is poo poo as well, perhaps even shitter. I am currently being forced to use c++ for a thing at work. at first I was bleh but then I was "c++11 is actually not a bad language" is it stockholm syndrome or is it wisdom
|
# ? Oct 10, 2013 16:23 |
|
it's wisdom. C++11 solves the main C++ problems. and omg i'm in san jose airport right now and i've seen more dell latitudes today than i have in the rest of my life
|
# ? Oct 10, 2013 16:25 |
SavageMessiah posted:I am currently being forced to use c++ for a thing at work. at first I was bleh but then I was "c++11 is actually not a bad language" it's wisdom but then you will hate it after a few months and wish you were using some p-lang or something. then you start using a p-lang for 3 months and hate that as well because of its subtle ambiguities that are all over the loving place and wish you were using C++ again.
|
|
# ? Oct 10, 2013 16:25 |
|
OBAMA BIN LinkedIn posted:it's wisdom but then you will hate it after a few months and wish you were using some p-lang or something. then you start using a p-lang for 3 months and hate that as well because of its subtle ambiguities that are all over the loving place and wish you were using C++ again. once I tried to use a plang to prototype a thing quickly thinking "its the reasonable thing to do" and I kept mixing everything up and ending up with some null pointer in the rear end end of my data because at some point before I mistakenly put the wrong thing somewhere them I just scraped that thing and started doing it in c++ and it went much better plang are useful only for small trivial things, for anything a bit complex you really need static typing to be any productive c++ is the best language in the "provide as many abstraction tools in the language without compromising performance" niche and when you have 30ms to update and render a bunch of poo poo it means its by far the best language
|
# ? Oct 10, 2013 16:38 |
Zlodo posted:once I tried to use a plang to prototype a thing quickly thinking "its the reasonable thing to do" and I kept mixing everything up and ending up with some null pointer in the rear end end of my data because at some point before I mistakenly put the wrong thing somewhere then you learn how to create p-lang bindings to C++ objects
|
|
# ? Oct 10, 2013 16:53 |
|
SavageMessiah posted:I am currently being forced to use c++ for a thing at work. at first I was bleh but then I was "c++11 is actually not a bad language" I mean c++ was already bad before, but c++11 ... god. it's almost as if they did it on purpose, to serve as an example of what feature creep and the desperate need to plug holes left over by previous design choices will do to a language, and how heaping an ever growing list of additional features will only ever serve to make things worse.
|
# ? Oct 10, 2013 16:55 |
|
OBAMA BIN LinkedIn posted:then you learn how to create p-lang bindings to C++ objects if only coders are going to touch the code its easier for everything to be in c++. easier to debug and easier not to waste too many unnecessary cycles on the slow cpus they put in consoles
|
# ? Oct 10, 2013 16:59 |
|
PrBacterio posted:it's stockholm syndrome please be even less specific, your posts arent lovely enough yet
|
# ? Oct 10, 2013 17:02 |
|
Zlodo posted:please be even less specific, your posts arent lovely enough yet concepts are cool where did they go
|
# ? Oct 10, 2013 17:12 |
|
Zlodo posted:no it isn't if it isn't how c++ people sort how come a c++ person showed it off as a great way to sort like four pages ago
|
# ? Oct 10, 2013 17:15 |
|
Cocoa Crispies posted:if it isn't how c++ people sort how come a c++ person showed it off as a great way to sort like four pages ago autism
|
# ? Oct 10, 2013 17:30 |
|
Zlodo posted:once I tried to use a plang to prototype a thing quickly thinking "its the reasonable thing to do" and I kept mixing everything up and ending up with some null pointer in the rear end end of my data because at some point before I mistakenly put the wrong thing somewhere what plang did you use?
|
# ? Oct 10, 2013 17:48 |
PrBacterio posted:it's stockholm syndrome yeah i agree it sucks that the language designers would actually add additional useful features into the language to make the programmer's life easier. i almost slit my wrists when i heard raii was a central theme of c++11. it was a nightmare.
|
|
# ? Oct 10, 2013 17:59 |
Cocoa Crispies posted:if it isn't how c++ people sort how come a c++ person showed it off as a great way to sort like four pages ago Bloody posted:autism
|
|
# ? Oct 10, 2013 18:00 |
|
|
# ? May 26, 2024 20:41 |
|
Shaggar posted:you cant have one thats why im learning c++ so the man can't keep me from having lock-free sorted hashsets Malcolm XML posted:concepts are cool where did they go you can sorta fake it with templates so the committee didn't want to add them because of "bloat". instead c++ programmers get enable_if
|
# ? Oct 10, 2013 18:09 |