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
rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
I know of a company (not one I’ve ever worked for) that does most of its testing by diffing its logs against expected output. (I think they do at least run a sed script on the log first to clean it up a little.)

Yes, this does indeed mean that almost all of the tests have to be updated whenever someone adds a new log line.

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

chglcu posted:

Just write your free immediately after you write your malloc, you lazy poo poo. Only being semi-ironic here. Memory management just really isn’t that hard.

The NSA thanks you for your commitment to their future

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:
Personal coding horror when I realize that the project ive spent several weeks on is but a piece of a project ive been trying to puzzle out for 3 years, and that I have to go back to the drawing board on all but the CSS and calculation models :bang:

Curious how many lines of code ive written uselessly. :sigh:

Xarn
Jun 26, 2015
All of it. It's code after all.

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
I'd describe that as "finally made decisive progress on the much overdue next generation system design. Thank you, prototype, your tenure is respected. Now, off to the vivisection and refactoring plant you go."

smackfu
Jun 7, 2004

YanniRotten posted:

While that's probably not what you'd start with on a green field project, yeah that kind of "what happens should happen" is absolutely a good approach if you're working on a legacy system either for a refactor or just maintenance.

If it does something different, a test will fail. You get to decide if that's good or bad but at least no changed behavior will slip through without being interrogated.

Yeah this is how jest snapshot testing works. Record the produced HTML from a render function, check it in, and then when it changes, review that during PR review.

It’s fallen a bit out of favor now.

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:

ynohtna posted:

I'd describe that as "finally made decisive progress on the much overdue next generation system design. Thank you, prototype, your tenure is respected. Now, off to the vivisection and refactoring plant you go."

:hmmyes: This is exactly the technobabble i needed to make it okayish in my head. I'm gonna pay for it though. Bunch of DB models need updating, bunch of code I didn't document or comment well, at least I use descriptive variable names :suicide:

Bongo Bill
Jan 17, 2012

There is no such thing as wasted effort.

Presto
Nov 22, 2002

Keep calm and Harry on.

Bongo Bill posted:

There is no such thing as wasted effort.

*Looks back on a 25 year career*

You sure about that?

QuarkJets
Sep 8, 2008

Bongo Bill posted:

There is no such thing as wasted effort.

bullshit i put in effort while wasted all the time, just ask my scrum master

BigPaddy
Jun 30, 2008

That night we performed the rite and opened the gate.
Halfway through, I went to fix us both a coke float.
By the time I got back, he'd gone insane.
Plus, he'd left the gate open and there was evil everywhere.


None of my effort is ever wasted since I bill for all of it.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

ynohtna posted:

I'd describe that as "finally made decisive progress on the much overdue next generation system design. Thank you, prototype, your tenure is respected. Now, off to the vivisection and refactoring plant you go."

The Konmari method applied to code. You thank the code for teaching you what doesn’t work, and trash it.

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:
Oh look. There I go assuming all data coming into the app will be structured exactly the same as my test data dumped from my personal NAV setup.

Nope. Can't do simple index operations on these dataframes, I have to find the relevant values in the left column of the XLSB-to-dataframe conversions and get their respective index-1 values. :shepicide:

Python code:
class XLSBJobCard(XLSBData):
    """
    Reads in an XLSB-format job card and provides access to the
    appropriate and relevant fields.
    """

    def __init__(self, file_path: str) -> None:
        """
        Reads in the Excel file and extracts necessary data to instance
        attributes.

        :param file_path:
            The path of the file to read and convert.
        :type file_path: str
        """
        # Call the superclass __init__ to initalize `self.xl_data`.
        super().__init__(self, file_path)
        # Extract the data.
        # Start with the `General` sheet.
        gen = self.xl_data["General"]
        self.job_data = dict(
            job_number=gen.loc[1][1],
            contract_amount=gen.loc[65][1],
            product_line=gen.loc[19][1],
            sales_rep_id=get_salesperson(gen.loc[27][1]),
        )
        # Proceed to `Invoicing`.
        inv = self.xl_data["Invoicing"]
        self.job_data.update(
            dict(
                customer_name=inv.loc[7][1],
                branch_id=get_branch(inv.loc[23][1]),
                sales_order=inv.loc[39][1],
            )
        )

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
The documentation is actually pretty impressive in that it looks useful at first glance, only when you read it do you realize it tells you absolutely nothing.

quote:

# Call the superclass __init__ to initalize `self.xl_data`.
super().__init__(self, file_path)


Aside from this. This is just delightfully pointless.

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:
Sometimes I over document since depending on the kind of brain day I'm having, I have legitimately forgotten how to use super(). Better safe than sorry :v:

I'll post the updated class tomorrow for even more theead relevant fun. I use exec() too until I figure out a better way :downsgun:

EDIT: I'm also aware that should the app ever be deployed company wide, outsourced IT would probably want to pore over the code. I try to let my code be self documenting but to an outside audience perhaps unfamiliar with Python, things may not be immediately apparent.

D34THROW fucked around with this message at 22:51 on Mar 14, 2022

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
The problem here is that inline documentation shouldn't be telling me what it does, it should be telling me why it does what it does, if it's not obvious, and what's surprising.

I can see that you're extracting the general sheet, and the invoicing sheet, etc. No need to tell anyone. The class and function docs get a pass, since it's good to have them regardless, although in this case they're not very useful. What's more useful might be comments explaining the typical sheet structure, and why you're pointing to line 65. "This is just how it is, see /path/to/sample/sheet.xls" might be a reasonable answer, since that gives the reader an example of what the actual sheet format is and why all of this stuff lives in wildly different areas. Does the bean throbber have a value that's actually under a label "bean prober" on the sheet? Let me know that there's a known discrepancy! Come at this from the angle of someone who's never actually seen this before, and is reading it for the first time.

Volmarias fucked around with this message at 23:28 on Mar 14, 2022

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
better still, put the 65 in a named variable like "rowIndex_ContractAmount" or something and put all those variables together somewhere obvious. That will mean that if the spreadsheet changes and your code breaks, it is obvious to someone looking at it what needs to be changed.

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:

Volmarias posted:

The problem here is that inline documentation shouldn't be telling me what it does, it should be telling me why it does what it does, if it's not obvious, and what's surprising.

Yeah, see, I'm doing this all by myself so nobody ever taught me this. I'll keep this in mind in the future and revise the existing comment base at some point, thank you :)

Hammerite posted:

better still, put the 65 in a named variable like "rowIndex_ContractAmount" or something and put all those variables together somewhere obvious. That will mean that if the spreadsheet changes and your code breaks, it is obvious to someone looking at it what needs to be changed.

I actually had to move away from this system - while the format of the XLSB files that NAV outputs is predictable, in that it will always contain at a minimum the same information, the exact location of the information can be unpredictable. I have to find it in the dataframe.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I don't mind knowing that xl_data was the only dependency being met by calling super(), because now when I inevitably break this subclass by changing the superclass, I'll more quickly see what broke. Though I'd probably phrase it as # populate xl_data or similar.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

D34THROW posted:

Yeah, see, I'm doing this all by myself so nobody ever taught me this. I'll keep this in mind in the future and revise the existing comment base at some point, thank you :)

I actually had to move away from this system - while the format of the XLSB files that NAV outputs is predictable, in that it will always contain at a minimum the same information, the exact location of the information can be unpredictable. I have to find it in the dataframe.

Understandable, and it's brave of you to post your own self taught horrors. If you want more constructive criticism post in the general programming questions thread (or the python thread or whatever).

Junkiebev
Jan 18, 2002


Feel the progress.

Currently reviewing code I wrote years ago when trying to make a less-fragile watch-based file upload method to SharePoint 2016, running in Compatibility Mode for 2013 , I came across this in a huge commented-out section of code I spent hours trying to debug a half decade ago (I thought it was the compatibility mode screwing me over w/ contexts)
code:
/*
            WAHAHAHAHAHAHAHA gently caress ME THIS ONLY WORKS IN SHAREPOINT ONLINE. I HATE SHAREPOINT!!!
memories <:-]

things are better now

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Junkiebev posted:

SharePoint

Why is this not spoilered with a :nms: tag

Junkiebev
Jan 18, 2002


Feel the progress.

Volmarias posted:

Why is this not spoilered with a :nms: tag

Microsoft was about a half-decade in front of the curve here with all commands being executed, within contexts and how data was capable of being queried within contexts but dear loving lord, was it awkward to use and lovely in terms of DevX and stack traces for quite some time!

Absurd Alhazred
Mar 27, 2010

by Athanatos

Volmarias posted:

Why is this not spoilered with a :nms: tag

It's called "Coding Horrors", not "Coding Hijinks".

Junkiebev
Jan 18, 2002


Feel the progress.

terraform and other such things roughly are as fumbly and awkward to use as sharepoint was in 2013

yea I said it

Kazinsal
Dec 13, 2011

Junkiebev posted:

terraform and other such things roughly are as fumbly and awkward to use as sharepoint was in 2013

yea I said it

Also just as impenetrable as sharepoint to people who aren't already intimately familiar with the technologies.

We sold some bizarre AKS + terraform thing to a customer because the sales engineer knew how to build it, he built it and handed it off to our service desk and our service desk promptly went "what the gently caress dude we do cisco and juniper poo poo as 90% of our business". Nobody understands how this thing works and the sales people are like "that's not our problem".

Junkiebev
Jan 18, 2002


Feel the progress.

Kazinsal posted:

Also just as impenetrable as sharepoint to people who aren't already intimately familiar with the technologies.

We sold some bizarre AKS + terraform thing to a customer because the sales engineer knew how to build it, he built it and handed it off to our service desk and our service desk promptly went "what the gently caress dude we do cisco and juniper poo poo as 90% of our business". Nobody understands how this thing works and the sales people are like "that's not our problem".

what a time to be alive <:-]

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Kazinsal posted:

Also just as impenetrable as sharepoint to people who aren't already intimately familiar with the technologies.

My take is that terraform is a solid infrastructure as code tool but things like the kubernetes provider are just overextending the tool and suck horribly to use. The "everything's a nail" lure is strong.

Junkiebev
Jan 18, 2002


Feel the progress.

New Yorp New Yorp posted:

My take is that terraform is a solid infrastructure as code tool but things like the kubernetes provider are just overextending the tool and suck horribly to use. The "everything's a nail" lure is strong.

It's a good thing for "Cluster Operators/Admins", but wholly opaque to Users and if that's the case, do you start looking at things like Fleet to solve your problems? Chaos Reigns.

Macichne Leainig
Jul 26, 2012

by VG
Is it typical that OSS libraries want you to use Discord for support?

I found an existing issue in GitHub for an issue I was encountering, so I added all my debug info to the thing as another comment (there were already a dozen).

They replied to me and asked me to discuss in Discord? Seems a little weird?

Sir Bobert Fishbone
Jan 16, 2006

Beebort

Protocol7 posted:

Is it typical that OSS libraries want you to use Discord for support?

I found an existing issue in GitHub for an issue I was encountering, so I added all my debug info to the thing as another comment (there were already a dozen).

They replied to me and asked me to discuss in Discord? Seems a little weird?

For better or worse, Discord is the spiritual successor to IRC, which was/is definitely used as a support forum.

Macichne Leainig
Jul 26, 2012

by VG
In my stubbornness to not turn to Discord for tech support of all things I've solved my problem on my own anyway. :colbert:

nielsm
Jun 1, 2009



Protocol7 posted:

Is it typical that OSS libraries want you to use Discord for support?

I found an existing issue in GitHub for an issue I was encountering, so I added all my debug info to the thing as another comment (there were already a dozen).

They replied to me and asked me to discuss in Discord? Seems a little weird?

In the past they'd have asked you to come onto IRC or their mailing list. Some use Slack too.

Volte
Oct 4, 2004

woosh woosh
The only problem is that Discord is terrible for that because the online identity I would for the stuff like filing bug reports is not the same as the online identity I would use for shitposting about video games or whatever, and there's no way short of using the web version in an incognito tab or something of using multiple Discord accounts simultaneously.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


im gonna become a Matrix Chat Guy

e: even though i think it doesn't solve this ^ problem either

Absurd Alhazred
Mar 27, 2010

by Athanatos

Volte posted:

The only problem is that Discord is terrible for that because the online identity I would for the stuff like filing bug reports is not the same as the online identity I would use for shitposting about video games or whatever, and there's no way short of using the web version in an incognito tab or something of using multiple Discord accounts simultaneously.

That was an annoyance for me for many years, they've recently updated it so you can easily switch to (up to 4?) alts. Just click your profile picture on the bottom left. Maybe not on all platforms yet, but there's some coverage here.

Volte
Oct 4, 2004

woosh woosh

Absurd Alhazred posted:

That was an annoyance for me for many years, they've recently updated it so you can easily switch to (up to 4?) alts. Just click your profile picture on the bottom left. Maybe not on all platforms yet, but there's some coverage here.
Nice! My client doesn't have this yet but apparently it's being rolled out slowly. Glad they're finally adding it.

Carbon dioxide
Oct 9, 2012

I've seen open source projects move from gitter to discord recently.

Gitter is open and free, and connected to your github account. But it's very basic as a chat app so yeah I kinda understand the consideration.

Discord recently added a functionality to switch between accounts in the same instance of Discord, so if you decide to use Discord and have a bunch of different accounts for this you can do so now.

Xarn
Jun 26, 2015
Discord (and other similar tools) are very good at redirecting flow of people who don't have an issue, but rather have a question (often because they didn't read the docs properly :v:), and pinning an issue saying "Yo, use Discord if you only have a question" stopped a ton of useless issues getting open.

OTOH it is amazingly lovely for dealing with actual code issues/bugs/etc, and I would question the sanity of anyone trying to use it for that.

Adbot
ADBOT LOVES YOU

Tei
Feb 19, 2011
Probation
Can't post for 3 days!
I have seen JIRA move from good for programmers to bad for programmers.
I have seen Slack move from good for programmers to bad for programmers.
I am having a lot of fun with Discord, mostly with videogame stuff, and sometimes I want to post some code, and don't have a problem with that. Discord is good for programmers, I would hate to see Discord become another tool aiming at ..



this guy.

Discord is not a FAQ or a Wiki, and I would hate that people pour the information there, because is not great at searchability. We would be put again in the early internet era and have to reinvent FAQ's again.

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