IndustryStandard,

Some intern writing spaghetti which a company is going to be based off

yamanii,
@yamanii@lemmy.world avatar

Creative_assembly.webp

AeonFelis,

After so many years in this company, lots of the unmaintainable code I have to deal with is either my own fault, or the fault of someone I used to work with but and now they left and I’m the one who has to apologize for their code.

If I move to a different company, 100% of the unmaintainable code I’ll have to deal with there will be someone else’s fault.

owen,

In the industry we call this responsibility load balancing

SpaceCowboy,
@SpaceCowboy@lemmy.ca avatar

And managers don’t like it when you explain that the code is a unmanageable mess because they put a deadline on every goddamn thing and never pay off technical debt.

At a new place you can honestly say “the code is kinda a mess, it needs a bunch of work” and the manager can just assume it was because the last guy didn’t know what he was doing and not because of their own shitty management.

soggy_kitty,

To be honest, sometimes shit code is 100% the Devs fault. I’ve witnessed it happen with other teams in my own company.

Let’s just say it was unavoidable to report it

SpaceCowboy,
@SpaceCowboy@lemmy.ca avatar

Management could implement a code review process to avoid this.

Software development isn’t a brand new field anymore. Most problems are well known and therefore have well known solutions. So it pretty much always comes down to management not wanting to implement the known solutions to the problems because its easier to blame the devs.

SolarMech,

Learning to deal with “unmaintanable” codebases is a pretty good skill. It taught me good documentation and refactoring manners. It’s only a problem for you if management does not accept that their velocity has gone down as a result of tech debt pilling up.

Code should scream it’s intent (business-wise) so as to be self-documenting as much as possible As much as possible is not 100%, so add comments when needed. Comments should be assumed to be relevant when written, at best. Git comment should be linked to your work ticket so that we can figure out why the hell you would do that, when looking at the code file itself. I swear some people seem to think we only read them in PRs (we don’t). Overall concepts used everyday, if they need to be reexplained, should probably be written down (at least today’s version). Tests are documentation. Often the only up to date one?

Smoogs,

I’ve known influential assholes who poopood commentating as if it’s only a superficial job.

I hate those people.

floofloof,

Can we arrange some swaps? I’m not getting paid enough and neither are you.

jubilationtcornpone,

Project A: Has 6 different implementations of the same complex business logic.

Project B: Has one implementation of the complex business logic… But it’s ALL in one function with 17 arguments and 1288 lines of code.

“The toast always lands the buttered side down.”

QuazarOmega,

Project B is just called neural network

CanadaPlus,

Actually, I bet you could implement that in less. You should be able to legibly get several weights in one line.

QuazarOmega,

You have my interest! (Mainly because I don’t know the first thing about implementing neutral networks)

CanadaPlus, (edited )

At the simplest, it takes in a vector of floating-point numbers, multiplies them with other similar vectors (the “weights”), sums each one, applies a RELU* the the result, and then uses those values as a vector for another layer with it’s own weights (or gives output). The magic is in the weights.

This operation is a simple matrix-by-vector product followed by pairwise RELU, if you know what that means.

In Haskell, something like:

layer layerInput layerWeights = map relu $ map sum $ map (zipWith (*) layerInput) layerWeights

foldl layer modelInput modelWeights

Where modelWeights is [[[Float]]], and so layer has type [Float] -> [[Float]] -> [Float].

  • RELU: if i>0 then i else 0. It could also be another nonlinear function, but RELU is obviously fast and works about as well as anything else. There’s interesting theoretical work on certain really weird functions, though.

Less simple, it might have a set pattern of zero weights which can be ignored, allowing fast implementation with a bunch of smaller vectors, or have pairwise multiplication steps, like in the Transformer. Aaand that’s about it, all the rest is stuff that was figured out by trail and error like encoding, and the math behind how to train the weights. Now you know.

Assuming you use hex values for 32-bit weights, you could write a line with 4 no problem:

wgt35 = [0x1234FCAB, 0x1234FCAB, 0x1234FCAB, 0x1234FCAB];

And, you can sometimes get away with half-precision floats.

QuazarOmega,

That’s cool, though honestly I haven’t fully understood, but that’s probably because I don’t know Haskell, that line looked like complete gibberish to me lol. At least I think I got the gist of things on a high level, I’m always curious to understand but never dare to dive deep (holds self from making deep learning joke). Much appriciated btw!

CanadaPlus,

Yeah, maybe somebody can translate for you. I considered using something else, but it was already long and I didn’t feel like writing out multiple loops.

No worries. It’s neat how much such a comparatively simple concept can do, with enough data to work from. Circa-2010 I thought it would never work, lol.

prof,
@prof@infosec.pub avatar

Recently switched jobs from maintaining a 15 year old Windows Forms .NET Framework legacy codebase.

At the new job we stick to Clean Architecture, use unit and integration tests, have a code generation tool, actually make nice use of generics and use dependency injection. Also agile processes, automatic build tools, whatever. The difference is night and day and I’m so glad my ex boss fired me because I told him he’s an asshole and his codebase is shit.

LeafOnTheWind,

My first job out of college I have been able to see a steady improvement in the codebase. A little while ago I had to go back to an old tag and was horrified with what it used to be and impressed how much it improved.

marcos,

As long as their salary keeps increasing, I’d say go for it!

alcoholicorn,

Meanwhile, Dev of company C driving off a bridge, getting laid off after modernizing the 90s era codebase.

Venator,

Sometimes a fresh pair of eyes on a code base can reveal some opportunities for big improvements in maintainability 😜

MajorHavoc,

Ahahhahhahha. Ha…ha. Ahem.

Sorry. The idea that any of the opportunities for improvement at my last “job A” code base might need “revealed” struck me as really funny.

Venator,

Sometimes there’s an opportunity to delete it and start again 😜

tkk13909,

Looks like we found the hr employee! Get 'im Bois!

Venator,

Lol, nah I’m a developer.

gregorum, (edited )

Sometimes it takes a new dev coming in for management to give the greenlight for a major overhaul. It’s shitty, but it’s true.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #