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.

uservoid1 , in Hot Potato License

What happen when the repository is getting forked? Goofing with the license is all haha fun till nasty lawyers get into the picture and you get all sort of liability claims

ImplyingImplications ,

Just writing words doesn’t make it legally binding. Anyone who reads this comment owes me $1,000,000 USD.

ogeist ,

Oh shit, what’s your PayPal?

Anyone who reads this comment owes me $1,000,000 USD and a kiss

oessessnex ,

I don’t have 2 mil, how do I get out of this? File for bankruptcy?

pupbiru ,

on a technicality, debts like this are not legally dischargable through bankruptcy

refurbishedrefurbisher ,

Ah, the student loan loophole

Speculater ,
@Speculater@lemmy.world avatar

What’s the opposite of a loophole? That’s what student loans are.

Swedneck ,
@Swedneck@discuss.tchncs.de avatar

a legal dick jammed up your hole

morrowind ,
@morrowind@lemmy.ml avatar

If anyone I owe money to reads this, the debt is reversed.

I’ll take the kiss though

narc0tic_bird ,

I don’t have the money, can I kiss you twice instead?

unexposedhazard ,

Ofcourse its legally binding. If you include a license text with your own code on a platform that doesnt have a clause to license your code under different terms, then that license is legally valid.

But writing the license yourself without making sure that it doesnt allow for any legal loopholes is a bad idea.

bitfucker ,

What the fuck are you talking about? Do you think the license being used is not legally binding? What constitutes as legally binding to you?

MartianSands ,

You declaring a debt isn’t meaningful because you don’t have legal authority to do so.

A licence statement is describing in what way you’re granting permission for something you do have the right to control, which makes it meaningful

nogooduser ,

If you want to fork the repo then you make a commit to the original repo giving yourself rights then you make the fork and you’re golden.

MacNCheezus ,
@MacNCheezus@lemmy.today avatar

I was gonna say, just make a commit changing the license to something else, like MIT?

Faresh ,

I think this is a sort of anti-license, so I think the sort of people who use it reject copyright law.

uservoid1 ,

Sounds like programmers with sovereign citizen approach

marcos ,

What happen when the repository is getting forked?

You get two code bases with different ownership.

That’s a very practical license, that reflects the concept as it is practiced. It’s probably the only one that doesn’t come from an ivory tower.

Wimopy , in Hot Potato License

Ok, I might be misunderstanding here, but since committing changes is allowed for everyone, doesn’t this mean fixing bugs is something you could do? You’d just be stuck with all the other rights as well until someone else makes a change.

unexposedhazard ,

The main dev made the last commit, so they dont have the right to make another commit, until they arent the last person to make a commit anymore (until someone else has made a commit). This makes sure that there are at least 2 people making commits but hopefully much more.

In other words, making a commit revokes your right to do so until someone else makes a commit.

Cethin ,

Am I just bad at reading? It says the right to make changes is granted to everyone one Earth. That would include the last person to make a commit as well, assuming they’re a citizen of Earth. I’m sure what you’re saying is what it’s supposed to say, but it isn’t actually what it says.

mexicancartel ,

All rights reserved by…, except the right to commit to this repository.

Being a legal license it requires much more rigorous and clear statement

stankmut ,

You can’t just ignore the second part of that sentence which gives the right to make commits to all citizens of earth. That would include the person who wrote the last commit.

mexicancartel ,

Thats why I said it needs to be more rigorous. The license probably meant Everyone in the earth except the last person who commited to it

lugal ,

Are you doxing OOP right now??? How do you know they life on earth?

mexicancartel ,

All rights reserved by…, except the right to commit to this repository.

Being a legal license it requires much more rigorous and clear statement

sxan ,
@sxan@midwest.social avatar

That may be what they meant, but that’s not what it says.

zewm ,
@zewm@lemmy.world avatar

The fact that you have 38 upvotes with such an incorrect statement is mind boggling.

This is how politics works I supposed. Write something that sounds plausible but is completely incorrect, inaccurate or completely fabricated and stupid people applaud and follow.

unexposedhazard , (edited )

Its ok to be unable to read, but dont make that other peoples problem.

github.com/ErikMcClure/…/hot-potato-license

This is copied from V2 but same thing:

All rights reserved by the last person to commit a change to this repository,

No explanation needed

except for the right to commit changes to this repository,

Also no explanation needed

which is hereby granted to all inhabitants of the Milky Way Galaxy for the purpose of committing changes to this repository.

This refers to the previous section meaning everyone can make commits to the repository except for the person excluded by that same section

Zeshade ,

They should’ve said “all other inhabitants” to remove the ambiguity.

brisk ,

A right not being reserved does not mean it is waived, only that it is not exclusive. The last person to commit still has the right to commit, as does everyone else.

FiniteBanjo ,

Yeah, the problem with the proposition is that you have all rights and access to the code regardless of who made the last commit, unless the last person to commit revoked the HPL.

MNByChoice ,

The last person cannot revoke the right to make commits.

I have no idea what that implies about the right to change the license.

Swedneck ,
@Swedneck@discuss.tchncs.de avatar

the fact that there are this many people having different interpretations shows that the license would need waaaaaay clearer wording to hold any sort of water.

this is why i hate licenses like WTFPL and its ilk, just saying “do whatever” cannot possibly be legally viable and thus using anything with such a license is impossible by anyone who cares about copyright law (such as say, companies).

If you want your creations to be free for all to use, just slap a fat CC0 on it.

souperk , in Hot Potato License
@souperk@reddthat.com avatar

So that’s the legal equivalent of the guy committing 10k changes the day before leaving the company…

alexdeathway , (edited ) in new preference war just dropped
@alexdeathway@programming.dev avatar

First one are method name, second one are status name.


<span style="color:#323232;">
</span><span style="color:#323232;">def open_file_dialog(self):
</span><span style="color:#323232;">       self.dialog_file_open = True
</span><span style="color:#323232;">       pass
</span><span style="color:#323232;">
</span>

Yoda level preference war.

Croquette ,

I tend to add is to booleans toreally differentiate between a method name and a status.


<span style="color:#323232;">def open_file_dialog(self):
</span><span style="color:#323232;">    self.dialog_file_is_open = True
</span><span style="color:#323232;">    pass
</span>

That way, it’s easier for my dumb brain to spot which is which at a glance.

fourwd ,
@fourwd@programming.dev avatar

In Elixir, we mark statuses by using a question mark at the end of the variable name. Something like this:


<span style="color:#323232;">authorized? = user |> get_something() |> ensure_authorized?()
</span>

I like this better than the is_ prefix

alexdeathway , (edited )
@alexdeathway@programming.dev avatar

does ‘?’ have type definition in elixir or this is generally agreed design pattern?

Faresh ,

If it’s like Lisp, then ? is just part of the symbol and doesn’t have any special syntatic meaning. In different Lisps it’s also convention to end predicate names with a ? or with P (p for predicate)

cytokine0724 ,

jealously weeps in ruby

FMT99 ,

We do this in Ruby all the time, we just prefer methods over variables, usually.


<span style="color:#323232;">def authorized?
</span><span style="color:#323232;">  current_user&.authorized?
</span><span style="color:#323232;">end
</span>
cytokine0724 ,

I’m a principal backend engineer routinely writing Ruby for my day job, so I’m familiar, lol. But you can’t do it for local variables and that just sucks. Definitely a +1 for Elixir.

db0 ,
@db0@lemmy.dbzer0.com avatar

is_dialog_file_open

fite me

TheSlad ,

No fiting. IS always goes at the start of names for booleans you are correct

sus ,

that works for 2 word names eg is_open or is_file, but in this case is_dialog_file_open is structured like a question, while dialog_file_is_open is structured like a statement

red ,

It still works. is_this_thing_some_thingy. Is is just a prefix for if the suffix returns true/false.

Rinox ,

Doesn’t matter, the point is that, if it starts with “is” then you automatically know it’s a boolean.

Yondoza ,

This is the way.

Command statement = an action

Question statement = a status

crispy_kilt ,

Lol mutable state

devfuuu , in new preference war just dropped

Yes.

morrowind , in new preference war just dropped
@morrowind@lemmy.ml avatar

Where’s file_dialogue_open

janAkali ,

To be fair, it’s also missing open_dialog_file, dialog_open_file and most crucially file_open_dialog

xmunk ,

We’re all trying our best to ignore the Americans and you bring up m/d/y… why!

verstra ,

This is the real big-endian way. So your things line-up when you have all of these:


<span style="color:#323232;">file_dialogue_open
</span><span style="color:#323232;">file_dialogue_close
</span><span style="color:#323232;">file_dropdown_open
</span><span style="color:#323232;">file_rename
</span><span style="color:#323232;">directory_remove
</span>

If I were designing a natural language, I’d put adjectives after the nouns, so you start with the important things first:

car big red

instead of

big red car

dohpaz42 ,
@dohpaz42@lemmy.world avatar

Heathen! You must alphabetize all the things!

Like seriously. It makes scanning code much easier.

funkless_eck ,

If I were designing a natural language, I’d put adjectives after the nouns, so you start with the important things first

So - French?

lunarul ,

The thing is that in French, Spanish, etc. it still makes sense if you put the adjective before the noun, even if it might sound weird in some cases. An adjective is an adjective and a noun is a noun.

But English is positional. Where you put a word gives it its function. So “red car” and “car red” mean different things.

deadbeef79000 ,

That’s because they are romance languages. They come from Latin where word order is irrelevant as each “word” has a different form for the specific use.

lunarul ,

Yes, that’s what I said. My native language is a romance language too. And after speaking it her whole life, my wife has trouble getting the grasp of how in English swapping two words completely changes the meaning of what she’s saying (especially when it’s two nouns, like e.g. “parent council”)

DarkDarkHouse ,
@DarkDarkHouse@lemmy.sdf.org avatar

And “red big car” is wrong.

MonkCanatella ,

literally spanish lol

Goodie , in new preference war just dropped

Whatever is more useful goes first.

For example, if this we’re a list of UI text strings, finding all of the dialogue options together might be useful.

If, instead, this is a series of variables already around one dialogue, then finding the open or close bits together would be useful.

Huschke , in Hot Potato License

As a Martian I feel left out.

MartianFox ,

What should I say??

clay_pidgin ,

Share water, brother.

Agent641 ,

I grok

MartianSands ,

Nah, we’re alright. I don’t think anyone has clearly defined the requirements of earth citizenship, we can assume it’s like Ireland who hand it out like candy

Zos_Kia ,
@Zos_Kia@lemmynsfw.com avatar

Them dusters always complaining about something smh

AliasVortex ,

Inners amirte?

MangoKangaroo ,
sparkle ,

No fair, this is uncalled for aggression towards Triangulum Galaxy dwellers!

crispy_kilt , in new preference war just dropped

First of all, it’s spelled dialogue

Sotuanduso ,

Two wars can exist simultaneously.

stufkes ,

OP’s username is in German, so it’s probably half-German-English code

crispy_kilt ,

Germans learn UK English

stufkes ,

Dialogue is UK English. But I just looked it up and apparently ‘dialog’ is a computer term, but should not be used on its own but rather in combination, such as ‘dialog box’.

smeg ,

Americans sadly got there first and defined all the computer terms, that’s why it’s a TV programme but a computer program. I can deal with that though, helps distinguish computer things from real things!

RustyNova , in new preference war just dropped

I don’t know and that’s the problem :(

I keep asking myself what to choose, only for changing it a day after cursing myself to choose a stupid name.

Big endiant is great for intellisense to quickly browse possibilities, since it groups it all in the same place. But that’s also a detriment when you know what you want. You can start typing without the prefix but you’ll have to go through the better suggestions of intellisense first.

Little endiant is the same thing, but in reverse. Great when needed, but bad for browsing.

Although I do have some fix I’m starting to use. But it’s not applicable everywhere, and not in every language.

What I do is use module as prefix. Instead of dialogue_file_open, I create a file_open in the dialogue module, allowing either directly calling file_open, or dialogue::file_open. Using intellisense on the module allow for easy browsing too!

Although in OP’s post I’d rather have file_open_dialogue as it convey the more significant meaning, being to open a file, first. Then “dialogue” is just the flavour on top

oldfart ,

For me it’s simple.

Pseudo-OOP in C which takes dialog* as a forst argument? dialog_open_file

Otherwise - make it human readable

sudo42 ,

Big endiant is great for intellisense to quickly browse possibilities, since it groups it all in the same place.

If only someone would train a program… we could call it a Large Language Model… to knowingly group the names together so we wouldn’t have to choose between human-readable format or dB format.

Guess that will never happen because instead we’re stuck using “AI’s” to inflate stock prices instead. /s

I remember seeing a proposed language that would allow each programmer to choose what name to use for each item. Don’t like ‘open_file’? Choose to see it as ‘file_open’ every time you review the file in the future.

While we battle with each other endlessly, we keep forgetting that the computer doesn’t care.

narc0tic_bird , in Hot Potato License

git commit --amend

git push --force

dudinax ,

but why would you want to?

Artyom , in Hot Potato License

But in a moment of legal discovery, it was found that “GitLab Support Bot” always owns the repository since it creates the merge commit after CI runs.

PlexSheep ,
  1. The bot is not a person and this cannot have the rights
  2. Just don’t use something as fancy as that. CI for a HLP project? Wth are you doing, there aren’t even tests
mynameisigglepiggle ,

You don’t have to be a person to have the rights of a person. That’s what a corporation is.

PlexSheep ,

But the license mentions all of earths citizens. Corpos can’t be citizens, right? Legal terms are confusing.

SkyezOpen ,

Corporations provide services, and service guarantees citizenship.

mynameisigglepiggle ,

Hence how Melania came to be a Citizen

Artyom ,

I would like to know more.

Fish , in new preference war just dropped

Variety is the spice of life.

onlinepersona , in new preference war just dropped

I used to like the action followed by direct object format, until some time ago when trying to find methods or variables related to a specific object. If the action comes first, scanning for the object without an IDE means first reading unnecessary information about the action. That convinced me to opt for $object-$action in situations where it makes sense.

For example in CSS, I often scan for the element, then the action, so $element-$action makes more sense. BEM kinda follows this. When dealing with the DOM in JS, that makes sense too button.fileDialogOpen(), button.fileDialogSend(), … makes more sense when searching.

Of course one has to use it sensibly and where necessary. If you are writing a code that focuses more on actions than objects, putting the action first makes sense.

A similar thing is definition order.


<span style="font-weight:bold;color:#a71d5d;">def </span><span style="font-weight:bold;color:#323232;">main</span><span style="color:#323232;">(args):
</span><span style="color:#323232;">  result </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">do_something(args.input)
</span><span style="color:#323232;">  processed </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">process_result(result)
</span><span style="color:#323232;">  transformed </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">transform_object(processed)
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#323232;">transformed.field
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">def </span><span style="font-weight:bold;color:#323232;">do_something</span><span style="color:#323232;">(some_input):
</span><span style="color:#323232;">  </span><span style="color:#0086b3;">...
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">def </span><span style="font-weight:bold;color:#323232;">process_result</span><span style="color:#323232;">(result):
</span><span style="color:#323232;">  </span><span style="color:#0086b3;">...
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">def </span><span style="font-weight:bold;color:#323232;">transform_object</span><span style="color:#323232;">(obj):
</span><span style="color:#323232;">  </span><span style="color:#0086b3;">...
</span>

I find this much easier to follow than if main were defined last, because main is obviously the most important method and everything else is used by it. A flattened dependency tree is how these definitions make sense to me or how I would read them as newbie to a codebase.

Anti Commercial-AI license

gandalf_der_12te OP ,

I agree with you especially on the definition order of functions. I, too, define main() first.

olafurp , in new preference war just dropped

I prefer everything to be how you would read it as text. So create_file_dialog it is. Honorable mention is to have it namespaced in a class or something which I think is best. file_dialog.create or dialog.create_file or even dialog.file.create

brunofin ,

I agree. I say open door so the function should be named openDoor.

Honestly nowadays none of that matter if you’re using any remotely modern IDE with good indexing and a sensible search, you can start typing however you mind works and it will find it no matter how it’s named.

sudo ,

My method names are the same way but I aggressively sort things into modules etc so it comes out the other way.

But if I was staring down dozens of these methods and no way to organize them, I’d start doing the sorted names just for ease of editing. L

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines