[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Do you intentionally do spaghetti code, /g/?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 39
Thread images: 1
File: 45655.jpg (411 KB, 811x592) Image search: [Google]
45655.jpg
411 KB, 811x592
Do you intentionally do spaghetti code, /g/?
>>
>>54323986
It's called "Job security". Don't forget to use tons of custom, obscure programs and languages too.
>>
Spaghetti code uses GOTO by definition.
Sorry I don't use laguages that allow that
>>
>>54324007
this. nothing wrong with my code if I know how it works
>>
>>54324019
You're wrong
>>
>>54323986
I nest so many ifs that if my boss was to replace me the programmer that comes after me would an hero the first day of his job.
>>
>>54323986
http://www.se.rit.edu/~tabeec/RIT_441/Resources_files/How%20To%20Write%20Unmaintainable%20Code.pdf
You'lol never lose your job without bringing the company down with you.
>>
>>54324019
>Spaghetti code uses GOTO by definition.

ok kid
>>
>>54324049
what if you got promoted?
>>
>>54323986
Yes, I don't get paid enough to actually care
>>
>>54324107
I avoid getting promoted, I don't want that. I take a cigarette break every 5 min even though the boss forbids it. I am the exception. If the boss says something "but anon... I said no, don't do that, don't take cigarette breaks so often..." I just tell him: OK then, you want me to quit? And he gets scared. I like this status to threaten my own boss. I'm a sadist I guess. They know that without me the whole company is fucked. all infrastructure depends on my code and I purposefully obfuscate it
>>
If you can't write code like this:

int m=1711276033,N=1,t[1<<25]={2},a,*p,i,e=39717691,s,c,U=1;g(d,h){for(i=s;i<1<< 24;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*
(h?c:1LL)%m,p[s] =(m*1U+*p-a)*(h?1LL:c)%m,*p=
(a*1U+*p)%m,p++,c=c*1LL*d%m;}main(){while(e/=2){N*=2 ;U=U*1LL*(m+1)/2%m;
for(s=N;s/=2;)g(40,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m; for(s=1;
s<N;s*=2)g(983983719,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;
}while(!*--p);for(t[0]--;p>=t;)putchar(48+*p--);}


... then you suck as a programmer.
>>
>>54324252
This is horrible. How does it feel to have adversarial relationship with your boss and colleagues? It must suck, unless you're a psychopath or something.
>>
>>54324252
>purposefully
deliberately
>>
>>54323986
only if it's delicious like real spaghetti
>>
>>54324252
depressing
>>
>>54324293
int t[1<<25];
this will take inimaginable amoumts of RAM

also, I think "while (e/=2)" will do an infinite loop
>>
>>54324252
fake but funny
>>
>>54323986
I did intentionally make a whole chain of sub-classes, 10+ classes deep.
If that counts as "spaghetti code"

I did it to separate each functionality of an otherwise very complex class into separate files.
>>
>>54324019
if (loo) {
poo(loo);
}
if (!loo) {
poo(designatedStreet);
}
>>
>>54323986
Java is shit-tier just use abstractions. Ditto C++. Pretty much got a job for life then.
>>
Depends on the context. If it's a quick 10 line script that gets used <5 times a day, you bet your ass it'll look like garbage. If it's going into production and will be used for every process that gets executed, then we'll need to be a bit more careful.
>>
>>54327570
>inimaginable amounts
>130 MB
>>
>>54323986
No, because I don't use BASIC or COBOL unironically.

>>54324019
C++ includes goto, but noone ever uses it.
>>
>>54324050
>the boss hire the Hank hill of cs and you get fired when he finish remaking everything from scratchs.
>>
>>54329284
i write programs and program accesories
>>
>>54327570
Unused ram is wasted ram
>>
>>54324019
What a cargo cultist
>>
>>54324252
worried kek
>>
>>54327570
>also, I think "while (e/=2)" will do an infinite loop
If e remains an integer until that point, and while in that loop, it won't be infinite. Integer division yields integers, and eventually it will reach 0 and break out of the while loop
>>
>>54324252
I've seen people who bring in millions get fired for silly corporate political reasons. You shouldnt expect people to make logical decisions.
>>
>>54324050
This is gold. Thanks anon :D
>>
>>54327868
class Location {}

interface CanBePooedIn
{
public function poo() : string;
}

class Loo extends Location implements CanBePooedIn
{
public function poo() : string
{
throw new \LogicException('cannot poo in the loo');
}
}

class Street extends Location {}

class DesignatedStreet extends Street implements CanBePooedIn
{
public function poo() : string
{
return 'you have pooed in the designated street';
}
}

function poo(CanBePooedIn $location) : string
{
return $location->poo();
}
>>
>>54324293
Why do I need to do that when I could just run my code through an obfuscator script.
>>
I believe if you're an assembly programmer you have no choice but to 'spaghetti' it up. jmp this and jmp that...
>>
>>54324007
is this real or just a meme?
>>
#include <iostream>

int main() {

int *i = new int[100];

*(i+99) = 100;
i -= 99;

loop:

std::cout << "Nigger\n";
++i;
if(*i = 100) goto endloop;
else goto loop;

endloop:

return 0;

}
>>
>>54324293
>take a file that looks like that
>put it in any half decent text editor or IDE
>press the format button
>suddenly legible code
But those variable names are fucking nice though. You've guaranteed yourself work for a long time. At least until your code gets audited.
>>
>>54324252
Bastard Programmer From Hell?
Thread replies: 39
Thread images: 1

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.