|
surely you meant to use a standard algorithm instead of writing a loop like a caveman
|
# ? Sep 3, 2013 18:49 |
|
|
# ? May 13, 2024 05:11 |
|
uG posted:surely c++ is the same as c surely you wouldn't use c when there is literally no reason not to use c++ instead
|
# ? Sep 3, 2013 18:51 |
|
yes the answer is always to use another language but the answer is never to use c++
|
# ? Sep 3, 2013 18:52 |
|
Zlodo posted:you surely meant ftfy (which is interesting because in other cases universal references will not do lifetime extension correctly like with an xvalue)
|
# ? Sep 3, 2013 18:53 |
|
c++ has lvalue rvalue xvalue prvalue glvalue can you tell me what each one is
|
# ? Sep 3, 2013 18:54 |
|
uG posted:yes the answer is always to use another language but the answer is never to use c++ oh thanks for the tip well im sure i can convince my company to make our next game in a java or p-lang, im sure it'll run just fine on consoles
|
# ? Sep 3, 2013 18:56 |
|
Zlodo posted:oh maybe you should find a company that uses p-languages or j-languages so you don't have to work in a game sweatshop
|
# ? Sep 3, 2013 19:00 |
|
FamDav posted:c++ has without actually looking it up I'm pretty sure that prvalues and glvalues are sub/supersets of r/lvalues +/- xvalues
|
# ? Sep 3, 2013 19:00 |
|
hmm I am kinda right in a vague sense but it turns out I have reading to do
|
# ? Sep 3, 2013 19:08 |
|
Zlodo posted:surely you wouldn't use c when there is literally no reason not to use c++ instead
|
# ? Sep 3, 2013 19:09 |
|
a mere mortal only really needs to know about lvalues and rvalues (and you can in fact pretty much ignore the later and still write functionnal c++ code, if slightly inefficient at times bc of superfluous copies) the other -values are basically just there to define all the subtleties of the behavior of rvalues and move semantics in the c++ standard and a mere mortal doesn't have to know all those intricacies to write c++ code lol if u use a single-vendor language where they dont need to go into that much standardization detail
|
# ? Sep 3, 2013 19:13 |
|
i just python to do stuff and its real easy and i don't have to spend 12 hours debugging super vague errors and tedious pointer problems the only thing i can think of doing with c that might be vaguely interesting is calculating stuff really fast with a GPU but I don't have any problems where time is a huge factor. like i could make a fractal zoomer or something but it would only run on windows if u have a nvidia video card
|
# ? Sep 3, 2013 19:18 |
|
Cocoa Crispies posted:maybe you should find a company that uses p-languages or j-languages so you don't have to work in a game sweatshop
|
# ? Sep 3, 2013 19:19 |
|
Socracheese posted:i just python to do stuff and its real easy and i don't have to spend 12 hours debugging super vague errors and tedious pointer problems python is written in c, isn't it? you were using c all along
|
# ? Sep 3, 2013 19:19 |
|
prefect posted:python is written in c, isn't it? yeah and its great because basically they wrote a wrapper over all the tedious parts of c so you don't have to worry about dumb poo poo
|
# ? Sep 3, 2013 19:21 |
|
if you want to write c, might as well go all the way with real asembley
|
# ? Sep 3, 2013 19:23 |
|
have you ever tried unicode string handling in asm?
|
# ? Sep 3, 2013 19:32 |
|
perl is also written in c lol suckers
|
# ? Sep 3, 2013 19:33 |
|
stoutfish posted:if you want to write c, might as well go all the way with real asembley just do gcc -S on some fairly basic c file for a glimpse into how lovely that would be
|
# ? Sep 3, 2013 19:34 |
|
Socracheese posted:just do gcc -S on some fairly basic c file for a glimpse into how lovely that would be https://idea.popcount.org/2013-07-24-ir-is-better-than-assembly/
|
# ? Sep 3, 2013 19:35 |
|
accept Forth as your one true language
|
# ? Sep 3, 2013 19:50 |
|
Star War Sex Parrot posted:btw this is pretty neat owns
|
# ? Sep 3, 2013 19:51 |
|
hey programmers: i've been using this nifty Haxe thingy it's an offshoot of actionscript 2 which you'd think would be awful and there is some goofy syntax wangdiggery but on the whole the whole project seems really well thought out and a lot of the library support for it is surprisingly good you can write your code once using a library like openfl for graphics, and it'll target compile to C++/swf/html5/neko binaries and not some VM-y thing i've been having a fun COMPUTER SCIENCE journey with it and it's features
|
# ? Sep 3, 2013 19:54 |
|
Mido posted:hey programmers: i've been using this nifty Haxe thingy isn't haxe more like as3, or did they bolt strong/optional typing on top of as2 like adobe did?
|
# ? Sep 3, 2013 20:18 |
|
Mido posted:use singletons everywhere yep, did some type encoded lengthed array stuff the other day with GHC.TypeLits felt like a real hacker importing GHC.* modules
|
# ? Sep 3, 2013 20:33 |
|
Zlodo posted:oh at work i got like an 800x speedup going from naive python to naive c for a particular thing and the devops/would-be asst mgr type refused to believe that one could ever get more than like a 10x speedup python->c
|
# ? Sep 3, 2013 20:55 |
|
Socracheese posted:just do gcc -S on some fairly basic c file for a glimpse into how lovely that would be i think most of the 'c is just portable assembly' people have never really written (a) assembly (b) c
|
# ? Sep 3, 2013 20:56 |
|
fritz posted:at work i got like an 800x speedup going from naive python to naive c for a particular thing and the devops/would-be asst mgr type refused to believe that one could ever get more than like a 10x speedup python->c lol but at the same time if you did the whole thing in c it probably would have taken months extra going from 80s to 10s is cool, but going from 8 months to 1 month is cooler
|
# ? Sep 3, 2013 20:57 |
|
Cocoa Crispies posted:lol but at the same time oh yeah this stuff is a whole mess of python w/ some compiled libraries, we're replacing one of the libraries for political reasons so i gotta re-implement the parts we touch, ive been keeping them in python when i can (and it is kind of nice for the old ego when my python is about 2x as fast as the library's c) but sometimes theres just no getting around it i ended up re-reimplementing the naive c version w/ a fancier algorithm w/ better complexity, but i switched to c++ b/c its not worth hacking up yet another stack/queue/map/etcetcetc thing in c when the stl's right there
|
# ? Sep 3, 2013 21:09 |
|
ive got a c++ app i want to make multithreaded dear god what the gently caress is this mess loooooooooool
|
# ? Sep 3, 2013 21:26 |
|
hope you like boost bro
|
# ? Sep 3, 2013 21:27 |
|
its even worse because the program is actually quite a bit of c as in no objects no design thought no anything good boost looks scary, managing threads sounds lol
|
# ? Sep 3, 2013 21:28 |
|
im not sure you have the credz to judge c based on your commentz
|
# ? Sep 3, 2013 21:31 |
|
Bloody posted:its even worse because the program is actually quite a bit of c as in no objects no design thought no anything good a coherent design threads does not make easily
|
# ? Sep 3, 2013 21:31 |
|
Use Java
|
# ? Sep 3, 2013 21:31 |
|
i'm no wizard but theres some pretty cool approaches to threading our your program that require very drastic/interesting architecture changes, like making a common 'task' base type and each thread in a pool is just handed a 'task' and told to make it go, then you break your poo poo into a nice service oriented communication driven model with events and clearly defined thread safe interfaces might as well just dehumanize self and face to erlang etc. at that point theres a buncha ways to do a thing
|
# ? Sep 3, 2013 21:33 |
|
Mido posted:i'm no wizard but theres some pretty cool approaches to threading our your program that require very drastic/interesting architecture changes, http://en.cppreference.com/w/cpp/thread/packaged_task
|
# ? Sep 3, 2013 21:35 |
|
anyways read this: http://www.amazon.ca/C-Concurrency-Action-Practical-Multithreading/dp/1933988770 most of it is applicable to boost threads, since the c++11 threads were mainly designed by the maintainer of boost threads (the guy who wrote that book). big thing to know about is the new memory model if you're using c++11
|
# ? Sep 3, 2013 21:40 |
|
um what's so hard about HANDLE WINAPI CreateThread( _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ SIZE_T dwStackSize, _In_ LPTHREAD_START_ROUTINE lpStartAddress, _In_opt_ LPVOID lpParameter, _In_ DWORD dwCreationFlags, _Out_opt_ LPDWORD lpThreadId ); ???
|
# ? Sep 3, 2013 21:42 |
|
|
# ? May 13, 2024 05:11 |
|
needs more HRESULT
|
# ? Sep 3, 2013 21:43 |