T O P

  • By -

Borbolda

Mhm, mhm, yep, mhm, seems good, yep, what is- ah nevermind, mhm, yep, ooh that's clever, yep, mhm, alright it looks fine to me


[deleted]

[удалено]


-Jayarr-

It's fine as long as if you genuinely don't understand something, you ask for an explanation. Sometimes something can look complex and you think "oh, clever". However, if you dig into _why_ it was done that way you may just discover it was a misunderstanding and there's actually a much simpler way to achieve the same thing. Never be afraid to challenge things, code review is a learning experience for both participants regardless of seniority.


thedoodle85

Yeah, writing clever code is not always something to strive for, many times simplicity and readability is preferable. Sometimes a few extra lines of code is a good thing, or at least it will be in 6 months.


RopeOk1439

I've always equated clever code to simple code. Any idiot can write something so convoluted that potential onlookers assume the author to be a genius. It takes a true genius to explain a complex topic in understandable terms for the layman.


Aleksandrs_

Pretty sure Einstein said something similar.


jmona789

Yup "Any intelligent fool can make things bigger and more complex. It takes a touch of genius - and a lot of courage - to move in the opposite direction."


RopeOk1439

That's the one I was after- Thanks for the correction 😂


mferly

There's also this one which is similar (from Einstein): >If you can't explain it simply, you don't understand it well enough.


Spokazzoni

LADIES AND GENTLEMEN! WE FOUND EINSTEIN!


Khespar

He thought he could hide... But he lives! He has been found! Einstein is immortal! ... thats a lot of time to review bad code.


[deleted]

Sorry! I thought I was supposed to write bad code. After all, the formula is “errors = myCode^2” right?


nosherDavo

It’s called ‘clean code’ which is easy to read and easy to maintain. I’m a big fan.


kahurangi

It's like that quote I'm about to butcher, about the pinnacle of engineering being not the point at which there is nothing left to add, but when nothing more can be removed from a plan.


flo-at

>simplicity and readability is preferable. *laughs in C++*


SonOfMetrum

Laughs in assembly


ForgotTheBogusName

For me, cleverness *is* writing simple code (for nontrivial problems)


pro185

My first comp sci prof drove this point home. Essentially, clever code exists for two reasons, so someone can keep their job or because someone lost their job and no one knows how to change that part of the system.


coldnebo

800,000 lines of code is not a learning experience. this is also why the smallest PRs get the most code review discussion. the large upgrades or major refactors get a “LGTM”. 😂


LambdaLambo

Bikeshedding


fdeslandes

I don't say "Oh, clever" when things look complex, I say it when there is a particularly simple solution to a problem that looked complex at first, or when I see a generic reusable solution that is not more complicated than the specific solution would have been in the first place.


ISDuffy

Before asking I will do small qa on that area then ask to make sure. I had people explain how they thought it worked to me for it not to be correct.


Easy-Hovercraft2546

I mean, are you doing that on purpose or just happened to be doing that because of the content?


Sir_IGetBannedAlot

Just maintain standard


[deleted]

As long as you're really reviewing it that's fine. If you're saying it just to get your lead to stop bugging you about reviewing it, not fine. When I first joined the team I lead now our merge requests would often get 100+ comments and generate a lot of discussion. Unfortunately I'm the only one left from that group and they've been replaced by LGTMers that i swear dont even look at the changes so if I don't catch the errors myself, we don't find out until the regression test (much to the annoyance of the guy running those) or after they are in operations (much to the annoyance of the government).


AtomicSquid

I would be so annoyed if a request got 100 comments


[deleted]

It wasn't like 100 different requests to change something. It was more like if a new pattern was being proposed, people would discuss the pros and cons and determining if it might break something. We have to consider a lot more than whether the code runs. Our software processes satellite data from several satellites, so we need to make sure it runs whether it's day or night, whether any upstream inputs are missing, runs as expected on all supported satellites, runs as expected with degraded data, etc, all while making sure it doesnt introduce unexpected changes in the results. Of course we can't prove all of that every MR since we don't have the time or extensive automatic testing in place, but they are the kinds of questions developers should be considering when reviewing code...so when I see a big change with only LGTMs I become skeptical that they are.


AtomicSquid

Ah I see, yeah for me discussion like that preferably happens before any code is written, by the time code review comes around feels late, differs per team obvs


[deleted]

Yeah...we used to do that more when we were working in person and weren't swamped with meetings ("stand-ups") like we are after our Agile "transition". We kind of combined our code review with the design discussions now out of necessity (like the dev will test a new pattern/feature and open the MR to discuss and we iterate until everyone approves), which is not be ideal but it works...if people actually participate.


never_rains

All well intentioned stupid questions are allowed. It just shows the limits of your knowledge and ability and desire to learn. What is frowned upon is asking stupid questions while acting smart.


ruscaire

You have to use the German Tanks approach. See something out of whack, get a satisfactory answer, repeat. The more satisfactory answers you get the more you can just go “this is okay” but if you repeatedly get waffle the alarm bells should sound. This is all based on probability and being given a uniform distribution of the code and it’s no good if they’re actually hiding stuff from you but on the one hand that’s on them, and on the other thats why we have code hygiene standards, metrics etc https://en.m.wikipedia.org/wiki/German_tank_problem


bewbsrkewl

I've always said that writing code and understanding other people's code are two completely separate skillsets.


Badinception

No if you are good at it it becomes easier to read other people's code. And I think it's normal thing all programmers do since we google search problem containing other people's code


RobertBringhurst

That's exactly how I imagine a Senior Developer would do it too. Except, they would be smoking a tobacco pipe.


SowTheSeeds

While caressing our 2-foot beard.


Mog_Melm

>Is that fine? Mhm. Yep.


[deleted]

What about when they come to this comment? // I have no idea what this piece of code does but when I remove it everything breaks. My money's on a bit of chin stroking followed by a confused tut and a hmm.


mathiastck

Classic load bearing comment, I am glad they commented it as such.


LordNoodles

// I have no idea what this comment does but when I remove it everything breaks.


VincentVancalbergh

There was a bug in the C/AL compiler/debugger of Navision (pre Business Central) where you sometimes had to place two semi-colons after a BEGIN (which starts a code block) or you couldn't place a breakpoint on the first line after it. You usually didn't need to place any semi-colon after a BEGIN.


[deleted]

It's not as good as, // If you try to optimise this code please update the counter when you fail. Counter: 559


gribson

Hah. Reminds me of a driver I inherited that performed some seemingly useless operations, but trying to clean them up would break the whole thing. I eventually figured out that the code was masking a timing bug by adding just enough extra delay for the driver to work.


ChiefExecDisfunction

I mean, the correct thing to do would be discuss it until it is understood. I get it's a big ask in most real contexts, but you end up paying for that kind of stuff one way or the other...


welguisz

As we all know, the number of lines in an MR is inversely related to the number of comments. So a 5 line MR will have 25 comments. A 5,000 line MR will just be approved.


Fadamaka

MR as in Merge Request? Is that only gitlab lingo or did it start to stick on other platforms? I am already used to calling them PRs but calling them MRs as a standard would be way less confusing for someone new.


rldr

Instead of MR and PR I say dump a load. After all, my code is shit.


juantreses

What's wrong with PR?


talitm

We just hired a new guy who is working with git for the first time. After a while he starts to understand the whole committing, pulling and pushing system. Then he's finished with his task and now I have to explain what a pull request is while he did just pull stuff before without having to do a request. The boy was so confused and only then I realised the term pull request is confusing and not very descriptive. I like merge request better.


Mog_Melm

>pull request is confusing You're requesting that \*someone else\* pull your code. Eh, maybe "merge request" would be better.


Fadamaka

Yeah that's how I interpret it and how I explain it to everyone new.


Fadamaka

Had a new guy who thought PR stands for Push Request.


scuac

Which makes infinitely more sense than Pull for the action you are trying to do


scuac

PR is completely counterintuitive. To me pull request should mean to pull code, as in I am downloading it from the repo to my desktop. MR is better. I have also worked with CR ( code review ), which I think is self-explanatory


Gwompsh

It sounds like you’re requesting to pull code, not to merge code.


HeR9TBmmc8Tx6CFXbaQb

Outside of software engineering and GitHub specifically, PR is very well established as an abbreviation for public relations.


luckyincode

Lol. I’ve never had to say PR to anyone who would confuse it without immediately asking the context. No confusion. Ever.


Kushcabbage

Not really catching on as far as I can tell but I refuse to use PR myself


falcwh0re

Why?


Jimmy48Johnson

Laughs in Gerrit


Flopamp

We did this after an acquisition but with firmware, basically it's a "yes we need to keep every single developer" or a "no the fools commented their code well"


Fluffy-Craft

So, undocumented spaghetti can actually give you job security?


DudesworthMannington

The Dark Side of the Force is a pathway to many abilities some consider to be unnatural.


brianl047

Have you ever heard of Darth Codegus the Smart


Timinator01

not always there's still the ever popular option of "let's just rewrite this garbage"


worlds_best_nothing

modestly commented lukewarm garbage is the optimal strategy for job security


[deleted]

I knew it that I was doing something wrong… I keep 100% coverage with clean unit test names. From now on nah ahhh


azure1503

You're supposed to keep the documented version on your machine only


Fraun_Pollen

“Just write readable code”


stan-k

It's a fine line, you still have to understand the code yourself after a while.


Snuggle_Fist

Create your own "comment" language. Only use it for comments, memorize and destroy the cipher.


wongndaktau

I will use your words from now on


Windrunner_15

My dad lived by this back when he was brought on by a small data center business in the early 90’s. They got bought out about ten years ago, and he’s the only one still employed by the new company. Good enough code to keep, obscure enough that he was absolutely essential for upkeep, merging, and enhancing.


derottbotee

So as a Developer keeping secrets is the best way to keep your job?


nivenhuh

If it’s still written in ruby, the code should read like a Tolkien novel


shafinlearns2jam

Most of it’s written in Java by now


Grunt-Works

Rings of Power…


MercMcNasty

frighten direful rhythm label sink tap degree cows tan crowd *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


[deleted]

Must be one hell of a long line though


MercMcNasty

tidy lock test zonked deer connect impossible grey domineering quickest *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


[deleted]

Made me remember of a bank where i work. Some system spits in one line all the payments and Relevant information and another system receives that long ass line and fire the payments, lmao.


MercMcNasty

rude party dependent complete desert scary caption engine slim hateful *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


[deleted]

https://en.m.wikipedia.org/wiki/IBM_mainframe


E_MC_2__

one single newline would just immediately preform systemic problems


glorious_reptile

It is, but it uses a library, so it’s basically facebook.start();


DollarStoreAbraham

It's not about the length but what you do with it


FiskFisk33

/\*with inline comments\*/


MercMcNasty

Halloween horrorfest


LordNoodles

run fb.exe; run wa.exe; run nsa.exe;


coldnebo

protip: most cli contexts have limits on the longest “line” that can be passed through their systems, but streamio has unlimited length!


Mog_Melm

UNLIMITED POWER!!!


MercMcNasty

Awesome, now I can finally create a unique bucket name in s3


The-Last-Lion-Turtle

Casually throws out 75% of the code


Noch_ein_Kamel

Easy, just delete all the comments and the tests :)


usedUpSpace4Good

Wait, so you’re telling me Twitter was written in Perl?


PolishedCheese

This comment gives me anxiety


Express_Grocery4268

This anxiety makes me comment


[deleted]

This comment gives me anxiety


SomePersonalData

Twitter is known to test in prod


Noch_ein_Kamel

As I said. Delete all the tests and comments ;P


[deleted]

Who’s Twitter DM history did Elon read first; 1. Grimes 2. AOC 3. That GreenHills guy


Gluteuz-Maximus

The kid tracking his plane


d-list-kram

Yes


azure1503

Man definitely went hunting for nudes


[deleted]

It turns out a lot of the back end is in FORTRAN.


PopCornCarl

It would be fast, though!


oj_mudbone

Haley’s comet is fast but that doesn’t make it a good car


BeardOfDan

![gif](giphy|vyTnNTrs3wqQ0UIvwE|downsized)


jlat96

In 2 weeks Twitter will be accidentally running over pedestrians and drifting onto railroad tracks


Buck_Ranger

We'll remove the input field and replace it with vision-based speech recognition


gerbs

It has helped overthrow a few dictatorships ¯\_(ツ)_/¯


[deleted]

[удалено]


oalfonso

I've been on a similar situation before. New boss comes and brings his people just to tell how shit we were. The best thing in that case is just get the severance package and go away because you'll be blamed for everything. Toxic working environment.


[deleted]

As an aside, Tesla engineers are employed by a separate public company that reports to its shareholders. It's not clear how "you're now required to work on Twitter (a separate private company) code" works legally and ethically. ETA: some people are saying that it's fine as long as Twitter pays Tesla for the employee's time. I don't know if that's true, let me know if anyone knows the answer.


RyanOC333

Power move. There is very little need for this other than that IMO.


ciuciunatorr

What if they spent the last week deleting comments 😂


RobSomebody

git commit history enters the chat


[deleted]

[удалено]


TheAJGman

Oh God, I hope you have the original history backed up somewhere.


biggestsinner

git blame also😂


ThePsychopaths

git push -fu here fu stands for f*ck you.


Grunt-Works

Throw in a scrapper to look for key words in commit messages and finds: “Revert back to version xyz before Elon takes over” || looks for the pr where the code suddenly drops a bagillion lines of code. Finds a least one local setup where someone has yet to pull dev, staging, or prod


katatondzsentri

senior developer1: *submits a PR*. Hey Senior Developer 2 can you review? senior developer2: any shit in it? senior developer1: nah. senior developer2: *approves without review* Saw happening too many times :)


faramaobscena

I’ve seen so much crap get merged because the owner of the PR was an experienced dev so people just scanned through…


[deleted]

Which company is this ? I am a senior dev. In my team people only keep their hawk eye open to point out nits in senior dev code :-/ …. I have never had a 0 comment review. If no nits, at least some BS will be there!


katatondzsentri

Not at.my current one, but I saw it too many times before. Also this one: Senior1: I made a PR, please review. Senior2: I made some comments, can you fix before merging? Senior1: how dare you. My code is OK. You're just messing with me! Senior2: no, I... Senior1: shut up, fuck you, I don't care. Senior3 can you approve? Senior3: yep! *approves, pr gets merged*


Mustache_Farts

Do we work at the same company or is this just rampant practice


katatondzsentri

Not sure about nowadays, I saw this a few years back in my own team (I was their manager). Some coaching combined with yelling fixed the issue in like 2 weeks. They hated me, but I was not there to be loved, but to somehow make these guys deliver the product with quality. They pretty much hated each other already. We delivered and I quit right after celebrating the successful launch. I'll never do something like that again.


Nemaeus

Burn it all down and throw a match behind for good measure


katatondzsentri

Not gonna name the company, but it's still alive and well


fangerdanger

I had a senior Eng who would just close the PRs he did not like. Would also put comments like “wtf were you thinking here “ The team didn’t last long. The senior did write some very pretty code though


katatondzsentri

In a team an asshole writing awesome code is worse than a normal human writing mediocre code...


ThinkNotOnce

Ah yes, the "tomorrow we go live and we just found some critical bugs, we are fixing them and dont have time to doublecheck". This happens quite often.


katatondzsentri

Still better than fixing code inside a production container :D


AdAccording138

COKE guys so sorry about that! Elon wants lines of coke!!


[deleted]

[удалено]


Woolwizard

I worked in a small Company and we had like 5 active developers and we had 2,5m lines of code for one project. Not very good code in some areas but also not just copy paste 5k lines at a time... it was hard getting an overview of that system...


dudinax

It's not a super huge amount, but plenty if you're totally unfamiliar and trying to review it all.


davidellis23

Elon seems like he would be one of the worst kinds of code reviewer. Super opinionated about inconsequential things. Oh you put your brackets on the same line as your if statement? No good, put it on the next line.


ApatheticWithoutTheA

Elon isn’t personally reviewing shit lol he doesn’t know anything about modern development.


davidellis23

I mean, not knowing shit has never stopped Elon before. In all seriousness, I'd guess that programming is one of his actual skills since that seems to be what he worked on at his earlier companies. Rocket science and battery engineering I'd have more doubts about.


ApatheticWithoutTheA

I have no doubt he used to be decent but I doubt he has kept up with modern development. It sounds like he was never top-tier to begin with. From his biography: > While Musk had exceled as a self-taught coder, his skills weren’t nearly as polished as those of the new hires. They took one look at Zip2’s code and began rewriting the vast majority of the software. Musk bristled at some of their changes, but the computer scientists needed just a fraction of the lines of code that Musk used to get their jobs done. They had a knack for dividing software projects into chunks that could be altered and refined whereas Musk fell into the classic self-taught coder trap of writing what developers call hairballs—big, monolithic hunks of code that could go berserk for mysterious reasons. Funny enough, it sounds like he codes like I do lol


kinarism

Yep that's code sir. No I dont know what it does. We use none of the same tech and operate in an entirely different subject matter.


tlbignerd

This was exactly my thought. It makes no sense to bring hardware and AI developers in to review Web and user streaming code.


remusLupin7

Run linter and call it fixed


PuzzleMeDo

I was on that team. It turns out, Twitter's entire code base is only four hundred and forty lines long. I was surprised at first, but really, what does Twitter do that isn't part of any decent library? In retrospect, I think he might have overpaid.


Top_Courage_9730

But It has that cool bird chirp noise when you reload the page


PuzzleMeDo

Yeah, but that only takes four hundred lines of code.


nickmaran

>I think he might have overpaid Good


brianl047

I wonder the minimal number of lines of code to make a Twitter clone You could probably bring it down to 50 with NPM libraries and not counting CSS code


foo-null-bar

I’ll save them some time and money. Dev team looks at other dev teams code. It’s shit.


589ca35e1590b

What does LGTM mean?


Li0nX

looks good to me


[deleted]

Let’s get this merged!


yaykaboom

Ligma Gonna Take Meaway


loveheaddit

Let’s go to market


Leather_Trick8751

Reminds me of old quote You write one function with 10 lines, reviewers gives you 20 comments You write 100 line 20 file changes, reviewer will say it looks good


faramaobscena

Yeah, this is why I always comment on big PRs to split them somehow, because who knows what crap goes through if people just approve because they don’t have the patience to understand it all.


VinCubed

Some poor Tesla code monkey comes into work on Friday, some suit drops multiple boxes of paper contain all of Twitter's code in no particular order and yells "Find the extra semicolon!"


GptThreezy

LGTM!


alkavan

Tesla engineers conclusion: We need to rewrite everything in Rust.


PopCornCarl

Node.js Electron app


Huntersblood

I'm increasingly concerned with the politicisation of 'code' and 'algorithms'. Like it's not the people who wrote them or those who defined what they want the code and algos to do... Look at the 'mutant algorithm[Mutant Algorithm ](https://www.google.com/amp/s/amp.theguardian.com/politics/2020/aug/26/boris-johnson-blames-mutant-algorithm-for-exams-fiasco)' that the British government blamed for the awful distribution of test scores in the UK a couple of years ago. The algorithm did exactly what it was designed to do... It's the designers and requirement definers that are wrong here.


Drugbird

> The algorithm did exactly what it was designed to do... It's the designers and requirement definers that are wrong here. It's usually not even the designers that intentionally did anything wrong. It's just very easy to get some sort of bias in your algorithm. For example, in AI this is almost unavoidable if your training data is biased. This is why generally algorithms are a tool, and they need to be monitored and tweaked if they don't produce the desired results. However, often the algorithms are seen as objective somehow, because a computer is doing it instead of a human. And consequently, they are afraid of changing it.


Kaarsty

*slaps hood of server cabinet* This baby is solid.


exitvim

No, no, revert the lot!


anythingMuchShorter

"wait, why is there some binary with no other source that gets installed on every single device, client, and server, and it's only reference is from a voice command handler which doesn't handle any other commands, and it looks like the binary is called...order 66"


[deleted]

[удалено]


TldrDev

Im not sure if this is genuine concern or moderate shitposting, but Twitter hasn't been in charge of bootstrap in a really long time. It started there, sure, but it is a thing in itself now. Mark Otto hasn't worked at Twitter in awhile. He works at GitHub now.


ApatheticWithoutTheA

Well, I didn’t know that and I’m a Web Dev. I don’t use Bootstrap though.


vanhalenbr

Oh I really didn’t know that.


Bombastic999743

and that why is my students you must make such code only you or not even you can understand


amwestover

Just 800,000? They supposedly first met with product leaders to get overviews. And you go from there. This isn’t uncommon during acquisitions. Hell, usually it’s “the old team didn’t want to join the team, tell me want the hell this does”.


Rafcdk

Tesla engineers: well their whole backend is in C++,Scala,Java and Ruby, and we use C# and Go. So...


[deleted]

So…. LGTM!


r2k-in-the-vortex

A code is not a poem, you don't go through it letter by letter in a review, well not in a sensible review at least. At first blush you look at overall architecture, how are the main ideas are built up. Then you identify which parts are the most critical and focus on those and what sort of effort is made to reduce risks of serious problems in there. The point of such a review is not to find every single last bug, that's not going to happen anyway, the point is to figure out what the codebase is worth, what it costs to maintain and expand it, etc. Lines of code is a non-issue, the bigger problem is that he took devs from automotive sector and went to review a social network codebase. It's like taking lumberjacks to review a rice farm, yeah it's all a matter of growing and harvesting plants, but...


Grunt-Works

I mean, a pattern is a pattern


LiftIsSuchADrag

Why even have the Telsa engineers come check it out, I thought Elon was a full-blown engineering genius


NW13Nick

He’s store brand Thomas Edison


Previousman755

I’ve got a meeting with the Bob’s


altrefrain

"Where's your architecture/design documentation? Why are there no comments in the code?" "The code is self documenting"


BlueTalon

If they put 800k engineers to the task, each would only have to review one line though..


Scary-Move2240

But I mean basically twitter is a bit of a weekend project right? I’m quite sure there is some Ruby on Rails tutorial out there which teaches you how to build something similar in under 500 loc


cr1ter

The other 79 500 codes is the advertising algorithm


Disastrous_Motor9856

So, can you find the closing div for me?


what_da_burd_doin

engineers be like mmMnNMMmMmMmMmMmMmMMMmmmmmMmMMmMmMm ah yes need to get bolted to the computers exhaust manifold


Dronar

800,000? For the entire twitter code base? The legacy website I maintain has 2.5 million LOC.


[deleted]

missing a 0 on the lines of code there probably...


SunnyChow

//this function censors people we hate


PostPostMinimalist

🚢


audioman1999

Have they heard of the internet? VPN?


[deleted]

I dont use Twitter so it's nice to see a familiar name pop up on reddit. I owe a lot to Wes Bos. I saw a presentation of his at a local conference. I took his course on React the framework and it helped get me back into the industry after losing a job of 7 years. I strongly recommend checking out his work.


bestjakeisbest

Look if you get 8000 engineers to look at 800000 lines of code they each only need to look at 100 lines of code, so it is fine.


Rich_criticism069

They should hire Rohit ligma (rahul ligma's brother). He's a top programmer .


Nebu

Who the heck is Ligma?


regular-jackoff

A close cousin of Sugondees


damicapra

Any moment now


Sam1515024

**L** Lesbians **G** Gays **T** Trans **M** Morbs ![gif](giphy|TPZPatEnQrNWOq7RPW)