this post was submitted on 27 May 2024
717 points (97.9% liked)

Programmer Humor

19585 readers
823 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 

geteilt von: https://lemmit.online/post/3018791

This is an automated archive made by the Lemmit Bot.

The original was posted on /r/ProgrammerHumor by /u/polytopelover on 2024-05-26 21:23:20+00:00.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 5 months ago* (last edited 5 months ago)

I know I'm late to this but here's my (probably insane?) take. We use Subject-Verb-Object in English right? So, hear me out:

dialog_create_tab(...)
dialog_open_file(...)
dialog_close_file(...)
[–] [email protected] 14 points 5 months ago (1 children)

I just name my variables a, b, c etc. If I have more than 26 variables in any given function, I name them aa, ab, ac, etc.

[–] [email protected] 5 points 5 months ago

you're on a highway to hell.

[–] [email protected] 3 points 5 months ago* (last edited 5 months ago)

in general, adjectives and verbs after nouns because it's more organized/easier to search/filter. as god intended.

[–] [email protected] 12 points 5 months ago* (last edited 5 months ago)

Both:

dialog_error = Dialog_plain.create_modal(error_text)

Variable and class names go from more general to more particular, functions begin with a verb.

Global functions are either "main", or start with one of "debug", "todo", or "shit".

[–] [email protected] 16 points 5 months ago

Powershell has a lint warning for functions that don't follow Verb-Noun format, and verbs here are a list of approved verbs lol

[–] [email protected] 2 points 5 months ago

We just call those Smurf names.

[–] [email protected] 15 points 5 months ago

I personally prefer dialogs.FileDialog.open()

[–] [email protected] 8 points 5 months ago (1 children)

I know the second one is better, but I also know I'm terribly inconsistent with this stuff.

[–] [email protected] 3 points 5 months ago

Been learning to program and I'm refusing to use an lsp for the time being. I'm bad about using abbreviated names when I have to type over and over again(no auto complete). I'm at least using descriptive names for functions I use less than four times.

[–] [email protected] 72 points 5 months ago (2 children)

I'm truly torn with this. The first one seems sensible (action -> target) and easier to read and reason about (especially with long names), while the other one looks more organized, naturally sortable and works great with any autocompletion system.

[–] [email protected] 18 points 5 months ago (1 children)

Not a programmer, but I'd prefer right naming convention because sorting

[–] [email protected] 13 points 5 months ago (1 children)

I am a programmer, and i also like the naming scheme on the right

Especially for things like filenames

[–] [email protected] 9 points 5 months ago* (last edited 5 months ago)

Also a programmer and think method names would be conducive using little endian.

TopicGet()
TopicCreate()
TopicDelete()

Writing this I realize we do this implicitly in some instances.

http.Get() -> httpGet()
http.Post() -> httpPost()
[–] [email protected] 15 points 5 months ago (2 children)

We need a new framework, one that allows universal lookup, and makes life easier

x = _.dialog.file.open
y = _.open.file.dialog
z = _.file.open.dialog
a = _.file.dialog.open

Once done, the formatter simply changes everything to _.open.file.dialog

Let's get this done JS peeps

\s

[–] [email protected] 7 points 5 months ago (1 children)

Insert xkcd about 15th format

[–] [email protected] 8 points 5 months ago

Aahh you can't just make this problem object oriented!

C programmers don't like that.

[–] [email protected] 19 points 5 months ago (3 children)

the people who chose the first one...who hurt you?

[–] [email protected] 4 points 5 months ago
[–] [email protected] 11 points 5 months ago (2 children)

No one, it just makes sense.

You must be one of those "Throw your mother downstairs, the box of tissues" types.

Yoda sounded normal to you I bet.

[–] [email protected] 1 points 5 months ago

reverse polish notation time

[–] [email protected] 10 points 5 months ago (1 children)

It makes sense until you write 30 methods to manipulate the data layer.

[–] [email protected] 1 points 5 months ago

Fuzzy search solves this pretty good

[–] [email protected] 26 points 5 months ago
[–] [email protected] 0 points 5 months ago
[–] [email protected] 3 points 5 months ago

Romance language word order noun_descriptor is the right way.

load more comments
view more: next ›