[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

ITT: phrases a C programmer would never say

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 96
Thread images: 6

File: bird.jpg (33KB, 630x388px) Image search: [Google]
bird.jpg
33KB, 630x388px
ITT: phrases a C programmer would never say
>>
I have a girlfriend
>>
>>60615012
/thread
>>
Hey Sanjay check out this functional and secure code I just committed.
>>
Maybe I should use immutable types.
>>
>>60614990
Please use Rust.
>>
>>60614990
Go sucks
>>
I don't get paid enough
>>
i forgot to free dat pointer
>>
c is an old byte processing language without templates, exceptions, namespaces, constructors/destructors (and therefore RAII), virtual function polymorphism, references, operator/function overloading, reusable standard generic containers, or explicitly named casts
>>
File: 1490204219945.gif (3MB, 408x218px) Image search: [Google]
1490204219945.gif
3MB, 408x218px
>>60615012
>>
>>60614990
Hey, we should write an OS in Javascript!
>>
I'm no longer looking for a job.
>>
>>60615828
/thread
But to be fair, only javascript programmers would think this was a good idea. Pretty much every programmer who works with other languages know the usefulness of C/C++/ASM.
>>
>>60615828
You literally can't even write Q_rsqrt() in Javascript.
>>
This code does not have any UAFs
>>
>>60615946
wtf is a UAF?
>>
>>60615960
Use after free.
>>
You're new to programming? then you should start out with a programming language that's a bit easier for you to understand.
>>
>>60614990
I enjoy shitting in a toilet.
>>
"Sure boss it can be done by today"
>>
Guys, what about the UX?
>>
>>60614990
i should make sure this int doesn't overflow
>>
Wow! I'm really amazed by how lightning fast Python is!
>>
>>60616240
this is not "things no developer said ever"
>>
I didn't suck any cock today.
>>
>>60616256
As a retarded programmer who can't into basic data structures and their algorithms, I'm constantly amazed at how fast set, list, and dictionary operations are in Python.
>>
>>60616295
Now, implement something that must solve a differential equation for all pixels of a 500*500 matrix, and compare the speed with what you get in C using the exact same algorithms (even without paralleling). That's exactly what I did today.

Python: 8 hours (estimated, didn't even finish)
C without paralleling: 15 minutes
C with pthread (6 threads): 3' 20
>>
>>60616515
scipy/numba
>>
>>60616083
I'll design the logo. In Assembly.
>>
Being able to show off my one line fizz buzz solution on /g/ is more important than creating well made programs
>>
I know how many items are in this array.
>>
>>60615703
underrated comment
>>
>>60614990
I'm switching to java.
>>
>>60616670
Are written in C
>>
>>60616927
?
>>
>>60615703
You can work around references with pointers
>>
>>60614990
Traps are disgusting
>>
>>60617635
Now do it with an array of strings.
>>
>>60617635
won't work if you pass arr to a function
>>
>>60617666
checked
>>
>>60617891
okay

>>60617966
true
>>
File: ss.png (4KB, 312x249px) Image search: [Google]
ss.png
4KB, 312x249px
>>60617891
>>60617966
?
>>
>>60617479
Well when you get right down to it, probably most things are ultimately in C.
>>
>>60618215
Indeed they are.
>>
>>60615870
Look, we both know that was a shitty hack that should never had made it to production. Even the comments in the code say wtf. It's code like that that's holding us back. JavaScript can do a square root properly.
>>
>>60618396
>never had made it to production
That's not true, it's not even Carmack's own invention. The only reason it says "WTF" is because he didn't write it himself and didn't understand it. Word on the street is that it's an old trick from SGI, who obviously had more experience with 3D graphics.
>JavaScript can do a square root properly.
These days it's not much of a gain, but back then it was like an order of magnitude faster.
>>
>>60618396
Okay well let me know when somebody rewrites Quake in JavaScript.
>>
>>60618429
>These days it's not much of a gain
Well it certainly does help to have dedicated instructions for things like that at the hardware level.
>>
I know exactlty how and why this works
>>
>>60618579
http://www.quakejs.com/
>>
>>60614990
I poo in the loo.
>>
>>60618579
http://www.quakejs.com/
>>
>>60617666
you can work around everything with conditional mov instructions
>>
>>60618598
Well, there's that, but also the proper square-root instructions are pretty fast. 7 cycles on Haswell+, I believe. Reciprocals are still pretty slow, though, so without rsqrtss, Q_rsqrt might actually still be faster.
>>
>>60618631
Emscripten doesn't count.
>>
>>60618598
To go back a bit in the reply chain, though, there's no way to utilize those in JS.
>>
I'm shaving my beard.

My life is easy.

I write secure programs.
>>
>>60618631
>>60618652
I'm still waiting for it to load.
>>
>>60614990
I Love Rust. Webdev is real programming.
>>
>>60618837
>I write secure programs.
But that's what they all say... "If you're good you don't make mistakes", that's what I've learned from the /g/ C experts.
>>
>>60614990
I am not taking care of someone else's child.
>>
>>60616014
Kek
>>
>>60619610
Are you a C programmer, what do you program in C?
>>
>>60618215
Python itself is written in C
So is Ruby
>>
>>60618062
>>60618171
what a bunch of gay fonts
>>
>I'm so happy I can work on fun projects instead of writing code for shitty microwaves in a shitty proprietary ide or making contributions to linux kernel that linus won't accept anyway
>>
Just use malloc
>>
I wish I could use a shitty non-compiled language that is at least five times slower than C to do this in a just a tiny bit simpler way

>>60622324
there is literally nothing wrong with malloc, unless your a retard
>>
void function(int* s){
..
..
delete s;
}
void main(){
int* p = (int*)malloc(sizeof(int));
function(p);
..
..
printf("No. of black gf my wife had: %d\n",*p);
}
>>
>>60622742
free(s);

Corrected
>>
>>60622742
>>60622756
Meanwhile a pajeet is doing
#define NO_OF_BLACK_GF_MY_WIFE_HAD 0
void function(std::shared_ptr<int> s){
..
..
std::cout<<"Lol i don't need to take any responsibility"<<std::endl;
}
int main(){
std::shared_ptr<int> p = std::make_shared<int> ();
..
..
std::cout<<"No. of black gf my wife had "<<NO_OF_BLACK_GF_MY_WIFE_HAD<<"with 0% responsibility "<<std::endl;
return 0;
}
>>
>>60615012
fpbp
>>
I don't need to look at the man page for this library function.
>>
>>60622652
Oh no, a whole five times slower! C programmers have no sense of scale indeed. I've found most of them to be innumerate.
>>
>>60614990
I'll let garbage collection deal with this mess.
>>
>>60616515
Python is great for automating menial tasks, for more complicated stuff I'd recommend creating a module in cython that contains the most intensive tasks and the rest can be done in regular python
>>
>>60621648
Fun side projects such as emulators and libraries.
>>
>>60615870
/**
* References:
* [1] ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip
* [2] http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
* [3] http://en.wikipedia.org/wiki/Newton%27s_method
* [4] https://developer.mozilla.org/en/JavaScript_typed_arrays
* [5] http://en.wikipedia.org/wiki/Fast_inverse_square_root
*/

const QUAKEx32 = 0x5f3759df
const x32 = 0x5f375a86
const x64 = 0x5fe6eb50c7aa19f9

/**
* Appearing in the Quake III Arena source code[1],
* this strange algorithm uses integer operations
* along with a 'magic number' to calculate floating point
* approximation values of inverse square roots[5].
*
* @param {Number} n Number
* @param {Number} p = 1 Number of iterations for performing Newton's method[3]
* @return {Number} Result
*/
function fisqrt( n, p ) {

p = p || 1

fisqrt.y[0] = n
fisqrt.i[0] = 0x5f375a86 - ( fisqrt.i[0] >> 1 )

while( p-- ) {
fisqrt.y[0] = fisqrt.y[0] * ( 1.5 * ( ( n * 0.5 ) * fisqrt.y[0] * fisqrt.y[0] ) )
}

return fisqrt.y[0]

}

fisqrt.y = new Float32Array( 1 )
fisqrt.i = new Int32Array( fisqrt.y.buffer )

console.log(fisqrt(9, 2))
>>
>>60614990
BlueJ fucked up my classpaths
>>
>>60623017
https://github.com/python/cpython/blob/master/Modules/gcmodule.c
>>
>>60623050
>side projects
Ok
>>
>>60614990
Semicolons are fine
>>
Maybe I should double check that free().
>>
>>60614990
You know the JIT compiler is just as fast, and I get to write in my favorite language, Scala. That's twice the productivity!
>>
>>60614990
>It is more important that a program works correctly than it running 1% faster
>The programming language is a tool designed to help humans, so it should help you find and avoid mistakes
>My programs all work with UTF-8.
>This API feels nice and natural to use. Everything is self-documenting.
>It feels nice to have a standard library you can rely on that has what you typically need.
> I am able to implement and use data structures that are more complicated than linked lists. (That's exclusive to /g/ C-programmers, others can do it.)
>>
>>60614990

> bruh just log the JSON to the console
>>
>>60615012
savage
>>
>>60614990
OOP was a good idea
>>
>>60622988
in embedded applications execution speed and execution predictability is important
of course a scriptkiddie wouldnt understand
>>
File: nwyd.png (145KB, 500x563px) Image search: [Google]
nwyd.png
145KB, 500x563px
>>60626310
>c
>predictable
no
>>
>>60614990
Sure, I'll use a sane build system, valgrind, statical analyzers, -Wall + -Wextra and other QA tools right from the start.
>>
>>60615012
/thread pretty much
>>
>>60622324
Pretty sure shawn mcgrath said something like this in the second programming talk he did with sean b, its on youtube but like 3h long
>>
>>60614990
- Windows is good platform for development and security.
- Done!
- Hello darling, I come back from running, what's about sex shower?
>>
>>60626425

If we are talking about embedded computers then there is a lot less undefined behavior because there is no memory protection or OS to worry about
Thread posts: 96
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.