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
CPColin
Sep 9, 2003

Big ol' smile.

Messyass posted:

Also, there's no reason that deploying a new version of the code should be harder than changing the database, but you probably know that already.

I got my first look at the release document a little while ago. It's a giant Excel spreadsheet full of vague step-by-step instructions that people keep adding to. I was told that I need to put any necessary SQL statements in there, so whoever does the release can run them before deploying the code.

There's no automated build, no automated testing, no automated deployment. I want to try to chip away at this stuff and the very first thing I proposed was shot down. Good times! At least, 2.5 months in, I'm finally actually writing some code, even if I can't write any unit tests for it because, of course, the current architecture doesn't support such a thing.

Oh by the way, they do use NUnit here and there. I's so they have a way to call specific functionality in the rest of the code. Say, if they want to run a piece of code to fix some data in Production, they'll write it, slap a [TestMethod] attribute on it, and use NUnit to execute it. They do have to remember to point the database code at Production, of course, but, fortunately, all the credentials for all environments are right there in the configuration files!

Also, I miss @Nullable annotations from Java. Why couldn't C# have added Nullable<> for reference types?

Adbot
ADBOT LOVES YOU

Munkeymon
Aug 14, 2003

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



CPColin posted:

Also, I miss @Nullable annotations from Java. Why couldn't C# have added Nullable<> for reference types?

Because that'd be redundant?

Alan G
Dec 27, 2003

Munkeymon posted:

Because that'd be redundant?

Are not being added in 8.x?
Proposal

CPColin
Sep 9, 2003

Big ol' smile.
I meant why couldn't reference types in C# imply non-null and have the question mark make them nullable. (I know why not; it would've broken the poo poo out of existing code.)

Edit: Opting in and out of the above proposal could be a serviceable solution to the problem.

CPColin fucked around with this message at 16:48 on Oct 13, 2017

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Bruegels Fuckbooks posted:

The application can then just communicate with the DAL by passing command name and args, and the database can decide what actual SQL to execute should be.

:whoptc:

Are you serious? How do you deploy and version control this clown car of a development strategy? How do you even pass arguments and receive results in your code if you have to assume the database code can change at any time?

I mean, I'm all for DBAs being able to write decent queries but this seems...unideal.

AskYourself
May 23, 2005
Donut is for Homer as Asking yourself is to ...

CPColin posted:

I meant why couldn't reference types in C# imply non-null and have the question mark make them nullable. (I know why not; it would've broken the poo poo out of existing code.)

Edit: Opting in and out of the above proposal could be a serviceable solution to the problem.

If you must know ;)
Null References: The Billion Dollar Mistake

What C# 7.0 bring is C# 7 Non-nullable reference types. IMHO it can be used real well to protect your own coder against your code base and to design more robust and standardised API/Framework/Librairies.

Munkeymon
Aug 14, 2003

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



Alan G posted:

Are not being added in 8.x?
Proposal

Oh, sure, that makes more sense than a Nullable<object>

B-Nasty
May 25, 2005

Sagacity posted:

:whoptc:

Are you serious? How do you deploy and version control this clown car of a development strategy? How do you even pass arguments and receive results in your code if you have to assume the database code can change at any time?

I mean, I'm all for DBAs being able to write decent queries but this seems...unideal.

I've seen something similar in some legacy code I worked in before. The stored procedure would get a serialized object (in SQL Server's XML datatype) and a whole mess of logic would do the CRUD to the correct table. It looked like some DBA's idea of what an ORM should be. "Look guys! All you have to do is implement a GetObjectTypeID property on your object, and my awesome pseudo-ORM will handle all the SQL for you!"

Luckily, that guy was fired (or committed suicide due to his crippling insanity) before this innovative technique could spread through the codebase. It was only actually used for a few objects, and unsurprisingly, they were slow and painful to debug.

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost
That kind of logic is the kind of thing I’d expect from people that read through SQL for Smarties. I mean seriously, a goddamn btree implementation using SQL? Aren’t we supposed to let SQL query planners do these optimization’s behind the scenes?

spiritual bypass
Feb 19, 2008

Grimey Drawer
SQL For Smarties is a really cool book by a certified crazy person

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Sagacity posted:

:whoptc:

Are you serious? How do you deploy and version control this clown car of a development strategy? How do you even pass arguments and receive results in your code if you have to assume the database code can change at any time?

I mean, I'm all for DBAs being able to write decent queries but this seems...unideal.

Welcome to enterprise software. It makes perfect sense when you have customers that run 15 year old versions of the database and refuse to upgrade but still want to use the new client and have it be compatible with the old system.

redleader
Aug 18, 2005

Engage according to operational parameters

CPColin posted:

Say, if they want to run a piece of code to fix some data in Production, they'll write it, slap a [TestMethod] attribute on it, and use NUnit to execute it.

Jesus Christ. I assume you're looking for a new job?

raminasi
Jan 25, 2005

a last drink with no ice

AskYourself posted:

What C# 7.0 bring is C# 7 Non-nullable reference types. IMHO it can be used real well to protect your own coder against your code base and to design more robust and standardised API/Framework/Librairies.

I have some bad news for you about which features actually ended up in C# 7.

redleader posted:

Jesus Christ. I assume you're looking for a new job?

That "technique" is absurd enough that it almost loops back around to being impressive!

Rubellavator
Aug 16, 2007

I know I've definitely seen some db columns at work that contain sql queries, but I tried not to think about what they were used for.

Che Delilas
Nov 23, 2009
FREE TIBET WEED

Rubellavator posted:

I know I've definitely seen some db columns at work that contain sql queries, but I tried not to think about what they were used for.

Probably used to query a different database with code snippets in it that can be used to generate fully-formed desktop applications.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Bruegels Fuckbooks posted:

Welcome to enterprise software. It makes perfect sense when you have customers that run 15 year old versions of the database and refuse to upgrade but still want to use the new client and have it be compatible with the old system.
Wow. I work in an enterprise as well, but I guess it's the right kind of enterprise. We've managed to slowly replace various huge Oracle systems (literally everything was written in PL/SQL) with Java services. It's been a huge hassle but we can now add new features much easier than before and everything is way more reliable.

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost

Bruegels Fuckbooks posted:

Welcome to enterprise software. It makes perfect sense when you have customers that run 15 year old versions of the database and refuse to upgrade but still want to use the new client and have it be compatible with the old system.
The real issue isn’t that customers want this as much as the companies providing the software will bend over oftentimes to accommodate their needs. With my enterprise software job, we are literally firing problematic customers that cost us more to service than they are paying for in engineering and account management time (more sustainable with a larger company, but we’re tiny). If your system usage causes more than a couple system alerts, you’re on probation, much longer than a month and our reps will direct you to competitors that fit your style of vendor relationships better like IBM, Salesforce, etc. that will gladly charge you 10x even us for a fraction of the features we have.

Maintaining old stuff is a horrifically expensive line of business and the question is who gets stuck with the bill, and being in that line of business is low rent, low margins, and low rewards.

pigdog
Apr 23, 2004

by Smythe

Bruegels Fuckbooks posted:

It doesn't even really have to be multiple stored procs, you can soft code your DB logic by having, say, one stored proc that's a command name and arguments, and then having a table in the database with the command name, and the corresponding SQL that should be executed (don't sperg about this, you probably shouldn't do exactly this in your architecture but i'm using this example as a pedogogical tool.) The application can then just communicate with the DAL by passing command name and args, and the database can decide what actual SQL to execute should be.

The advantages of doing that are:

a) Fulltime dba can make modifications without changing source/building/deploying to customer sites
b) Easier to make your client backwards compatible because the older versions of the queries will be in db, not in client, so if a newer client connects to old database, since it communicates in commands, it knows to just do the old queries
c) Makes testing your DAL easier because you can just stub out these commands during integration tests by changing a single table rather than having to make a more complicated test fixture.
d) You can do fine-grained access and security controls and deny the user that the application uses all rights other than what's required to run the commands. That's a pretty legit usecase.


The disadvantaes of doing that are
a) The fulltime DBA's have other things to do than to coddle your application
b) The fulltime DBA's don't give a poo poo about your application and begrudgingly work on it as last priority
c) It's a pain in the rear end for everyone to develop, deploy and debug

spiritual bypass
Feb 19, 2008

Grimey Drawer

Rubellavator posted:

I know I've definitely seen some db columns at work that contain sql queries, but I tried not to think about what they were used for.

Magento2 generates SQL dynamically, then caches the generated SQL in the database for later retrieval. It's like PyPy for your database.

Munkeymon
Aug 14, 2003

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



rt4 posted:

Magento2 generates SQL dynamically, then caches the generated SQL in the database for later retrieval. It's like PyPy for your database.

That just makes me wonder what's wrong with Magento that it's slower to generate SQL than it is to cache it in a database.

I guess if cache retrieval is in the form of sending the DB exec (select query from QueryCache where QueryHash = whatever it could be faster?

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Our lovely Restaurant: My Experience With Agile, Bureaucracy and Unnecessary Complication

https://steemit.com/food/@walden/our-lovely-restaurant-my-experience-with-agile-bureaucracy-and-unnecessary-complication

This story is like a fine book. Every time I return to it i appreciate it on a new level.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

lifg posted:

Our lovely Restaurant: My Experience With Agile, Bureaucracy and Unnecessary Complication

https://steemit.com/food/@walden/our-lovely-restaurant-my-experience-with-agile-bureaucracy-and-unnecessary-complication

This story is like a fine book. Every time I return to it i appreciate it on a new level.
Ironically, restaurant menus in the United States are explicitly designed around quick iteration for the customer, not the best end result. Salads are served first even though they're best used as a digestive aid because it gets food into the customer's stomach faster.

spiritual bypass
Feb 19, 2008

Grimey Drawer

Munkeymon posted:

That just makes me wonder what's wrong with Magento

Just the tip of the iceberg, really

MisterZimbu
Mar 13, 2006

rt4 posted:

Just the tip of the iceberg, really

Is this a salad pun

xiw
Sep 25, 2011

i wake up at night
night action madness nightmares
maybe i am scum

Cpig Haiku contest 2020 winner

Munkeymon posted:

That just makes me wonder what's wrong with Magento that it's slower to generate SQL than it is to cache it in a database.

https://github.com/magento/magento2/blob/develop/app/code/Magento/Catalog/Model/Product.php#L386 is my favorite example of Magento madness.

Mage1 used a static service locator for dependencies, Mage2 read somewhere that that's Bad and dependency injection is Good, so converted over to this kind of constructor because Good is better than Bad.

I appreciate the @SuppressWarnings(PHPMD.ExcessiveParameterList) in particular

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
So I have a function that queries a database, and the whole thing needs to run quickly. It already has unit tests. But I want to make sure that future maintainers understand performance requirements.

Is it appropriate to add a performance unit test? Like “benchmark sub, fail if > 10 seconds”? One problem is that unit tests run on a shared server, against a shared database.

Normally whenever I fix a bug I add a unit test. I don’t know what the right thing to do when the bug is “slow performance.”

Pollyanna
Mar 5, 2005

Milk's on them.


I feel bad for the new engineers trying to work with our stuff. They’re trying to bring our core module into their project to use it, and they can’t actually do that - they have to extract it from the Docker images or something. Our poo poo is over engineered and over architected and I won’t miss it when I leave.

Since I’m leaving and my work is blocked by our team lead (the only person who can explain what we’re looking at) loving off to a conference for the rest of the day, I’m going home early.

Pollyanna fucked around with this message at 20:03 on Oct 18, 2017

KoRMaK
Jul 31, 2012



lifg posted:

So I have a function that queries a database, and the whole thing needs to run quickly. It already has unit tests. But I want to make sure that future maintainers understand performance requirements.

Is it appropriate to add a performance unit test? Like “benchmark sub, fail if > 10 seconds”? One problem is that unit tests run on a shared server, against a shared database.

Normally whenever I fix a bug I add a unit test. I don’t know what the right thing to do when the bug is “slow performance.”

I'd be cool with that. If it fails then it highlights the issue.

Murrah
Mar 22, 2015

Ive been asked to make a barcode label with some text that prints from the browser and is supposed to work appropriately on a bunch of different kinds of 1inch label printers

I cant quite express actually how frustrating this has been

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

lifg posted:

So I have a function that queries a database, and the whole thing needs to run quickly. It already has unit tests. But I want to make sure that future maintainers understand performance requirements.

Is it appropriate to add a performance unit test? Like “benchmark sub, fail if > 10 seconds”? One problem is that unit tests run on a shared server, against a shared database.

Normally whenever I fix a bug I add a unit test. I don’t know what the right thing to do when the bug is “slow performance.”

Maybe add some comments to the header as well, explaining why performance matters. A mystery test will be wiped out when no one can answer "why 10s matters", but a big "// DO NOT CHANGE THIS FUNCTION EVER! PERFORMANCE MATTERS! IT MUST RUN IN UNDER 10 SECONDS OR A WARP PORTAL WILL OPEN SWALLOWING THE EARTH!

Munkeymon
Aug 14, 2003

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



Pollyanna posted:

I feel bad for the new engineers trying to work with our stuff. They’re trying to bring our core module into their project to use it, and they can’t actually do that - they have to extract it from the Docker images or something. Our poo poo is over engineered and over architected and I won’t miss it when I leave.

Since I’m leaving and my work is blocked by our team lead (the only person who can explain what we’re looking at) loving off to a conference for the rest of the day, I’m going home early.

Is this finally a confirmation of :yotj:?

The Fool
Oct 16, 2003


Murrah posted:

Ive been asked to make a barcode label with some text that prints from the browser and is supposed to work appropriately on a bunch of different kinds of 1inch label printers

I cant quite express actually how frustrating this has been

The most sane way to do this is by generating a pdf, then the user prints the pdf.

I say most sane, but it is still quite rage inducing.

E: when I did this I needed to generate label sheets and I generated the pdf of the sheet in python on the server using reportlab

The Fool fucked around with this message at 20:56 on Oct 18, 2017

Pollyanna
Mar 5, 2005

Milk's on them.


Munkeymon posted:

Is this finally a confirmation of :yotj:?

Imminent - the other company decided to pass, so I’ll be doing one last review of my current offer and signing tonight. :yotj:

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Pollyanna posted:

Imminent - the other company decided to pass, so I’ll be doing one last review of my current offer and signing tonight. :yotj:

I expect an epic quitting story.

Pollyanna
Mar 5, 2005

Milk's on them.


Skandranon posted:

I expect an epic quitting story.

I'm really tempted, but I don't like to burn bridges. I have considered passing out a bunch of DSA fliers and pamphlets before I leave though :haw:

CPColin
Sep 9, 2003

Big ol' smile.
I still wish that, when I went back to pick up my stuff, after my last company gave me a "Technology Leadership" award a week before laying me off because they "didn't need an architect," I had taken the time to super-glue the award to my desk.

pigdog
Apr 23, 2004

by Smythe

lifg posted:

So I have a function that queries a database, and the whole thing needs to run quickly. It already has unit tests. But I want to make sure that future maintainers understand performance requirements.

Is it appropriate to add a performance unit test? Like “benchmark sub, fail if > 10 seconds”? One problem is that unit tests run on a shared server, against a shared database.

Normally whenever I fix a bug I add a unit test. I don’t know what the right thing to do when the bug is “slow performance.”

That's not a unit test. Testing performance is fine and good, but since it has dependencies on that shared server and doesn't need to be run as often as regression tests, I probably wouldn't put something like this it in the default integration test suite either.

There's nothing prohibiting you from commenting the code or writing whatever docs or messages to ensure the future maintainers understand these performance requirements. Whatever it takes.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

CPColin posted:

I still wish that, when I went back to pick up my stuff, after my last company gave me a "Technology Leadership" award a week before laying me off because they "didn't need an architect," I had taken the time to super-glue the award to my desk.

Superglue is too brittle. Use 5 minute epoxy.

redleader
Aug 18, 2005

Engage according to operational parameters

Murrah posted:

Ive been asked to make a barcode label with some text that prints from the browser and is supposed to work appropriately on a bunch of different kinds of 1inch label printers

I cant quite express actually how frustrating this has been

We only have to target one type of label printer.

We just went out and bought one and put it right next to the guy working on the labels.

Adbot
ADBOT LOVES YOU

Seat Safety Switch
May 27, 2008

MY RELIGION IS THE SMALL BLOCK V8 AND COMMANDMENTS ONE THROUGH TEN ARE NEVER LIFT.

Pillbug

Pollyanna posted:

I'm really tempted, but I don't like to burn bridges. I have considered passing out a bunch of DSA fliers and pamphlets before I leave though :haw:

Buy a cake and have them write "I Quit" on it. Send an email summoning everyone to the break room for free cake.

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