Code Gore

Post the worst shit you've seen

>export data to .csv from a webpage
>click button, launches ajax request to get .csv file
>launches a headless browser process in the background on server
>headless browser calls server to get data
>server grabs csv file from directory, parses it and populates html page
>js is injected into the response, templated by string literals in C# code
>js scrapes the data from the page
>headless browser makes ajax call back to server to send scraped data
>server builds file
>finally responds to the original ajax call from the client

This was written by an developer who makes 120k.

Attached: csgrad.jpg (555x640, 38K)

Other urls found in this thread:

github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py
github.com/belluzj/fantasque-sans
twitter.com/SFWRedditVideos

> This was written by an developer who makes 120k.

If anyone here is hiring and wants to pay me 120k to fuck up their codebase, I'm willing to relocate wherever.

anything written in VBA, aka all my code and the code of anyone else in my firm since we do our programming in VBA
that said, I've been doing more and more in powershell which is bliss compared to VBA even though it's slower

k

>PHP
>Eight space indents
>File starts with eight nested if statements
>Nearly the whole file is intended 64 spaces
>Every single line looks like this

echo "Some HTML"; // Print the 15th row

Attached: 1543304718258.png (795x768, 396K)

bool xGreaterY( int x, int y )
{
return (x > y ) ? 1 : 0;
}

b8

Explain? This is the shit engine that runs space station 13 right?

Yes and most servers run on endless shitcode

what is the ? 1 : 0 ; thing called?

trinary operator

ternary operator

Attached: IMG_20190411_184649_862.jpg (800x600, 62K)

>webdev I work with includes jquery on every project
>check the code
>using it to toggle one (1) class on a click event
>tell him he can just write vanilla js:

document.querySelectorAll("button").forEach(el => {
el.addEventListener("click", evt => {
evt.currentTarget.classList.toggle("on");
};
});


"Nah user I want it to be future-proof"

holy fucking christ

*shrug* jquery is just easier to write than the js equivalent.

nigger

ternary/conditional operator
basically a fast way of doing a binary if/else
(statement) ? a : b
is equal to
if(statement){a}else{b}

tbqh this sounds worse than it is

1) if the templating reduces development complexity that's a huge win.

2) there's a substantial difference between serverside (node) and clientside V8, and not all libs and APIs work interchangeably, or have shims in place. I've encountered this problem myself and the performance loss wasn't that critical. Additionally, there are security considerations that could factor into this

3) sounds like a huge overhead but there's probably an nginx reverse proxy at the front end or some bullshit that chaches the requests. One off computation costs (within reason) are typically free, what matters is the performance under load.

you didn't give us the full picture and I imagine you're trying to paint it in the worst possible light, but tbqh it sounds like it could be a senior KISS solution. You don't have to overengineer everything.

hope this helped. maybe you can expand on the scenario, but not everything that looks convoluted is actually complex when it turns into something elegant.

is it actually faster? I just did it because I would rather do
$x = $condition ? $trueParam : $falseParam;


than
if ($condition) {
$x = $trueParam;
} else {
$x = $falseParam;
}

I'm brainlet. What's wrong aside from ignoring all warnings?

I think he meant faster to write, I don't think it's faster to execute.

What is >?
It's not. It's compiled down to the same assembly code

>It's not. It's compiled down to the same assembly code
maybe

99% of the cases for ternary op is actually just x = x ? x : y
they should make x |= y more common.

It's in comic fucking sans

Real protip: you can be pretty fucking bad at coding but if you can get good at leetcode and have a college degree, you're going to get hired by the big companies at silicon valley for top salary.

Secondlife
>bans innocent people and plays the victim when they come back and wreck the ever-loving shit out of the entire game
>$3000-3600 per month charge to own a server
>servers lag to high hell with as minimal possible VM allocations they can give you and get away with it, you have to complain and threaten to leave to get a better allocation or artificially load the server with scripts
>client is a mixture of C and C++
>no best practices or code audits ever
>the company repeatedly hires contractors to do small tasks like add 3d model support
>spaghetti, mixture of C and really bad C, REALLY bad c++, maybe one person they ever hired on contract ever gave them tested/optimized code
>in house programmers write a co-routine library based on boost's first implementation that makes their client impossible to ever move forward, they call it "multithreading", in reality it only moves code out of context
>all versions of the client leak memory
>all open source versions of the client are vulnerable to multiple RCEs in openjpeg
>their in-house made CEF library is vulnerable to multiple exploits
>their entire game runs on one thread sequentially, servers are the same, nothing times out, can cripple it by just making it do about anything repeatedly
>no caching, no optimization, no understanding of programming
>multiple security holes over the years, none of them ever disclosed to users, one was so bad someone had started to codecave servers to get GM powers
>their wiki containing user information was logged into by ex-staff and people with no credentials from unescaped SQL
>game client has multiple crashes
>game server has multiple crashes
>none of them fixed for 9+ years
>banned from life from steam for CP existing on their platform, and they banned the steam employee inspecting things, then came back with HighFidelity and got it on steam with a different company name
>multiple parts of the interface loop over arrays to set memory instead of using memset

Attached: 1534221171430.jpg (1536x1049, 274K)

You guys can go back to the bootcamp.
bool is_greater(int x, int y) {
return x > y;
}

But really you shouldn't make a function for something so trivial, a macro is better fitted (or at least inline that shit). Or if you're in c++, a template.

is there any hope for ss13?

Holy fucking shit

I work with a polymer front-end team. We have trivial functions like this to hide dom elements.

Attached: potatoapple.png (550x573, 17K)

Nobody at work knows how to use any programming tools. Get our group to start using git after manager keeps trying to find a way to share code. Nobody else uses, knows how to, or is willing to learn how. Someone else finally uploads something. It’s a .exe with a version number in the title. Actually uploads a newer verison later with another version number. Both are on there along with zero source code. Manager legit wonders how I get work done so fast. I don’t your just comparing me to people who have no idea what they are doing.

I know that feeling
Can't wait to get the hell out of here

I just end up making improvements that make my own workflow easier then show them to the rest of the team in spaced-out increments so I have a steady supply of :hey look at all the cool shit im doing"

How the fuck do you work on a project without version control? And why would you use anything other than git?
Please don't tell me you were doing manual version control.

I use git and love it and had been using it before our team started “using” it. It’s everyone else who isn’t using it and our manullay version controlling by tacking version numbers to file names and emailing each other code or even passing around physical drives. It’s atrocious. Luckily I work essentially independent from the others and don’t get dragged into this.

anyone have that C++ project from advent of code 2019. It was liek a group coding site. that was a fun day and those comments were hilarious

>>gpp is c++ YOU FUCKING MONGOLOID oh "^)

Step aside boys, OC incoming

Attached: D0F56A53-35F4-4F14-9317-52B54C3781AE.jpg (1953x573, 183K)

I once took over a security focused p2p communications project from some pajeet girl. It was written in C. Within the first day I found maybe 10 buffer overflows, all in the packet handlers. Suffice it to say, I wasted a lot of time cleaning that mess up.

Attached: programminggenius.png (461x660, 82K)

>loonix is secure
>shit like this happens
lmao

Code that I wrote yesterday to fix a bug with the material datepicker. I hope no one will ever have to work with that shit

Attached: my_shitty_code.png (606x170, 11K)

did you at least fuck the pajeet girl? Yeah I know why you partnered with her.

a dude I literally mentored on basic shit like unit testing back in 2014 somehow found himself in a CTO position in 2016. I'm unemployed at the moment nbd tho

did you put your loo in her poo?

Char True = False;
While(true)
[/Code]

She was working remotely from pooland

>python

Attached: 2019-04-12-023359_928x453_scrot.png (928x453, 51K)

>900 fucking lines function
>takes 30 parameters
Why the fuck do people do this? Are they brain damaged? Is separation of concerns really that hard of a concept?

I hate my life so much.

this

I deal with people on a daily basis who are seemingly incapable of abstract thinking, and never concerned with any plans beyond the next 24 hours.

What grinds my gear the most is how people are unwilling to improve or think about how fucked everything is. I sucked at the beginning as well, but from git annotations I can clearly see these people (they're already gone) worked on the codebase for multiple years and produced exclusively shit code from start to finish. Fuck it pisses me off so much.

Mercurial is all right.

My current place has two branches. Everything is just --rebase. They don't see an issue and have no willingness to learn. Infuriating.

>What grinds my gear the most is how people are unwilling to improve or think about how fucked everything is.
This
>I sucked at the beginning as well,
double this. But I went on a grind and fucking got gud. It is possible but holy shit some people just never feel the shame of being dead weight

>My current place has two branches.
I heard it's good to always commit to master, and branch when you release. But that isn't what you guys are doing, is it?

Another one:
>95% of business logic is in massive stored procedures
> what is abstraction, manageability, DRY code?

The issue isn't having trivial functions, it's the inherent cost calling a function carries.
When you work in embedded platforms, you have to avoid unnecessary stuff like this, because it can really decrease performance. Just recently I had 30% perfs improvements when refreshing my framebuffer just by inlining all the shit that was called for every pixel, as well as doing some type punning to avoid copies and stuff.

I'm getting to a point where I can identify amphetamine users by their coding styles. Its glaringly obvious once you get used to seeing some common themes. This example is one I would be highly suspicious of as well. Non jacked developers usually write much more direct solutions. Even if they are still ultimately bowls of incoherent spaghetti code, you can see that they were ultimately focused on the problem statement and not building a simulation of the entire matrix as a framework for csv conversion.

Behold the might of cherry-picking every commit which relate to tickets included in the release. So grep for some Ticket Ids and hope the were included in the commit message. No template nor hooks neither.

I code everything in Comic Sans ironically because it upsets our designer guy. He's basically in tears when he walks past my desk.

>work with someone who's nice guy most of the time but the issue is he thinks he knows a lot (he doesn't, i.e. he is frequently wrong)
>not only is he frequently wrong, he's averse to constructive criticism, more on that later
>have to explain basics to him everyday only for him to forget it by the time he has to ask me again
>he doesn't think it's a problem to interrupt me frequently with trifles when i'm clearly working on a deadline, i mean the guy doesn't even TRY to solve his own problem - he comes running in a panic at the first sign of adversity
>after i explain something to him (usually not for the first time) he then goes into this weird argumentative mode where he tries to convince me with some non-sense convoluted "argument" that he was right all along, i.e. wasting more of my time
>at this point i'm just smiling and pretending he was right
>can't take it up with management because he's the boss's son

Attached: 02.jpg (357x303, 21K)

Kek.

This should warrant murder without persecution.

To be fair, jQuery may very well be the only justified JavaScript framework out there.
Writing pure AJAX is absolutely painful and jQuery wraps it okay.

How does shit like this happen? It's unfucking believable.

That said, choices are limited.
>Rust and Go didn't exist when this started
>Java certainly wouldn't be faster
>If you agree on C/C++, people are going to fuck it up

>How the fuck do you work on a project without version control?

The bubble on places like Jow Forums and HN is extremely non-reflective of the industry as a whole. I've worked in a lot of places with the same bullshit: People literally emailing each other source code and one guy being told to copy paste functions into the production server.

This took me a while to understand. I'm shocked that the grammar allows this.

Here's a classic from JS basedboys.

Attached: JointPics_20190412_132515.png (1620x1920, 426K)

You're kidding

am I missing something? even if these 3 functions were combined into a single package that would be stupid

I'm guessing you also didn't know that is-odd depends on is-even. Which ironically might be better than having them completely independent in some regards. Just like eating shit is better than eating scalding hot shit.

Whats leetcode, senpai?

>is-even depends on is-number
>is-odd depends on is-even
this is so much worse than I thought

clojure gore
(list (symbol (str "(")) (symbol 'fn) [(symbol 'var1) (symbol 'var2) (symbol 'var3)]
(symbol (str "(")) (symbol 'if) (symbol 'var1) (symbol 'var2) (symbol 'var3) (symbol (str ")")))

This is written in production code and is actually more complicated than the example I provided.
Tons of terrible code generation, which is later transformed into a symbol, then a string, then under binding the namespace it's reread with load-str.
Terrible mess

Okay now this is epic.

just a lot of concepts and example interview questions that you might come across

>is-even hasn't released an update in two years
Time to call it deprecated and demand a fork

found the turbo autist

>versioned
>has dependencies
>that number of includes
The more you look at this pic the worse it gets lmaoo

Attached: f55c885b-c208-4dc4-8a97-dd07562070b3.png (1387x1600, 708K)

C++ object creates a java object
java object must call back to C++ object
put a long long member on the java object and pass the pointer of the C++ owning object through at java object instantiation time
java object calls through to a random free function over JNI which looks something like:

void func(void* owner, params) {
reinterpret_cast(owner)->do(params);
}

i wrote this and thought it was disgusting but maybe it was ok

dear ser do the needful
post bob

Attached: dearsis.png (546x132, 17K)

But not making another function just for it saves a cycle or two, doesn't it?

found this gem few months ago
github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py

Hory shito.

There's no cleaner way if both can only interact through a C style API. If pointers ever exceed 64 bits in size, you would need to store them in a java.math.BigInteger.
Another insane idea would be to move the C++ object into a Java byte array if the JVM should be responsible for garbage collecting it, as long as it doesn't hold any references which need to be deleted.

Lugaru. Just look it up.

I set my browser's default font to comic sans so I know when a website is using javascript to set their font like a pleb instead of linking a css in an html template.
I just figured it was the same brand of ironic humor.

Kek.

Attached: dereference.jpg (682x767, 622K)

(vba is unironically v.cozy for cranking out excel scripts)

t. former accountingfag turned incompetent codefag

The worst thing is that there's a monospace font similar to Comic Sans which isn't even half bad.
github.com/belluzj/fantasque-sans

that font is a fireable offense, maybe even euthanizable offense

Came across this one in a shitty legacy php project:
$datestring = ($datestring == "0000-00-00" ? "" : $datestring);

i need to see the rest of that paper, op. surely the rest is equally offensive.

>github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py
absolutely beautiful.

>But really you shouldn't make a function for something so trivial

Seriously, just use the operator inline, that's what it's fucking for.

> a macro is better fitted

mfw

Attached: 1552227658905.gif (200x200, 1.78M)

> is xml-parseable greater than
Thing the bash value operators but instead of -lt you replace it with an ampersand <

Macros are type independent you turbo nigger

if x>= y
true
else
false

triangle inequality

But it's only going to work for types that have a < operator anyway, so you don't get anything out of it that you wouldn't get by just using the operator instead of the macro.

This is obviously a joke
It did make my day, arigato user.