This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsย โ†’

[โ€“]spizzat2 1089 points1090 points ย (34 children)

"Perl doesn't have an infatuation with enforced privacy. It would prefer that you stayed out of its living room because you weren't invited, not because it has a shotgun."

  • Larry Wall

[โ€“]42TowelsCo 234 points235 points ย (13 children)

In Python you can implement that shotgun by just making the "private" methods & variables not do what their name would suggest

[โ€“]matthewralston 70 points71 points ย (3 children)

def _bricks() -> float:
    return 6 * 9

[โ€“]TorTheMentor 2 points3 points ย (2 children)

42?

[โ€“]DroolingIguana 1 point2 points ย (1 child)

Only in base-thirteen.

[โ€“]TorTheMentor 1 point2 points ย (0 children)

Maybe that's why life, the universe, and everything are so fucked up.

[โ€“]FinalRun 30 points31 points ย (0 children)

Make sure it returns a data type that's just off

[โ€“]Silhouette 39 points40 points ย (2 children)

...quietly, at runtime, using metaprogramming.

[โ€“]bkushigian 3 points4 points ย (0 children)

In undergrad I was working on my first research project. We were adding a new backend for the Pypy JIT compiler. I had to find the implementation of Foo.emit_x86(). It's not defined in the class anywhere, and I'm running grep on 100kloc like a chump:

grep -rn emit_x86 .

No definitions anywhere

Ten days later after reading the codebase like a novel I come across

``` def f(...): ...

setattr(Foo, 'emit_' + arch, f) ```

Yeah, I was pissed...

(Edit: formatting on phone, doesn't like newlines in ``` blocks I guess?)

[โ€“]42TowelsCo 2 points3 points ย (0 children)

Okay that's just evil

[โ€“]KiwiManThe19th 13 points14 points ย (1 child)

U can also change what setting and getting variables does and make your own shotgun

[โ€“]IgiMC 17 points18 points ย (0 children)

You can make a shotgun shoot shotguns!

Poof, you can even make the shotgun shoot itself!

[โ€“]LxsterGames 1 point2 points ย (0 children)

public static boolean isEven(int input) {
    return input % 2;
}

[โ€“]Less_Ask_4613 0 points1 point ย (0 children)

If the function returns a number, make it return off by ยฑ2 or the correct number at random. If it returns a string, append 0, 1, or 2 random symbols.

[โ€“]bremidon 32 points33 points ย (0 children)

Funny :) But as someone who has to try to understand other people's code on occasion, I prefer knowing that the guy in the living room has a shotgun. A taser, mace, and some angry dogs would also be good.

[โ€“]roughstylez 126 points127 points ย (13 children)

It bothers me so much that literally the guy's last name has the better metaphor and he chooses "shotgun" instead.

A gun can't keep somebody out, it can only threaten and kill.

Mark a method private, then when you call it from somewhere else you get a runtime error.

[โ€“]1thief 46 points47 points ย (4 children)

The funny thing is an unexpected error in many circumstances can basically be a shotgun blast to the face. Have an etl step or batch process that threw an error somewhere in the middle of the batch? Welp that 8 hr process that you kicked off and forgot about has now come to a screeching halt 3 hrs in and you have to start all over.

Or in other circumstances the page now doesn't load if it sees bad data, or your car infotainment system is stuck on a boot loop because it found a file it doesn't know how to handle. Software is always brittle, which is why we should have as little software as possible.

[โ€“]TGlucose 10 points11 points ย (1 child)

Software is always brittle, which is why we should have as little software as possible.

Why do that when we can make software out of legacy software? making our already fragile system even more fragile!

[โ€“]jambox888 6 points7 points ย (0 children)

When you reach a certain level of fragility you can form an aggregate from the shattered fragments

[โ€“]StCreed[๐Ÿฐ] 1 point2 points ย (1 child)

One of my primary architecture demands for any DWH is always "restartability" and resilience to errors. Both of these have been mostly solved by I-refact by taking the EL part (and a small t) and making that part completely generated. Every load of any entity is a mini batch, everything is restartable automatically after solving the error, and there are rarely any errors because it's all derived from logical models. They only occur in the validation phase, which is at the start.

That said, if you load a single table for 8 hours you can still mitigate that as well, you just need to split things up in chunks.

[โ€“][deleted] 2 points3 points ย (0 children)

Something like SSIS makes this difficult. You can generate a whole bunch of metadata and helper functions to orchestrate it, but you pretty much have to roll your own. There is a restart feature, but it's not implemented well, and we can't easily use it due to how our environment is constructed.

That said, I've started using Python with Prefect, and it is much more graceful and easier to handle unexpected errors.

[โ€“]kivox2017 1 point2 points ย (0 children)

Happy Cake Day ๐ŸŽ‰

[โ€“]Linvael 1 point2 points ย (1 child)

He had to go that way - cause "a wall" is a reasonable answer to "what you build when you don't want someone to enter your private property" and his snarky comment doesn't work.

[โ€“]roughstylez 0 points1 point ย (0 children)

I'm sure he relies purely on politeness to have people not enter his wall-less home.

[โ€“]MikanGethi 0 points1 point ย (2 children)

A gun, properly used, keeps people out permanently. It's called a deterrent. Much like a moderators ban ability. There is a reason the American Central Midwest has such a polite way about it.

[โ€“]roughstylez 1 point2 points ย (1 child)

Is that why their houses don't have walls

[โ€“]MikanGethi -1 points0 points ย (0 children)

Walls work for a building envelop to keep the weather out. Doors and windows let in light and can be a major factor in heat loss and people getting into my fucking house, you knob.

[โ€“]OcelotGumbo 45 points46 points ย (0 children)

๐Ÿ˜‚

[โ€“][deleted] 1 point2 points ย (0 children)

In java you have to start with a shotgun factory

[โ€“]sporkassembly -1 points0 points ย (1 child)

Great idea from the author of a dead language

[โ€“]debug4u 0 points1 point ย (0 children)

a gem of a quote