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.

xoggy , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...
@xoggy@programming.dev avatar

apples and oranges is why

__init__ , in Happy World Turtle Day! One of my favourite turtle-releated software development things is that Firefox console will show a little turtle icon on slow requests. Picture also related.

Oh weird I thought that icon was just for highlighting requests to my backend

umbraroze OP ,

Well aren’t the requests to backend by definition slow? Actually TCP protocol is pretty much turtle as opposed to UDP’s hare: slow, but it gets you there.

Edut: was drunk here, was very spitballin’ too

fibojoly , in Happy World Turtle Day! One of my favourite turtle-releated software development things is that Firefox console will show a little turtle icon on slow requests. Picture also related.

If you like turtles and programming, you might enjoy hearing about LOGO.
Back in the day, that was the first programming language I was taught. Years and years before I’d learn C or ASM.
You’d give instructions to a “turtle”, moving it about the screen, drawing as it did so. It was a magical experience for 9yo me.

JackGreenEarth ,

I did something very similar with python’s import turtle

embed_me ,
@embed_me@programming.dev avatar

Thank you! I had been picking my memory for this for so long. We too were taught LOGO in school in the early 2000s. I had forgotten the name, I found kturtle after searching about but couldn’t recall what the original program was called.

fibojoly ,

I was taught it around 1988, most likely on a Thomson MO5 ? Or maybe it was a TO9. It was a while ago :,) I just remember the fascination watching the little pixels color themselves and experimenting with the instructions to see what we could come up with.

BurningTurtle , in Happy World Turtle Day! One of my favourite turtle-releated software development things is that Firefox console will show a little turtle icon on slow requests. Picture also related.
@BurningTurtle@programming.dev avatar

I have bad news

Kojichan , in Happy World Turtle Day! One of my favourite turtle-releated software development things is that Firefox console will show a little turtle icon on slow requests. Picture also related.
@Kojichan@lemmy.world avatar

Turtle day? Then give praise to Tortoise SVN!

Thank you for your service in keeping my early programming safe on someone else’s computer!

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

I like them both. But I only use lisp for fun.

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

Everyone that prefers whitespaces over parentheses is an animal.

LeroyJenkins ,

moo

sparkle ,

People who prefer significant white space over bracket & brace blocks and semicolons are animals

nickwitha_k ,

People are animals.

runeko ,
@runeko@programming.dev avatar

Meow.

lengau ,

Yep! Most of us are even homo sapiens!

lunachocken , in Unit Tests

the autistic overthinking the unit tests

overthinked squared

bitfucker ,

“What if the test fail?”

*Write a test for the test

lunachocken ,

What if the test of the test fails?

Write a test of a test!

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

So I’m going to say what I always say when people complain about semantic whitespace: Your code should be properly indented anyway. If it’s not, it’s a bad code.

I’m not saying semantic whitespace is superior to brackets or parentheses. It’s clearly not. But it’s not terrible either.

As someone who codes in Python pretty much everyday for years, I NEVER see indentation errors. I didn’t see them back when I started either. Code without indentation is impossible to read for me anyway so it makes zero difference whether the whitespace has semantic meaning or not. It will be there either way.

technom ,

Python decided to use a single convention (semantic whitespace) instead of two separate ones for machine decodeable scoping and manual/visual scoping. That’s part of Python’s design principle. The program should behave exactly like what people expect it to (without strenuous reasoning exercises).

But some people treat it as the original sin. Not surprised though. I’ve seen developers and engineers nurture weird irrational hatred towards all sorts of conventions. It’s like a phobia.

Similar views about yaml. It may not be the most elegant - it had to be the superset of JSON, after all. But Yaml is a semi-configuration language while JSON is a pure serialization language. Try writing a kubernetes manifest or a compose file in pure JSON without whitespace alignment or comments (which pure JSON doesn’t support anyway). Let’s see how pleasant you find it.

Crisps ,

This leads to weird bugs when you change indentation and miss a line or reorder lines. The logic changes. Not too bad when you’re on your own, as Python seems to be intended for. Add multiple developers and git merges and it is a recipe for disaster. With end tags at least you just end up with poorly formatted working code.

sajran ,

It’s probably more prone to mistakes like that, true. But in practice I really never witnessed this actually being a problem. Especially with tests and review.

eluvatar ,

The number of times I move code around and can just press a hotkey to fix indentation though. Not possible with Python.

sajran ,

Yeah, that’s definitely a good point. But it’s a minor thing. Adjusting indentation takes 2 keystrokes in vim, I barely notice it.

coloredgrayscale ,

Most IDEs support automatic code formatting, and doing so on save. Or have it as a github hook.

sajran ,

Of course, but when indentation has a syntactic meaning the formatter often won’t be able to fix it.

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

This post made me go try something in clojure again and man I forgot just how fucking good the language is. Everything fits together so nicely.

Thcdenton , (edited ) in Unit Tests

<span style="color:#323232;">Z – Zero
</span><span style="color:#323232;">
</span><span style="color:#323232;">O – One
</span><span style="color:#323232;">
</span><span style="color:#323232;">M – Many (or More complex)
</span><span style="color:#323232;">
</span><span style="color:#323232;">B – Boundary Behaviors
</span><span style="color:#323232;">
</span><span style="color:#323232;">I – Interface definition
</span><span style="color:#323232;">
</span><span style="color:#323232;">E – Exercise Exceptional behavior
</span><span style="color:#323232;">
</span><span style="color:#323232;">S – Simple Scenarios, Simple Solutions
</span>
mexicancartel ,

Use triple backticks instead of one if you are trying to get monospace syntax

Thcdenton ,

Bless. Also please dont peel my face off for that mistake :p

mexicancartel ,

Nah just informed you lol

ProgrammingSocks ,

Sorry, the face scalpers are already on their way. Nothing we can do

Thcdenton ,
BakedGoods , in Unit Tests

Third arm: Every fucking human

Sick and tired of autism gang ™ laying claim to totally normal human behavior just because they have a mental developmental disfigurement.

match ,
@match@pawb.social avatar

too bad, being sick and tired belongs to us now, go feel something else allist 😎

jjjalljs , in Unit Tests

It’s strangely satisfying when the “this will probably never happen” test case finds a problem during development.

I had tests for deleting that were like

  • create item a
  • create item b
  • delete item a via the code under test
  • assert item a is gone
  • assert item b is still there

I thought maybe the whole bit with item b was excessive, but sure enough one day I accidentally fucked something up and deleted all the items, and the test pointed it out before the bad code left my local machine.

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

one of my least favorite things about python is semantic whitespace. no need to comment on yaml.

fuck it, parenthesis all the way.

Scoopta ,
@Scoopta@programming.dev avatar

This sums up how I feel nicely. No issues with parens…but whitespace…fuck that shit

iAvicenna , in Unit Tests
@iAvicenna@lemmy.world avatar

what if someone tries to input a cat to this function?

Mertn33 ,

‘’'5 1 g

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