Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Instead of whinging you could just write your own script, if for some reason you're not okay with running the same code as tons of other people?


sort by: page size:

At work I regularly have to support 500+ line scripts written by random developers, I 'n hate them.

Personally I would prefer a script that made all variables private and removed setters, but I suppose that would be more useful than funny.

Why not just have a script and just say run this?

It's easy to write a script that does one thing in exactly one way, but it's hard to build something that everyone can use.

Someone should write a script which takes any code and mucks the AST.

Sure - I'll be happy to show you the scores of scripts I have written to do every tasks like switch pipewire audio sinks, wrapper to youtube-dl, generate/copy rsa token, convert/combine images to pdf etc that were written in the sliver of time afforded to me after I'm done family and kids. Those scripts in no way represent the code I get paid to write in my job but if you find that to be an an issue, then you have found the flaw in your method.

You mean you want to run arbitrary code on a user's computer behind their back? Sounds terrible.

Forming the committee does not need script validation.


This script feels like this is something that:

- should be in its own application with its own rules engine so you dont accidentally whack a bunch of userames

- I would have done in the past and cringe when people ask me to update it.


Ah yes now I see - I said 'there's no way to find the current script' which isn't true. So that's probably what the others in this thread are also objecting against :) I guess what I meant was 'there's no same way' or 'look at how hard it is to do this tiny thingy which anyone with a programming background would find so basic, they wouldn't even consider it might not exist'. So yeah, I did screw up on making my point there.

Does scripting get the job done for you? You're at the point where everyone has different objectives and methods, so it's no surprise that you have to make your own solution.

Yes, that would be a good idea. But if you ever run scripts you didn’t write, there’s the potential people didn’t do this, and you have the potential for hard to discover bugs. The language should be designed such that bugs are difficult to encounter, this is an instance where it wasn’t.

Yes. Not because you're doing anything wrong yourself, but because the cost to the user of allowing third party scripts is too high to tolerate nowadays.

Why, though? Why is it better than asking users to download and run the exact same script?

Sure, you can go without it. But you'll need to write a lot of annoying scripts manually.

So, why not use F-Script or work to make it what you need?

Actually you could. Just limit the max. number of instructions that are allowed to be executed in order for a script to be valid.

Fair point, but I still prefer the solution of just putting in a new line myself. Then I don't have to worry about maintaining such a script, setting up the git hook, etc.

Then it’s less scriptable. Many of us would prefer a CLI-based solution for that reason

If the potential user doesn't understand what the script does, they have no business running it in the first place, so it's a moot point.
next

Legal | privacy