Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
jesus WEP
Oct 17, 2004


whats the statute of limitations on writing terrible code? imo anything you wrote over a year ago was basically written by a different person

i ask because rear end in a top hat underling at work was looking at stuff i wrote like 3 years ago and passive aggressively sniping at the bad bits

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

~Coxy posted:

most of the time when people talk about for loops versus declarative alternatives it's not going to be something this trivial

I don't have an real world example right now, but a medium-complexity for loop that has a couple of nested if statements that does some stuff and also builds a new collection with the matches or some criterion is a terrible rat's nest, but should be quite trivially understandable as a linq method chain

this ftw!!!

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

St Evan Echoes posted:

whats the statute of limitations on writing terrible code? imo anything you wrote over a year ago was basically written by a different person

two weeks, tops

oh no blimp issue
Feb 23, 2011

once you've written code it's out of your hands and no longer your responsibility

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD
I write the code; I don't read the code

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Soricidus posted:

the filter version of the code meanwhile isn't python at all, which doesn't prove anything except maybe that it's easy to make things look nice when you don't have to care about real syntax

conversely, here's an actual example of the kind of thing i was talking about :

JavaScript code:
butts.filter(butt => butt.isBig()).forEach(butt => butt.insertProbe())
is not, in my opinion, an improvement on
JavaScript code:
for (let butt of butts) {
    if (butt.isBig()) {
        butt.insertProbe()
    }
}
you're right, that is worse. mostly because you're mixing OO and FP idioms. if you had immutable butts and functions that operated on them, you could have
JavaScript code:
probed_butts = butts.filter(isBig).map(insertProbe)
and even better your caller won't be surprised when half their butts come back probed

Bloody
Mar 3, 2013

St Evan Echoes posted:

whats the statute of limitations on writing terrible code? imo anything you wrote over a year ago was basically written by a different person

i ask because rear end in a top hat underling at work was looking at stuff i wrote like 3 years ago and passive aggressively sniping at the bad bits

6 months at most

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



St Evan Echoes posted:

whats the statute of limitations on writing terrible code? imo anything you wrote over a year ago was basically written by a different person

i ask because rear end in a top hat underling at work was looking at stuff i wrote like 3 years ago and passive aggressively sniping at the bad bits

it's been providing more value to the company for 3 years than complaining about it will. also the answer is a week

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

piratepilates posted:

it's been providing more value to the company for 3 years than complaining about it will. also the answer is a week

Or the first code review, which ever is shorter

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

St Evan Echoes posted:

whats the statute of limitations on writing terrible code? imo anything you wrote over a year ago was basically written by a different person

i ask because rear end in a top hat underling at work was looking at stuff i wrote like 3 years ago and passive aggressively sniping at the bad bits

it ceases to be your code and becomes a systemic problem as soon as it passes code review

if you dont have any kind of code review process, then it's still a systemic problem.

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Wheany posted:

Or the first code review, which ever is shorter

How could a code review be longer than a week :confused:, that sounds like a bad process

Progressive JPEG
Feb 19, 2003

Citizen Tayne posted:

nuke me from orbit

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

piratepilates posted:

How could a code review be longer than a week :confused:, that sounds like a bad process

if you have no code review, then it's one week

jony neuemonic
Nov 13, 2009

piratepilates posted:

How could a code review be longer than a week :confused:, that sounds like a bad process

i've seen tickets sit in code review for three weeks. no longer at that company, thankfully.

Progressive JPEG
Feb 19, 2003

jony neuemonic posted:

i've seen tickets sit in code review for three weeks. no longer at that company, thankfully.

same and same

the best is when you get two different reviewers who have different incompatible opinions on formatting

Vanadium
Jan 8, 2005

rjmccall, what's a temploid?

gonadic io
Feb 16, 2011

>>=
a monoid with a time dimension

this is a lie

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

temploid - A template app for Android. An Android template application to quickly get started with a new Android application project.
https://github.com/jaydeepw/temploid

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

http://aliens.wikia.com/wiki/File:Temploid.jpg

brap
Aug 23, 2004

Grimey Drawer
can we please stop acting like monads are hard to understand and don't say "yeah heh it's just a monoid in the category of endofunctors cmon guys"

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

fleshweasel posted:

can we please stop acting like monads are hard to understand and don't say "yeah heh it's just a monoid in the category of endofunctors cmon guys"

they are hard to understand

they're simple, but they're also a long, long way from how most people think about programming. which makes them hard to understand.

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
nb: if someone has trouble understanding monads/recursion/for loops/assignment/whatever and when they come to you for help your reaction is

*snort* that's so easy, are you stupid

then you are what's wrong with programming

coffeetable fucked around with this message at 11:20 on Mar 13, 2016

Vanadium
Jan 8, 2005

i think its not the reaction to people coming for help, just to people declaring that haskell is bullshit because people talk about it in terms of monads

haskell is bullshit for completely unrelated reasons

distortion park
Apr 25, 2011


we don't have code reviews

Valeyard
Mar 30, 2012


Grimey Drawer

Progressive JPEG posted:

same and same

the best is when you get two different reviewers who have different incompatible opinions on formatting

That's why you should all use the same ide, with the same exported formatting and code style settings

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

pointsofdata posted:

we don't have code reviews

software gets written without code reviews, unit tests, separate development/production servers, specifications, IDEs or version control.

software written using proper tools and procedures has a higher chance of being not-poo poo, but none of it required

oh no blimp issue
Feb 23, 2011

Valeyard posted:

That's why you should all use the same ide, with the same exported formatting and code style settings

we have a global coding standard thats like "put braces on new lines", "use tabs", "dont be a knob"

distortion park
Apr 25, 2011


Wheany posted:

software gets written without code reviews, unit tests, separate development/production servers, specifications, IDEs or version control.

software written using proper tools and procedures has a higher chance of being not-poo poo, but none of it required

I'm trying to imagine not using any of them and it seems a lot like bash scripting

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Awia posted:

we have a global coding standard thats like "put braces on new lines", "use tabs", "dont be a knob"

ah,
code:
# EditorConfig

[*]
curly_bracket_next_line = true
indent_style = tab
be_a_knob = false

oh no blimp issue
Feb 23, 2011

lol

Valeyard
Mar 30, 2012


Grimey Drawer

Awia posted:

we have a global coding standard thats like "put braces on new lines", "use tabs", "dont be a knob"

Same, except it's all enforced via Eclipse when you hit save. It also means less chance of false version control diffs

Valeyard
Mar 30, 2012


Grimey Drawer
I personally enforce the "don't be a knob" one

oh no blimp issue
Feb 23, 2011

Valeyard posted:

Same, except it's all enforced via Eclipse when you hit save. It also means less chance of false version control diffs

ours are enforced by code reviews, people really get into code reviews here
we reviewed a new guys code a few weeks ago and in the end it was more comments than code


Valeyard posted:

I personally enforce the "don't be a knob" one

time for a pile driver!

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
I really feel like having formatting as part of a code review is an anti-practice, automated tools should be doing that so code reviews can focus on genuinely subjective stuff, rather than the stuff we bike shed into subjectivity.

I mean, formatting is subjective, but much of this particular code base should not be, and rather enforced by an objective tool. (I feel like there's a joke about the reviewer right there.)

oh no blimp issue
Feb 23, 2011

we put formatting rules in our coding standards mainly because if someone doesn't follow them it means they probably haven't read the standards and if that's the case then there are probably some gems hiding in their code somewhere

oh no blimp issue
Feb 23, 2011

the first thing i did was set vs to follow the formatting rules from the standards automatically ofc

Valeyard
Mar 30, 2012


Grimey Drawer

Awia posted:

time for a pile driver!

i need to listen to music to drown out this guys voice

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
i take great pleasure in stripping out linting exemption statements that a certain coworker thinks he's above

Bloody
Mar 3, 2013

our coding standards specify the use of vhdl

so yeh i completely disregard em

Adbot
ADBOT LOVES YOU

ErIog
Jul 11, 2001

:nsacloud:
I'm loving around with a toy software renderer to learn more about graphics programming. I decided to use some code I wrote a few months back that spits out Windows BMP files. Now, I never really tested that code since it was also just dumb toy code, and apparently ErIog-3months thought it would be a great idea to reverse the endianness of a hexstring by calling reverse on it.

I'm trying to learn about vector math and scalar products and poo poo, and the thing that ends up biting me in the rear end is my dumb rear end loving up a simple byte order conversion. It's me. I'm the terrible programmer. :negative:

  • Locked thread