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.

bolexforsoup , (edited ) in They never let me

spoilerasdfasfasfasfas

sudo ,

Client: “How much is this disaster recovery plan going to cost me?”

Me: “A hell of a lot less than when you don’t have (valid, tested) backups and need them”

mindbleach , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...

Load-bearing whitespace is a mistake.

Oisteink , in They never let me

It’s probably as your “backup plan” is faulty but they don’t want to embarrass you.

CrypticCoffee ,

Lemmy.world. why does that not surprise me?

andrew ,
@andrew@lemmy.stuart.fun avatar

LMAO we really have Lemmy cliques?

Mikufan ,

Yes. .world is full of idiots basically the garbage dump for people that don’t fit into the .ml ones.

ProgrammingSocks ,

…Self-dunk?

CrypticCoffee ,

Lol nah. But Lemmy world has a somewhat rude intolerant moderation policy and often users mirror that. There is good people on there, of course, but a reasonable percentage of folk who’d be at home on reddit and Xitter.

Alexstarfire ,

You new here?

Zekas ,

It’s bound to happen.

Korne127 ,
@Korne127@lemmy.world avatar

Not really, besides ml who are usually tankies (ml stands for Marxist Leninist and the mods delete anything against China, etc.)

ripcord ,
@ripcord@lemmy.world avatar

This is completely unnecessary.

bjoern_tantau , in They never let me
@bjoern_tantau@swg-empire.de avatar

In time they will learn.

_NetNomad , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...
@_NetNomad@kbin.run avatar

you'll pry my END command from my cold, dead hands...

chonglibloodsport , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...

Haskell does both! Most people prefer to use whitespace when writing Haskell but it’s not required. Braces and semicolons are preferred if you’re going to be generating Haskell code.

lorty , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...
@lorty@lemmy.ml avatar

No, YAML can fuck right off. I hate that this shit format is used for cloud stuff.

0x0 ,

YAML is the Excel of data formats due to the Norway Problem

RecluseRamble ,

OK, that’s excessively “convenient” for booleans. But I don’t get the passionate YAML hate, seems like a simple enough language for config. Didn’t have the pleasure (“pleasure”?) to work with it though, so what’s why else is it shitty?

CaptPretentious ,

Do a search for ‘why yaml is bad’ and you’ll get a lot of stories.

Constant passing problems, especially when the yaml gets very large and complex. After I implemented a new feature I was pulled into a call with 12-15 people demanding to know why it didn’t work. The new feature worked fine, The guys yaml had the wrong amount of white space and so it didn’t parse.

lorty ,
@lorty@lemmy.ml avatar

White space in the wrong place? Fails Wrong amount of tabs? Fail

Working in a big configuration file that has a lot of nesting? Good luck.

Best part is that most of these things don’t throw errors or anything, it just doesn’t work and you are left scratching your head as to why your deploy only fails in the production environment.

magic_lobster_party ,

A property can have the wrong indentation and it would still be a syntactically correct yaml. It’s hard to distinguish whether a line is wrongly indented or not. Copy and paste a line and mistakenly use the wrong indentation, and the entire production breaks.

In json it’s much harder to do similar mistakes.

UnfortunateShort ,

I think TOML found a pleasant compromise there

firelizzard ,
@firelizzard@programming.dev avatar

It’s hard to distinguish whether a line is wrongly indented or not.

That’s very much not my experience. I use YAML regularly and while I’ve had copy paste indentation errors when I look at the offending line it’s always obvious to me how to fix the indentation. The only indentation thing that’s ever given me trouble is embedding YAML as a string within a file that uses tabs.

quantenzitrone ,

since yaml is just a superset of json, you can easily avoid all problems like this

yaml is like a less strict json for me

AdamBomb ,

Since it’s a superset of JSON, couldn’t you just use the JSON notation if you hate the semantic whitespace?

flappy , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...

I hate YAML so much

aniki , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...

<span style="color:#323232;">I love python:
</span><span style="color:#323232;">     Fight me IRL.
</span>
Tamkish ,

fine i will take the bait: thats 5 spaces

Barbarian ,
@Barbarian@sh.itjust.works avatar

As long as the next line also has 5 spaces, that’s fine. Python only complains about inconsistency, not the exact number of spaces/tabs.

Buddahriffic ,

Make, on the other hand… Ugh.

smeg ,

What, you don’t like tabs and spaces being syntactically different?

Buddahriffic ,

(Sarcasm/deadpan detected but I’ll respond anyways).

Not when they are visibly the same and the spaces have no other meaning in that context.

Not to mention tabs being annoying in general because of how badly it works to adjust the distance of tab stops. That doesn’t really affect this particular case, but it’s why I generally use spaces instead of tabs.

Most of the annoyance is from vim recognizing that spaces are an error in makefile recipes but still using them unless I copy paste a tab in, including when I hit enter on a line that is using a tab already. It matches the indentation but uses spaces instead of tabs. I’m sure there’s a way to adjust vim config to fix this, but I have yet to acquire the esoteric knowledge required to do so.

ugo ,

If by vim you mean neovim


<span style="color:#323232;">vim.api.nvim_create_autocmd(“fileType”, {
</span><span style="color:#323232;">    group = file_type_group,
</span><span style="color:#323232;">    pattern = “make”,
</span><span style="color:#323232;">    command = “setlocal ts=4 sts=4 sw=4 noexpandtab”,
</span><span style="color:#323232;">})
</span>

Slap this in your config, done

Buddahriffic ,

Nah, it’s just vim in my work env. But thanks anyways, I appreciate that you tried!

FiskFisk33 , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...
xmunk , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...

Who hates s-expressions? They’re elegant as fuck…

Python, on the other hand, deserves all the hate it gets for making whitespace syntactically significant - I even prefer Go’s hamfisted go fmt approach to a forced syntax to python’s bullshit.

eestileib , (edited )

I dgaf about indices starting at 0 or 1, I can deal with case-insensitivity, but syntactically significant whitespace drives me up the wall.

Diplomjodler3 ,

What’s so hard to understand about it? It’s how you should format your code anyway. Only it’s enforced.

Lysergid ,

No it’s how Python wants you to format. Many times I want to separate two logical sections in one function and can’t coz Python go crazy

Diplomjodler3 ,

Just put them in separate functions. If you have too many levels of indent, your code is convoluted. Sticking to the line length limit sometimes forces you to write more lines than you’d like to. But it makes everything so much more readable that it’s 100% worth the trade off

xmunk ,

What if the logic is more readable in one function?

I use whitespace to make my code more legible, python forces more whitespace consistency but it comes at the cost of limiting the legibility.

AdamBomb ,

Are you saying that you want to separate your two logical sections by having different levels of indentation and that’s what makes Python go crazy?

umfk ,

Can you give a concrete example? Because I don’t understand what you mean.

magic_lobster_party ,

It’s quite often I have to second guess whether the code is correctly intended or not. Is this line supposed to be part of this if block or should I remove that extra indentation? It’s not always entirely obvious. Extra troublesome during refactors.

In other languages it’s always obvious when a line is incorrectly indented.

slice1 ,

Yeah, it is a completely nonsensical thing to complain about. I hate to go around matching curly brackets like some braindead nematode. If you use more than two levels you should rewrite the code in most cases… just use advanced indexing and vectorization (by pythonic ;p). Or you can loop around like a freaking peasent in your inefficient garbage code that nobody can read because it is cluttered with comments explaining basic stuff. There is a reason Python is popular… and it is not because no one can read it. Same goes for dynamic typing - it is a blessing for most tasks. I do not want to explain to the machine what every temporary variables means…

vrighter ,

sometimes, a script needs to be edited in a plain text editor, without having access to an lsp or any other dev tools.

pkill OP ,

I agree but still you can oftentimes expect that the average person’s initial reaction to be somehow reluctant… until they understand it. it’s like those foods and drinks that you might need to try a couple times before you start enjoying them.

xmunk ,

Oh, definitely, they can look bizarre and confusing before you understand them.

muntedcrocodile ,
@muntedcrocodile@lemm.ee avatar

I hate em cos regardless of language auto formatter takes care of everything. So now im typing extra characters and fucking shit up and confusing myself when moving code between scopes.

Theharpyeagle ,

You take that back, python is my homie!

In all seriousness, I freely admit that I’m biased towards python because it was my first language and remains my favorite. I use an IDE for anything but the simplest scripts, so I’ve very rarely had any issues with spacing.

best_username_ever ,

In 20 years of using Python, I never had one issue with the indentation. Use spaces all the time, use PyCharm, and that’s it.

Whitespace is statistically insignificant in Python.

Klnsfw , in void *

For God sake, be consistent. It’s either int*, int**, void* or int *, int **, void *

xia , in void *

There are no ints in the void, only… death…

Olgratin_Magmatoe , in void *

Void star labs/Zach Freedman moment

rhpp , in void *

Actually void* just points to anything, with no regard to the type of that thing. Pointing to the void is more accurately described by NULL pointer.

tunetardis ,

Fair, though I guess my interpretation was that void* is kind of like a black hole in that anything can fall into it in an unsettling way that loses information about what it was?

Traister101 ,

It erases the type of what your pointing at. All you have is a memory location, in contrast to int* which is a memory location of an int

frezik ,

“Allow me to combine the worst feature of strong typing with the worst feature of dynamic typing”.

marcos ,

But we need dynamic types!

…hold my beer…

riodoro1 ,

Result: one of the most if not the most popular programming languages.

neo ,

So, when I want the void to point back at me, do I have to loop over void* or over NULL?
And how many iterations?

programmer_belch ,
@programmer_belch@lemmy.dbzer0.com avatar

For the void to point back at you just dereference the NULL pointer

sus ,

as many iterations as it takes


<span style="color:#323232;">void* x = &x;
</span><span style="color:#323232;">char* ptr = (char*)&x;
</span><span style="color:#323232;">
</span><span style="color:#323232;">while (1) {
</span><span style="color:#323232;">    printf("%dn", (unsigned int)*ptr);
</span><span style="color:#323232;">    ptr--;
</span><span style="color:#323232;">}
</span>
mox ,

In other words, void refers to the typing of the pointer, not a particular value that might be present at its target.

(But I can see how someone might find it confusing.)

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