Spyke
Chrisreply
lemmy.ml

Also Linux: zombies, orphans

24
epyon22reply
sh.itjust.works

This is my favorite. I did php early in my career and for years I would have to Google " equivalent explode/implode" because it was so memorable

17

Even the php docs says it "splits" the string when it describes what it does.

It could be a good name for a function that turns a container or object into a lot of variables, but I don't remember php supporting multiple returned values.

1

I love die()! but PHP has exit(), too, and it does the same thing

27
ndguardianreply
lemmy.studio

Well I didn’t wake up today expecting to watch a video about task manager, but here I am.

6
lemmy.ml

php, the Dark Souls of the programming languages

13
programming.dev

I have never used System.exit() or sys.exit(). What is a use case where you would call these explicitly?

6

For example if you want to set an explicit exit code. Calling python scripts will usually result in an exit code 0 after the script is run. If you want to set a different exit code for example 1 to indicate some error occured you can do that via sys.exit(1).

Same thing applies to other languages of course.

27
epyon22reply
sh.itjust.works

Applications where you aren't using some sort of framework. Usually MVC or other frameworks would handle this or are designed to continuously run.

6

Perl is funnier, as these are valid ways of exiting with an exception:

readFile() or die;

die unless $a > $b;

17

Fun fact: there's a shorter way to throw a NullPointerException:

throw null;

Because throw throws a NPE if the parameter is null

1

The proper way to do this in C is memset((void*)rand(), rand(), SIZE_MAX).

1

You reached the end