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.
 
  • Post
  • Reply
Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

PhantomOfTheCopier posted:

In the end, they realize assume that `rm -rf` and `git clone repo dirname` are common in git workflows, and they end up with multiple local directories for their local work. Indistinguishable from CVS.
Cloning as part of a "workflow" (I hate that term) is the numero uno sign that someone has missed the point of git branches.

It's you. You are the problem.

Adbot
ADBOT LOVES YOU

vOv
Feb 8, 2014

pokeyman posted:

It's also the only kind of breaking change covered by the term "semantic versioning"?

If I add a side effect of 'rm -rf *' to a function, that's a breaking change but it's not going to cause a compiler error.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I agree with y'all in general but I was specifically thinking of semver.org which says

quote:

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes,
MINOR version when you add functionality in a backwards-compatible manner, and
PATCH version when you make backwards-compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

...

For this system to work, you first need to declare a public API. This may consist of documentation or be enforced by the code itself.

If the library is hilariously poorly documented then maybe all you have to go off as API is the types and functions. If there's something else documented then yeah there's a better defined API that can't as easily be broken in fun and interesting ways.

vOv posted:

If I add a side effect of 'rm -rf *' to a function, that's a breaking change but it's not going to cause a compiler error.

I can see an rear end in a top hat library maintainer arguing otherwise because they didn't document the API, you just have some function and its return type and parameters, so it's not a breaking change. Probably an unreasonable argument unless the function is called deleteLotsOfThings but this is the kind of dumb stuff I had in mind and have been bitten by in (admittedly not great) libraries. Can't generally rely on semver.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Semver.org makes no attempt at defining what an "incompatible API change" is. It certainly doesn't claim that only things statically detectable count.

Coffee Mugshot
Jun 26, 2010

by Lowtax

Gazpacho posted:

Cloning as part of a "workflow" (I hate that term) is the numero uno sign that someone has missed the point of git branches.

It's you. You are the problem.

Eh, this is some weird gatekeeping. Workflow isn't some cargo cult term, it's a reasonable way to describe a set of commands you might do to ensure the sanity of your repositories: mirroring, running custom hooks on precommit, authentication via Gerrit, and more, are part of a workflow. Cloning isn't some mortal evil in git, even in the way that poster described; it's just flat out inefficient and you really only do it as a part of very complicated workflow. For example, the "workflow" for contributing changes to the Go project involves initiating build bots to test your code on different architectures before allowing it through code review. A part of this automated testing involves spinning up VMs somewhere and cloning the repo at a certain revision. This is reasonable and not problematic.

It is true that inefficiently using git probably makes it as useful as CVS in most situations. The reality is that you need to change the way you approach managing your projects to make either of those tools useful. If you like CVS, it's okay.

Coffee Mugshot fucked around with this message at 22:05 on Sep 4, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I'm not saying people can't use the term, or can't use workflows, it's just that I'm not too keen on the whole concept.

It reminds me of the way people use the term "design patterns" to mean precisely those patterns handed down in one book by Gamma et al.

Gazpacho fucked around with this message at 22:22 on Sep 4, 2017

Bongo Bill
Jan 17, 2012

The concept of... a particular way of using a tool?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Coffee Mugshot posted:

Eh, this is some weird gatekeeping. Workflow isn't some cargo cult term, it's a reasonable way to describe a set of commands you might do to ensure the sanity of your repositories: mirroring, running custom hooks on precommit, authentication via Gerrit, and more, are part of a workflow. Cloning isn't some mortal evil in git, even in the way that poster described; it's just flat out inefficient and you really only do it as a part of very complicated workflow. For example, the "workflow" for contributing changes to the Go project involves initiating build bots to test your code on different architectures before allowing it through code review. A part of this automated testing involves spinning up VMs somewhere and cloning the repo at a certain revision. This is reasonable and not problematic.

"If you do X you probably don't understand the tool" isn't gatekeeeping, and a CI setup that happens to not cache clones of the repo between runs is completely unrelated to using local clones as part of your development workflow in place of branches.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Plorkyeran posted:

Semver.org makes no attempt at defining what an “incompatible API change” is. It certainly doesn’t claim that only things statically detectable count.

I suppose. I retract my assertion that the Elm package manager enforces semver. Instead I will claim that it enforces its own rules about versions, that those rules resemble a statically-enforceable variant of semver, and that that is cool.

Coffee Mugshot
Jun 26, 2010

by Lowtax

Plorkyeran posted:

"If you do X you probably don't understand the tool" isn't gatekeeeping

It isn't always, but...

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Coffee Mugshot posted:

It isn't always, but...
People who get it stuck in their heads that they've "mastered" a tech when they're actually abusing it terribly cause a lot of trouble in the industry, and need to be checked. The attitude is the problem, not the skill level.

QuarkJets
Sep 8, 2008

pfft i disagree, i read a book on crypto (titled the Cryptonomicon) and feel totally comfortable rolling my own crypto algorithms

boo_radley
Dec 30, 2005

Politeness costs nothing

QuarkJets posted:

pfft i disagree, i read a book on crypto (titled the Cryptonomicon) and feel totally comfortable rolling my own crypto algorithms

"You see, I start with one of the greatest algorithms of all time, given to us by Julius Caesar, and then I add my own 'special sauce' if you will..."

I tried rolling a basic crypto algo from a textbook and wound up introducing some severe memory leaks in my implementation. The ta refused to help me get past my errors, saying that either people get it or they don't, and try again, but go slower. Those were instructive, humbling years for me. :smith:

Soricidus
Oct 21, 2010
freedom-hating statist shill

QuarkJets posted:

pfft i disagree, i read a book on crypto (titled the Cryptonomicon) and feel totally comfortable rolling my own crypto algorithms

never mind crypto. whether we go by number of vulnerabilities or by greatest real world impact, the thing you should absolutely never ever do is roll your own user input validation

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Soricidus posted:

never mind crypto. whether we go by number of vulnerabilities or by greatest real world impact, the thing you should absolutely never ever do is roll your own user input validation

My favorite is when a system will use different email validation functions for sign up, log in, and password recovery.

Utility companies are the worst at IT.

PhantomOfTheCopier
Aug 13, 2008

Pikabooze!

leper khan posted:

Utility companies are the worst at IT.
From a user's perspective, I've always found communication companies to be the worst. Phone, Internet, cable, satellite... and popular media provider company, and they will be utterly unable to provide even the most basic information without a six-lawyer login/recovery process. Need to know your settings? You'll have to contact the CEO before you're finished.

First runner up: I was applying for a job at Oracle in 2012. I filled out the online form, clicked submit... and got a full page of database stack traces.

TheresaJayne
Jul 1, 2011

PhantomOfTheCopier posted:


First runner up: I was applying for a job at Oracle in 2012. I filled out the online form, clicked submit... and got a full page of database stack traces.

Wasn't that the online Tech Test?

ChickenWing
Jul 22, 2010

:v:

Gazpacho posted:

People who get it stuck in their heads that they've "mastered" a tech when they're actually abusing it terribly cause a lot of trouble in the industry, and need to be checked. The attitude is the problem, not the skill level.

Dunning-Kruger shows up in the most annoying places


I'm almost universally suspicious of anyone who professes any level of competence in anything. Impostor syndrome or bust

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



PhantomOfTheCopier posted:

I was applying for a job at Oracle in 2012.

Horror exists between keyboard and chair

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

PhantomOfTheCopier posted:

From a user's perspective, I've always found communication companies to be the worst. Phone, Internet, cable, satellite... and popular media provider company, and they will be utterly unable to provide even the most basic information without a six-lawyer login/recovery process. Need to know your settings? You'll have to contact the CEO before you're finished.

Comcast decided at some point to only accept online accounts if they used an @comcast.net email address. My @gmail.com address that had worked previously no longer worked, and their helpstaff couldn't see why I was refusing to use the nice @comcast.net address they automatically set up for me.

CPColin
Sep 9, 2003

Big ol' smile.
Found this in a deeply nested block (slightly censored):
code:
    if (address.Address.Line1.ToString().Trim().Length > 0)
    {
        if (!address.Address.Line1.ToString().ToUpper().Trim().Contains(...) &&
            !address.Address.Line1.ToString().ToUpper().Trim().Contains(...) &&
            !address.Address.Line1.ToString().ToUpper().Trim().Contains(...) &&
            !address.Address.Line1.ToString().ToUpper().Trim().Contains(...) &&
            !address.Address.Line1.ToString().ToUpper().Trim().Contains(...) &&
            !address.Address.Line1.ToString().ToUpper().Trim().Contains(...) &&
            !address.Address.Line1.ToString().ToUpper().Trim().Contains(...) &&
            !address.Address.Line1.ToString().ToUpper().Trim().Contains(...) &&
            !address.Address.Line1.ToString().ToUpper().Trim().Contains(...)) //filter out addresses that aren't real
        {
           ...
        }
    }
This is the list of blocks that currently lead to the above checks: try->switch->case->if->foreach->if/else->if(null). The else case of the if(null) check contains the same exact list of conditionals, with the same exact comment, formatted slightly differently.

Edit: Found a block that's indented 60 spaces in (four per level).

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
Convert one of those ToUppers to ToLower and see if anyone notices.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
excuse me, excuse me, why does an address line have to be converted to a string?

Space Kablooey
May 6, 2009


Gazpacho posted:

excuse me, excuse me, why does an address line have to be converted to a string?

:10bux: that each address line is an object that holds the actual address line, and the ToString() is just a convenient way to get all of the fields in a single call.

CPColin
Sep 9, 2003

Big ol' smile.
That was my guess, too, but nope! It's already a string!

MisterZimbu
Mar 13, 2006
I love unnecessary string manipulation/conversions. Seen both of these in production code at current job:

code:
int a = 1;  int b = 2;
if (a.ToString() == b.ToString()) { ... }
code:
object result = datareader.GetValue("column");
return Convert.ToInt32(result.ToString());

Space Kablooey
May 6, 2009


CPColin posted:

That was my guess, too, but nope! It's already a string!

:sigh:

F_Shit_Fitzgerald
Feb 2, 2017



MisterZimbu posted:

I love unnecessary string manipulation/conversions. Seen both of these in production code at current job:

code:
int a = 1;  int b = 2;
if (a.ToString() == b.ToString()) { ... }
code:
object result = datareader.GetValue("column");
return Convert.ToInt32(result.ToString());

Why the hell would you even do this?

PhantomOfTheCopier
Aug 13, 2008

Pikabooze!
Spent an hour Sunday "finding" an undocumented behavior in a library, namely that it only parses multipart data from stdin, and skips that step if initialized from an explicit file handle (even if it happens to be stdin). :eng99:

MisterZimbu
Mar 13, 2006

F_Shit_Fitzgerald posted:

Why the hell would you even do this?

Because 95% of programmers are not bright people.

canis minor
May 4, 2011

MisterZimbu posted:

I love unnecessary string manipulation/conversions. Seen both of these in production code at current job:

code:
int a = 1;  int b = 2;
if (a.ToString() == b.ToString()) { ... }
code:
object result = datareader.GetValue("column");
return Convert.ToInt32(result.ToString());

code:
var a = true; var b = false;
if (String(a) == String(b)){}
:v:

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else
code:
var a = 1; var b =2;  a/^((?!b).)*$/gm ? {}
Muahahahahahaha

F_Shit_Fitzgerald
Feb 2, 2017



MisterZimbu posted:

Because 95% of programmers are not bright people.

And here I've been worried about not being able to make it as a programmer in the "real world" (I'm a hopefully-soon-to-be-graduating CS major). If this is the kind of stuff that gets into production code, I'll probably be fine.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

F_Shit_Fitzgerald posted:

And here I've been worried about not being able to make it as a programmer in the "real world" (I'm a hopefully-soon-to-be-graduating CS major). If this is the kind of stuff that gets into production code, I'll probably be fine.

This poo poo is noteworthy precisely because it's unexpected. Most code is not particularly noteworthy either for shittiness or awesomeness...in a similar sense to how most roads are not notable for being filled with potholes or for being amazing scenic vistas. Write code that gets the job done with a minimum of fuss and you'll be fine.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

If you're self-aware enough to read the coding horrors thread there's a good chance you're not one of The Bad Ones.

PhantomOfTheCopier
Aug 13, 2008

Pikabooze!

F_Shit_Fitzgerald posted:

Why the hell would you even do this?
In the second case, downsampling: I don't care what we store in the database, it's gonna break beyond 32 bits! Woo job security.

QuarkJets
Sep 8, 2008

F_Shit_Fitzgerald posted:

Why the hell would you even do this?

The second one could be someone's unfortunate conception of what a floor operator should do when applied to a string

Thermopyle posted:

If you're self-aware enough to read the coding horrors thread there's a good chance you're not one of The Bad Ones.

I think simply reading this thread has made me a better programmer

But like most physicists, I don't actually have any real CS training

Linear Zoetrope
Nov 28, 2011

A hero must cook
Though in fairness, almost everyone has probably written at least one or two "oh poo poo this needs to be done by lunch" code that's thread worthy (lovely learning code notwithstanding).

PhantomOfTheCopier
Aug 13, 2008

Pikabooze!
Because the industry only cares about "new hotness", it's safe to assume that all production code was written by a novice in the language.

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...

PhantomOfTheCopier posted:

Because the industry only cares about "new hotness", it's safe to assume that all production code was written by a novice in the language.

God, this is the core of every git argument you had too. Have you ever worked with another seasoned professional ever or have you been managing daycares for 20 years?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply