There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

blackstampede , in Recursion

I’d pull the lever to kill one person immediately. Assuming the decision maker at each stage is a different person with different opinions on moral, ethical, religious, and logical questions, then it’s a near certainty that someone is going to pull the lever to kill the people at their stage. If you’re lucky, it’s the very next guy. If you’re not, it’s the guy killing a million people a couple of iterations later. If I’m the first guy, I’ll take the moral hit to save the larger number of people.

rockSlayer ,

Exactly. If you have the means at hand, you have the responsibility to act. At the risk of taking a shitpost way too seriously, if you were in that situation and actively chose to leave the decision to someone else to kill double the people, then you acted unethically.

Zellith ,

Technically the 2nd guy could just let it go through and nobody dies. However if it was to double over and over forever until it stopped, then technically the best option is to just double it forever. Nobody would ever die? If someone decided to end "the game" as it were and kill some people, then that's on them.

andrew ,
@andrew@lemmy.stuart.fun avatar

Pretty sure there’s a base case when you run out of people to tie to the tracks. A naive log2 of 8 billion is only 33 decisions.

FunderPants ,

Yes, say there are 2^33 people for illustrations sake, by 33 decisions you (the first puller) are guaranteed to be dead too. At 32 it’s 50/50, the odds increase as the decisions get made. From a self preservation standpoint the best thing you can do to minimize your personal risk is pull the lever. It also happens to kill the fewest other people.

The only out is nobody pulls the lever.

FarceMultiplier ,
@FarceMultiplier@lemmy.ca avatar

Except, given finite resources, the tracks would run out before having enough space for 8 billion tied-up people.

tetraodon ,

There are 1.3 million km of railroads in the world. At 200km/h, a trolley could travel them in little over 270 days.

Rearrange them in a circle and, providing everyone is cooperating for the sake of philosophy, there’s plenty of time to tie 8 billion people to the rails and run them over.

rockSlayer ,

True, since we’re analyzing a hypothetical ethical question I shouldn’t leave any open assumptions. I made the assumption that at some point, at least one person will have to die, as in I see this trolley problem as a situation where at the end there is no choice and the maximum number of people die.

Deceptichum ,
@Deceptichum@kbin.social avatar

It’s on them, but it affects thousands or millions of others.

As such if you can prevent that, and don’t, it’s also on you too.

Alexstarfire ,

I think that’s bad logic. The choice everyone has is kill or not kill. I can’t be held responsible for someone deciding to pick kill when they have the ability to pick not kill.

Deceptichum ,
@Deceptichum@kbin.social avatar

You’re not responsible for their choice.

You’re responsible for giving them the choice.

Alexstarfire ,

Ok, and what does that actually mean for/to me? It’s not the same as intentionally putting somrone in a situation where both choices knowingly result in death. And even if was in this situation, wouldn’t it ultimately be the fault/responsibility of whoever set up the scenario to being with?

kryptonianCodeMonkey ,

On the one hand, the possibility exists that the buck gets passed forever, especially as the kill count numbers grow substantially making the impermissibility of allowing the deaths grow with it. It’s not likely the any given person would kill one stranger, let alone millions.

On the other hand, in an infinite series, even something with miniscule odds will still eventually inevitably happen, and some psycho will instantly become the most infamous murderer in history, followed immediately by the person that didn’t just kill one person and end the growth before it started.

aseriesoftubes ,

If you’re not, it’s the guy killing a million people a couple of iterations later

I feel like running over all those bodies would make the train come to a stop way before it ran over a million people.

Now I sit back and wait for some morbid soul who is better at math and physics than me to figure out the answer.

Deceptichum ,
@Deceptichum@kbin.social avatar

Now if we assume the victims tied up are frictionless orbs, and the train is also a frictionless orb, and the two of them are travelling in a frictionless void than I reckon we could kill a few more.

LaggyKar ,
@LaggyKar@programming.dev avatar

But then would they die if they don’t slow the train down? The train would necessarily have to impart some energy in order to effect a change in their bodies.

exu ,

Maybe the train is an unstoppable force.

ProvokedGamer ,
@ProvokedGamer@lemmy.ca avatar

Like the GTA train

tetraodon ,

I guess sticking people in the void is a good way to kill them in any case.

Reliant1087 ,

I mean if you’re going fast enough with a pointy train, you could chop up people pretty easy. You just need to make sure that each person is a tire width apart to make sure the wheels don’t lose traction. Assuming a person is roughly half a metre across and a tire is 75cm in diameter, we get 1.25m per person, so a track of 1250km for a million people. Not very long at all.

docAvid ,

I agree with your logic, so far as it goes. However, there are, currently, just over eight billion humans in existence. If my quick, over-tired math is correct, that means only 34 people have to say no, until we run out of people to tie to the tracks. Assuming, at that point, the system collapses and nobody dies, I’d guess 34 people would refuse - might be the better choice.

bstix ,

Would you trust the entirety of human existence to be decided by 34 people? In my experience from watching reality TV, the last one always screws the rest over for their own benefit.

Imagine being the last one. You could singlehandedly wipe out half the global population. This would normally be a bad thing, and it is, but it would also make every surviver twice as rich, solve food scarcity and halve the pollution, perhaps even saving humanity from itself.

If that’s not enough, think about everyone now having double the amount of kittens and half the traffic on the roads.

docAvid ,

I’m not sure reality TV is a good basis, it’s very manipulated and set up for drama. I have a lot more faith in humanity in general than I do in reality TV stars. But you still have a good point, it’s definitely not a sure thing.

Eylrid ,

Society and the economy are not a zero sum game. Killing half the population wouldn’t make the survivors twice as rich. It would send society into chaos which would make the remaining people’s lives far worse.

Default_Defect ,
@Default_Defect@midwest.social avatar

After we run out of people, they start adding cats & dogs.

docAvid ,

Yikes! Pull the lever now!

blackstampede ,

Oh yeah. I was assuming an infinite series (somehow). Also, odds are good that out of 34 people, one of them would misunderstand the rules or be crazy enough to do it anyway for various reasons. I’d probably still do it.

docAvid ,

You weren’t wrong, the meme implies an infinite series, and I might be cheating to apply real-world constraints to an absurd hypothetical.

merc ,

I think this is a good metaphor for how humanity has “dealt” with problems like climate change.

If you make a tough decision, it causes hardship now, but prevents hardship in the future. If you don’t make a tough decision now, someone in the future has to either kill a lot of people, or just pass the buck to the next guy. People justify not making the tough decisions by saying that maybe eventually down the line someone will have an easy decision and there will be nobody on the side path, even though all observable evidence says that the number of people on that path just keeps growing exponentially.

Cethin ,

But what if you’re the tenth person with 1024 on the line? Or the 20th person with 1,048,576? Etc. Is there ever a point (before it’s everyone, in which case risk doesn’t increase) where you stop pulling it?

blackstampede ,

I don’t think so.

Master ,
@Master@lemmy.world avatar

If you are really unlucky the number doubles so many time you end up tied on the tracks.

sabreW4K3 , in Just a dad helping out
@sabreW4K3@lazysoci.al avatar

5000 pages, including e-commerce integration and bespoke search. £500!

Kalkaline ,
@Kalkaline@leminal.space avatar

I don’t know some of those words, probably ought to say it’s 600 dollary-doos

Slovene ,

There isn’t that much money in the universe.

xmunk , in <br>

I’m sorry Timmy but you’re not allowed to have any dessert unless you close your tags like I taught you. Your grandmother was XMLish and you need to carry on our family tradition.

I thought you might do something like this so I got you a backup one from AO3.

traches ,

🤓 ackshually that’s not the HTML spec. Void elements should not have trailing slashes.

developer.mozilla.org/en-US/docs/…/Void_element

sukhmel ,

TIL. Funny thing, though, is that they give an example of how to use <br> and have it with trailing slashes. And then explain that trailing or preceding slash will be ignored, anyway ¯_(ツ)_/¯

azertyfun ,

> Clicks on <br>
> Example is <br />


The actual thing that matters is that the / is ignored so (unlike with XML I believe) you can’t self-close a non-void element by adding a trailing /. But “void elements should not have trailing slashes” is extrapolation on your part; the trailing slash improves readability and is kosher since it doesn’t act as a self-close.

lseif ,

An explanation of this problem can be found on the official W3C HTML validator wiki.

HTML parsers only allow this to stop pages breaking when developers make mistakes; see this Computerphile video. ‘Able to be parsed correctly’ is not the soul criterion for it a syntax being preferred, otherwise we would all leave our <p> elements unclosed.

Yes, it is not “incorrect” to write <br/>, but it is widely considered bad practice. For one, it makes it inconsistent with XML. Linters will often even “correct” this for you.

I personally find the official style (<br>) to be more readable, but this is a matter of personal opinion. Oh, and I used to have the same stance as you, but I also used to think that Python’s whitespace-based syntax was superior…

At the end of the day, regardless of anyone’s opinion, we should come to SOME consensus…and considering that W3C already endorses <br>, we should use this style.

firelizzard ,
@firelizzard@programming.dev avatar

If a spec tells me I should do something that makes my code less readable in my opinion I am going to ignore the spec every time.

lseif ,

“readability” is subjective. much like how there is no objective definition of “clean code”. i am not arguing that either option is more generally “readable”, i am insisting that people use a common standard regardless of your opinion on it. a bad convention is better than no convention. i dont personally like a lot of syntax conventions in languages, whether that be non-4-space indenting, curly braces on a new line, or early-declared variables. but i follow these conventions for the sake of consistency within a codebase or language, simplicity on linter/formatter choice, and not muddling up the diffs for every file.

if you want to use <br/> in a personal codebase, no-one is stopping you. i personally used to override every formatter to use 2-space indenting for example. but know that there is an official best practice, which you are not following. if you work in a shared codebase then PLEASE just follow whatever convention they have decided on, for the sake of everyone’s sanity.

firelizzard ,
@firelizzard@programming.dev avatar

if you work in a shared codebase then PLEASE just follow whatever convention they have decided on, for the sake of everyone’s sanity.

That goes without saying; I’m not a barbarian.

“readability” is subjective. much like how there is no objective definition of “clean code”.

Did you not see the part where I said it’s less readable “in my opinion”?

i am insisting that people use a common standard regardless of your opinion on it.

I can read this one of two ways: either you’re making an assertion about what people are currently doing, or you’re telling me/others what to do. In the first case, you’re wrong. I’ve seen many examples of self-closed <br> tags in the open source projects I’ve contributed to and/or read through. In the second case, IDGAF about your opinion. When I contribute to an existing project I’ll do what they do, but if I’m the lead engineer starting a new project I’ll do what I think is the most readable unless the team overwhelmingly opposes me, ‘standards’ be damned, your opinion be damned.

The spec says self-closing is “unnecessary and has no effect of any kind” and “should be used only with caution”. That does not constitute a specification nor a standard - it’s a recommendation. And I don’t find that compelling. I’m not going to be a prima donna. I’m not going to force my opinions on a project I’m contributing to or a team I’m working with, but if I’m the one setting the standards for a project, I’m going to choose the ones that make the most sense to me.

gravitas_deficiency ,

There’s even one in English that I actively and pointedly flout: punctuation must go inside of the quotes if the quote terminates the sentence

aBundleOfFerrets ,

Yeah, unless it’s a formal setting, reader comprehension comes before all else

traches ,

It’s not extrapolation on my part, the HTML spec is pretty direct about it:

  1. Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/), which on foreign elements marks the start tag as self-closing. On void elements, it does not mark the start tag as self-closing but instead is unnecessary and has no effect of any kind. For such void elements, it should be used only with caution — especially since, if directly preceded by an unquoted attribute value, it becomes part of the attribute value rather than being discarded by the parser.

html.spec.whatwg.org/multipage/syntax.html#start-…

I don’t think it’s an extrapolation to say that code which is “unnecessary and has no effect of any kind” should be omitted.

And yeah, I linked the MDN docs because they’re easier to read but if they disagree then obviously the spec is the correct one.

azertyfun ,

To be annoyingly nitpicky, how is “unnecessary” defined in this context? Whitespace is usually “unnecessary” but I quite like it for readability.

I broadly agree with you though, the W3C spec changes things.

dukk ,

Trailing slash lets you do this though:

For example, in the case of <div/>Some text, browsers interpret this as <div>Some text</div>, treating the slash as ignored and considering the div element to encapsulate the text that follows.

lseif ,

Why would you want that.

KairuByte ,
@KairuByte@lemmy.dbzer0.com avatar

This is terrible.

You should never rely on a browser interpreting a non standard use in a specific way. It can change at any moment, and wouldn’t be reliably reversed because it’s inherently non standard.

NaoPb ,

It’s XHTML, isn’t it?

lseif ,

found the react dev

xmunk ,

Take that back!

(I’m actually a DB specialist but I have done a lot of full stack work in different portions of my career)

calcopiritus ,

It’s actually more confusing/less correct to close bodyless elements in HTML. Since HTML treats “/>” the same way as “>” which could lead to a “/>” tag not actually being closed, if it is used on a non-selfclosing tag.

mindbleach , in OneDrive deleted my files!

Big thanks to Microsoft for their efforts to advertise Linux.

JackbyDev OP ,

There was this mini golden era around 2019 or so where it really seemed like Windows was getting their shit together. I think a lot of places use Macs for development now and Windows was trying to get that market share back. Stuff like the new console and WSL were amazing.

Zagorath ,
@Zagorath@aussie.zone avatar

Yeah I swear from when Nadella took over until like 2 years ago, Microsoft really seemed to be on the right route. They were becoming the “good guys” of big tech companies.

WSL, actually being really good stewards of GitHub, Chredge actually (at first) being way better for users than Chrome, the amazing revitalisation of some of their oldest and most loved game franchises like Age of Empires and Flight Simulator.

But then recently we’ve had Microsoft adding shitty AI to everything, from Edge to Windows. We’ve had that AoE revitalisation tarnshined by showing off a really shitty official mobile game with all the makings of a typical pay 2 win time sink. The Age of Mythology remake has obvious AI art featured in it despite them insisting no AI was used (though thankfully the actual gameplay is as good as hoped for, at least). We’ve got large layoffs and other shitty corporate bullshit towards workers.

Revan343 ,

WSL sounds really cool, but I was already gone by then. How well does it work/compare to bash?

TheGalacticVoid ,

It isn’t bash, it’s Linux that’s well-embedded with the rest of Windows. You can get most Linux stuff working reasonably well, and you can even get a working GUI of some distros.

Revan343 ,

Just saying ‘bash’ was ineloquent of me; could I easily open a terminal that feels like a Linux/UNIX shell?

Though from your comment, I expect the answer is “Yes.”

JackbyDev OP ,

Yes, even Cygwin and Git for Windows feel like a Linux shell despite being less like Linux than WSL.

RecluseRamble ,

It works well - for a Windows subsystem. It is well-integrated but also separate which can be annoying sometimes.

For example, you might code in Python in VSC against a WSL folder but make a script to eventually run in Windows. You need to install and update Python twice then - a Linux and a Windows version (obvious, but can be annoying).

WSL is also really slow, especially for filesystem heavy stuff. You know how on Linux programs sometimes run faster via Wine/Proton than on Windows itself? Yeah, this is the other way around.

JackbyDev OP ,

Honestly the type of stuff I do works good enough with MSYS through Git for Windows (which is a basic bash environment). There are three ways to get bash on windows,

  1. MSYS/Git for Windows: Lightest choice. Least capable. Very easy to set up.
  2. Cygwin: Only works with Linux stuff made for Cygwin. Pretty useful all in all but really weird to set up. Babun was my favorite way to use it.
  3. WSL: The most Linux like but at the steep cost of being very disconnected from the Windows side. It feels more like a VM than a shell sometimes.

I preferred the simplicity of Git for Windows and Cygwin. Now, if I still had Windows on a work computer I probably would’ve deep dove into WSL and figured it out more.

nutcase2690 ,

Most useful things i found in wsl that made it not feel like a vm is knowing the wslpath command, and the fact that it can execute any exe such as explorer.exe (which works for even wsl directories). those two things let you use sed/grep/awk on files in windows and execute any exe on stuff in linux.

Ephera ,

We tried to onboard two devs into our project earlier this year with it and it was not good.

We spent 4 days trying to get it to work, and had all kinds of problems from VPN not working, DNS not working and compile times being 20x slower (as I later learned, you’re not supposed to use your Windows NTFS partition inside of it). Partially, this has to do with our corporate environment being annoying, but it simply being different from a normal Linux in this regard is still annoying.

On the fifth day, we set up a Linux VM with them and they were ready to work in an hour.

RecluseRamble ,

It was earlier, when they released Windows 7 and it was the first (and only) release, management gave development a largely free hand and they could bring down some technical debt.

But apparently that didn’t work out for Microsoft and now we get one dystopian news after another.

fsxylo ,

Once I get some extra money to fuck around with my computers, everything is becoming foss. Fuck Microsoft.

lugal , in How I date

Rust and chill

herrcaptain ,

Rust and Bust.

magic_lobster_party , in Stop comparing programming languages

Just accept it, all languages suck

asyncrosaurus ,

“There are only two kinds of languages: the ones people complain about and the ones nobody uses.”

magic_lobster_party ,

That’s why Haskell is so loved. Nobody uses it.

wreel ,
@wreel@lemmy.sdf.org avatar

I love how after a decade pandoc is still Haskell’s “killer app”. smh

BatmanAoD ,

I mean to be fair, that’s a pretty useful tool.

psycho_driver ,

Fortran would like a word.

sparkle ,

Not Scala and Rust. They are my beloved, my sweethearts, my knights in shining armor.

Ok Rust does have some major issues, but not Scala…

BatmanAoD ,

Oof, slow compile times to target, of all things, the JVM? Implicit methods? Some(null)? Function call syntax where the difference between a tuple argument and a sequence of non-tuple arguments can be determined by whether or not there’s a space before the parentheses?

There are definitely some major issues with Scala.

magic_lobster_party ,

They also thought the best thing to take from Python is that version 3 should not be backwards compatible with version 2

sparkle ,

I think that’s good when the objective is to improve the language. One key thing that holds many languages back is that they’re stuck with historical baggage, and it can be pretty difficult to replace/remove “outdated” stuff without breaking everything.

I do not want to be stuck using Python 2, or Scala 2 (although there exist people who use Scala 2 instead of Scala 3).

magic_lobster_party ,

Where I’m working we’re heavily using Spark, which kind of blocks us from upgrading. There seem to be ways to get Scala 3 to work, but we also have old terribly written baggage code no one understands. Just upgrading between 2.12 to 2.13 was a journey.

sparkle , (edited )

I agree that the slow compile times are pretty bad (maybe even deal-breakingly for large projects). I think it’s kind of necessary for a language with as powerful of a syntax as Scala though, it’s pretty absurd how expressive you can get. Maybe if it didn’t target the JVM, it’d be able to achieve way faster compile times – I don’t really see a point of even targeting JVM other than for library access (not to say that that isn’t a huge benefit), especially when it has relatively poor compatibility with other JVM languages and it’s nearly impossible to use for Android (don’t try this at home).

Even more so, I think that null handling isn’t nice – I wish it were more similar to Kotlin’s. One thing I’m really confused as to why Scala didn’t go all-in on is Either/Result like in Rust. Types like that exist, but Scala seems to mostly just encourages you to use exceptions for error propogation/handling rather than returning a Monad.

A more minor grudge I have is just the high-level primitive types in general – it’s pretty annoying not being able to specify unsigned integers or certain byte-width types by default, but if it really is an issue than it can be worked around. Also things like mutable pointers/references – I don’t actually know if you can do those in Scala… I’ve had many situations where it’d be useful to have such a thing. But that’s mostly because I was probably using Scala for things it’s not as cut out to do.

With the tuple arguments point, I get it but I haven’t found it much of an issue. I do wish it wasn’t that way and it consistently distinguished between a tuple and an argument list though, either that or make functions take arguments without tuples like in other functional languages or CLI languages (but that’d probably screw a lot of stuff up and make compile times even LONGER). I saw someone on r/ProgrammingLanguages a while back express how their language used commas/delimiters without any brackets to express an argument list.

I think an actually “perfect” language to me would basically just be Rust but with a bunch of the features that Scala adds – of course the significant functional aspect that Scala has (and the clearly superior lambda syntax), but also the significantly more powerful traits and OOP/OOP-like polymorphism. Scala is the only language that I can say I don’t feel anxious liberally using inheritance in, in fact I use inheritance in it constantly and I enjoy it. Scala’s “enum”/variant inheritance pattern is like Rust enums, but on crack. Obviously, Rust would never get inheritance, but I’ve found myself in multiple situations where I’m thinking “damn, it’s annoying that I have to treat <X trait> and <Y trait> as almost completely serparate”. It would especially be nice in certain situations with const generic traits that are basically variants of each other.

Plus, I’ve always personally liked function overloading and default arguments and variadics/variadic generics and stuff, but the Rust community generally seems to be against the former 2. I just really hate there being a hundred functions, all a sea of underscores and adjectives, that are basically the same thing but take different numbers of arguments or slightly different arguments.

The custom operators are a double-edged sword, I love them and always use them, but at the same time it can be unclear as to what they do without digging into documentation. I guess Haskell has a similar problem though, but I don’t think Scala allows you to specify operator precedence like Haskell does and it just relies on the first character’s precedence. I would still want them though.

How it goes now, though, is I use Scala 3 for project design/prototyping, scripting, and less performance-sensitive projects, and Rust for pretty much everything else (and anything involving graphics or web). Scala has good linear algebra tooling, but honestly I’ll usually use C++ or Python for that most of the time because they have better tooling (and possibly better performance). I would say R too, but matplotlib has completely replaced it for literally everything regarding math for me.

BatmanAoD ,

Sounds like we’re actually in agreement about most of this.

I’m okay with languages limiting their “expressive” power in order to provide stronger correctness guarantees or just limit how “weird” code looks; but this is largely because I’ve worked on many projects where someone had written a heap of difficult-to-understand code, and I doubt such limitations would be appealing if I were working strictly on my own.

I also don’t really see the appeal of Java-style inheritance, but to be honest I didn’t use Scala for long enough to know whether or not I agree that Scala does inheritance “right”.

It does make sense that Rust provides mutability in some cases where Scala doesn’t. Rust’s superpower, enabled by the borrow checker, is effectively “safe mutability.” I hope other, simpler languages build on this invention.

lseif ,

not zig

Hotzilla ,

Yes, just flip binary directly to the cpu

DacoTaco ,
@DacoTaco@lemmy.world avatar

Writing raw byte binaries ftw!

(Jokes aside, all programming languages have their good and bad things. Some just have more bad than good. And i say that as a C/C#/typescript/asm developer :p

tempest , in Happens all the time

I do enjoy the rust compiler error messages. They are nicely formatted

Shameless ,

I’m trying to learn rust and so far this has definitely made it so much more accessible.

Not to mention their super useful “rustlings” training which has these nice little challenges to get you used to language and syntax

30p87 ,

Yeah, but to observe such error messages you’ll basically need to wait for 20 mins for it to compile.

PlexSheep ,

No? The steps are compiled once and afterwards your project just gets compiled. Besides, rust-analyzer exists.

PoolloverNathan , in Programming as a hobby means I can do whatever I want!

A MONAD IS A MONOID IN THE CATEGORY OF ENDOFUNCTORS

Thelie OP ,

Wow you sound so smart!

sik0fewl , in You wouldn’t get it

Upon reflection, I do get the joke now.

rimjob_rainer ,

This one gets it

wise_pancake , in We'll refactor this next year anyways

This is so true.

Even if you do design clean modular code and document it, you’re getting a question a year from now about how it works, or someone just duct tapes on top of it.

BakedCatboy ,

I’ve even experienced this in the 3D printing community, where I design a highly parametric model and put lots of effort into making all of the major dimensions and qualities parameterized and dynamically adjustable, with lots of bounds checking and value clamping, with all the parameters at the top of my scad file with comments explaining what each variable does.

And then someone comes along to remix my model, says I don’t want to install openscad, and just scales the entire output stl to change the dimensions, squashing all the features of the model in the process (instead of having the size gracefully adjust with all the features moving around to account), and leaving anybody starting from their work with a hard to remix mesh with no parameters.

amirul ,

Really? The opposite is true for me.

Working with devs who aren’t familiar with design patterns, introducing design patterns by simply implementing them (in a new project) allows it easier for the devs to follow the implementation as examples, even though they aren’t necessarily familiar with the design pattern concepts.

At least they can observe the patterns and replicate the patterns elsewhere.

adespoton ,

At least they can observe the patterns….

Bless your heart.

mokus ,

In my experience, this often doesn’t happen. So many developers are either inexperienced or cowboys, and there’s nothing inherently wrong with either. But at places where projects are small and numerous, teams often end up with nothing but a combination of the two.

As one of our office’s engineering “fixers”, I’ve taken over maintenance of several such projects. They usually have shattered remnants of code taken from other projects, open source libraries, internal libraries, stack overflow, and so on. Whole source files copied into the project, modified in ways that introduce impressive new failure cases while failing to add new functionality, and used in ways that completely ignore the features natively implemented in that code while those same features are bodged in as barely-working piles of if statements, balanced on a knife’s edge to avoid triggering the failure modes added by the project’s modifications of the copied code. I’m usually able to purge 20-30k lines of code from such projects in the first month, simultaneously closing multiple outstanding issues the PM had been led to believe were intractable.

That probably sounds like arrogance and/or shitting on everybody else’s work but it’s just reality at many workplaces due to a pace driven by unreasonable expectations from management. I just happen to be the person here that ends up sifting through the wreckage when a project reaches the inevitable osteoporosis phase, because of a natural disposition for reverse engineering. It would be great to escape for this and other reasons, as far as I can tell, most places aren’t that different.

FizzyOrange ,

This can work for junior devs who aren’t stuck in their ways. Unfortunately there are too many “senior” devs who are happy making crap. It’s hard to fight them constantly to do things properly (e.g. write actual commit messages rather than just “Fix ”) so using tools like linters where possible is definitely a big improvement.

FMT99 ,

Or business decides all specs and design decisions that were made last quarter were actually garbage and yes we do want to be able to manually override every step of the carefully designed state machine. We’d like to be able to manually change all calculated sales data, but also the data needs to remain in a consistent state at all times. Oh and while you’re there, we decided the commission calculations will use a different system from now on. We expect it to be online by the end of the week, thanks.

SolarMech ,

The closest I got to this kind of job., is the closest I got to running away. I’m much happier elsewhere now.

JayDee ,

The ‘document’ part also seems to be insanely hit-or-miss from my amateur experience. Self-documenting design/code is… well, not. Auto-generated documentation is also usually just as bad IMO. Producing good documentation really is a skill in and of itself.

Also small personal opinion: If your abstraction layers or algorithms are based off a technical concept, you should probably attribute that concept and provide links to further research, to eliminate future ambiguity or in case your reader lacks that background. Future you will probably thank you and anyone like me who immediately gets lost in jargon soup will also be thankful.

Miaou , in Has this ever happened to you?

If your customer has write access to a production system, I’m not sure they’re the most irresponsible here.

EvolvedTurtle ,

I mean Personally if I was a client I would want access to the system/service I was paying for directly

But I guess I’m alsotech literate enough to know not to fuck with it

13 , in Rebase Supremacy
@13@kbin.run avatar

Imagine rewring history

wise_pancake ,

History is written by the squashers.

magic_lobster_party ,

Imagine working with a tangled spaghetti of history

victorz ,

You don’t? Just follow the merges.

muad_dibber ,
@muad_dibber@lemmygrad.ml avatar

You try to pull someone’s changes, but whoops, they used rebase and rewrote history! Delete the branch and start over.

thesmokingman ,

No you just do a rebase to bring it in. Assuming you’re making atomic commits you shouldn’t have a ton of merge conflicts. If you have to do this a lot, your branch scope is really bad and the problem isn’t in how you’re using got, it’s in how you’re slicing work.

muad_dibber ,
@muad_dibber@lemmygrad.ml avatar

If you try to pull someone else’s rebased / history rewritten branch, your git will tell you that it’s rejected. You can completely avoid this by merging instead of rewriting history.

Atemu ,
@Atemu@lemmy.ml avatar

…or you simply rebase the subset of commits of your branch onto the rewritten branch. That’s like 10 simple button presses in magit.

expr ,

2 things:

  1. You don’t pull rebased work pretty much ever. Rebasing is for feature branches by a single author to craft a high quality history, generally. It’s much, much better than littering your branch with merge commits from upstream.
  2. If for some reason you do need to pull rebased changes, you simply do git pull --rebase. Works without issue.
perviouslyiner , in Daylight saving creator left the chat....
maniclucky ,
JackGreenEarth , in What’s in a name?

What about Alice, Bob, and Eve?

rockSlayer ,

They’re currently shaking hands and too busy to let us borrow their names

whereBeWaldo ,

Even if they weren’t you wouldn’t be able to contact them directly, nowadays they have s man in the middle who handles their communications. badum tss

Zangoose ,

You’ll have to settle for naming your child after one of their public keys, but then your child will only be able to talk to them.

canpolat , in git commit -m "minor fixes" +26858 -69429
@canpolat@programming.dev avatar
idunnololz ,
@idunnololz@lemmy.world avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines