Programming

brettcannon,
@brettcannon@fosstodon.org avatar

With the talks now up, I can publish my new blog post on my proposal for a struct-like syntax for : https://snarky.ca/proposing-a-struct-syntax/

Thanks to @glyph , @hynek , and Bruce Eckel who accidentally had a hand in making this blog post happen without realizing it. 😁

brettcannon,
@brettcannon@fosstodon.org avatar

@glyph @treyhunner @jacob I'll also say that Eric Snow has pushed for this to be an expression, which would let you inline the creation in a class statement so you could immediately subclass to add methods.

glyph,
@glyph@mastodon.social avatar

@brettcannon @treyhunner @jacob I would be okay with “no inheritance” as long as we could have methods, but also it wouldn’t be terrible to say “class foo(struct (a, b, c)): …”. Not sure I see an advantage beyond “struct foo(a, b, c): …” yet, but either spelling is equally good as far as my own use is concerned

cazabon,
Byronrabbit,
@Byronrabbit@mastodon.thirring.org avatar

@cazabon Love how buns earn their names. Rousseau was reddish (roux) and drank lots of water and peed a lot when he first came to us (ruisseau = stream).
You must go through cartloads of greens with those gals!

Byronrabbit,
@Byronrabbit@mastodon.thirring.org avatar

@cazabon Not a fan of Jean-Jacques, but the name suited for other reasons.
A lot of variety in your names. Our first was Muggins (cribbage fans), then Blossom (rescued in springtime), Whitby (tiny & white), Richmond (rescued by cop in that city), Byron (liked chewing old poetry books), Duffle (who knows??), and Rousseau. Will commit to another bun when it feels right.

reiver,
@reiver@mastodon.social avatar

"BASIC used to be on every computer a child touched -- but today there's no easy way for kids to get hooked on programming."

"Why Johnny can't code" (2006)
https://www.salon.com/2006/09/14/basic_2/

opendna,

@fedops @reiver That sounds like a "You Problem" because yes, it's easy, and they're awesome.

It helps that we don't follow the Boomer practice of demanding rock star 10x ninjas with CS degrees (under 25 years old, of course), who are willing to commute to our office in San Francisco for $15/hr after a six-month unpaid internship.

If you fix your search filters and you'll get good applicants. If you don't, that's on you.

cerebrate,

@reiver @nyrath

I always thought that that article was distinctly unfair to Python; firing up the IDLE shell gives one basically the same REPL-with-ad-hoc-bits-of-program experience that BASIC gave me and my generation on my old 8-bit micros.

Hell, it even has turtle graphics built in, right out of Introduction to Logo.

stefan,
@stefan@stefanbohacek.online avatar

When the MTA announced discontinuing their live subway alerts due to Twitter's new excessive pricing policy, I took it as an opportunity to set up @mtaupdates.

And here's how I made it.

https://stefanbohacek.com/blog/turn-an-email-subscription-into-a-mastodon-bot-with-pipedream-com/

#tutorial #bots #MastodonAPI #python #pipedream

pomeh,

@stefan @mtaupdates didn't know about pipedream, but it looks like pretty cool.

I'm gonna check out how its features differs from Huggin (which is free and self-hosted when pipedream is a saas solution)

stefan,
@stefan@stefanbohacek.online avatar

@pomeh @mtaupdates Awesome! Yeah, definitely worth checking out. And Huggin looks interesting as well, saving it for later!

brianleroux,

frontend twtr is currently debating whether polluting global variables is a good idea or not in case you needed more reasons to not go there anymore

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@brianleroux "it depends"

Did I answer correctly? Do I get a prize?

thomasapowell,
@thomasapowell@fosstodon.org avatar

@brianleroux
Cool 😎

var console = false;

did I do this right ? 😬😜

hugovk,
@hugovk@mastodon.social avatar
hugovk,
@hugovk@mastodon.social avatar

Next, GitHub will be removing support for Python 2.7 from actions/setup-python in under a month, on 19th June. 🪦

"Breaking changes

"Hello everyone. The Python 2.7.x will be removed from python-versions and it won't be possible to set up Python 2.7.x by setup-python.

"The motivation for the changes

"Python2.7 is not supported since January 1, 2020."

https://github.com/actions/setup-python/issues/672

hugovk,
@hugovk@mastodon.social avatar
henrikjernevad,
@henrikjernevad@mastodon.social avatar

Why should you unit test? What should you unit test? And how much?

Today's blog post answers these questions and provides some helpful guidelines.

The post is actually a lightly edited extract of a book on unit testing that I started about 10 years ago but never finished. Still, it has aged reasonably well.

https://henko.net/blog/why-write-unit-tests/

#programming #unittesting #testing

underlap,
@underlap@fosstodon.org avatar

@henrikjernevad I really enjoyed your post and thought it deserved a response. https://underlap.org/why-write-unit-tests

bluGill,
bluGill avatar

@henrikjernevad Every test you listed there is the type that should be deleted when you are done.

Which is to say you are missing something critical: to ensure when someone in the future makes a change they don't introduce bugs. Any test that will never alert you to a bug in your code by failing should not be kept. (that is about 80% of all tests, but I don't know how to figure out the difference)

mjgardner,
@mjgardner@social.sdf.org avatar

@Perl Happy 36th #birthday to the #Perl #programming language!

v1.0 then:
“Perl is kind of designed to make #awk and #sed semi-obsolete […] The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).” https://github.com/Perl/perl5/releases/tag/perl-1.0

v5.38.2 now:
“Perl is […] now used for a wide range of tasks including #SysAdmin, #WebDev, network programming, #GUI development, and more.” https://perldoc.perl.org/perlintro#What-is-Perl%3F

dragonsidedd,
@dragonsidedd@sciencemastodon.com avatar

@mjgardner @Perl I remember first encountering Perl as Perl3, just before Perl4 and the Camel book. I remember looking at the crazy sigils and deciding, "this is it, the first new language I don't bother to learn."

6 months later, I had learned.

30+ years later, the majority of my working life continues to be spent manipulating those sigils. @rrays and $calars and h%shes FTW!

sjfloat,

@mjgardner @Perl For me, it did replace awk and sed. Not to mention a goodly portion of the C and Bourne shell I was then writing.

thisismissem,
@thisismissem@hachyderm.io avatar

Here's a fun one for folks: when using the cluster module, how do you get the total count of connections to a net.Server?

Because it's not getConnections, that seems to only return the number of connections for the current fork, as increasing the cluster fork number but keeping the connection load the same sees the number of connections decrease proportionally to the cluster fork number.

This seems to be a bug in Node.js, but I don't yet have reproducible code to prove it.

indutny,
@indutny@fosstodon.org avatar

@thisismissem right, but what's confusing me is that this is how it is actually implemented: https://github.com/nodejs/node/blob/4bb06dbd0a87e5b2430780ddceec08015f8c496a/lib/net.js#L2144-L2160

thisismissem,
@thisismissem@hachyderm.io avatar

@indutny right, the implementation seems to suggest that it's adding up the connection count across all forks (workers), right?

But the result isn't so.

bgawalt,

Question for people who make websites, especially hobby websites, that use cookies:

what do you put in those cookies? They're allowed to be up to like 4KB for your whole domain, right?

That both seems like too much for "just" a user/session ID, while also being too little to hold actual state (like, game history & stats) for a website with a dozen toys on it.

#webdev

michael,
@michael@thms.uk avatar

@bgawalt sorry, yes. localStorage is what I meant.

SessionStorage isn’t hugely helpful for this purpose because of it it’s extremely short live span.

bgawalt,

@michael still very helpful. I'm living in 1993 where "to store locally" just means "to give a cookie"

keithjgrant,
@keithjgrant@front-end.social avatar
nosherwan,
@nosherwan@fosstodon.org avatar

@keithjgrant is BEM out of style now?
I didnt use it to begin with.

jensimmons,
@jensimmons@front-end.social avatar

@nosherwan @keithjgrant Oh I’ve been involved with that spec. It’s very interesting. Talked about it on Shop Talk Show last year. (CSS Cascade level 6 — not a different spec with "Scope" in the title. @davatron5000 made fun of me sighting spec level numbers, :P rightly so...)

paulox, (edited )
@paulox@fosstodon.org avatar

I'm Paolo Melchiorre, aka #paulox, hiker, swimmer, reader, traveler, living in #Pescara 🏖️

#ComputerEngineer graduated from the #University of #Bologna 🎓

#Python developer, member of #PythonItalia and #PSF 🐍

#Django contributor, #DSF member, and #DjangoGirls organizer and coach 🦄

Organizer of #PythonPescara #meetup and co-organizer of the #PyConItalia #conference 🇮🇹

Conference #speaker, at #PyCon, #DjangoCon, #EuroPython etc 🗣️

#GNU #Linux user and #FreeSoftware advocate 🥑

#Pelican blogger 🐦

paulox,
@paulox@fosstodon.org avatar

I forgot to use the hashtags and 😅

paulox,
@paulox@fosstodon.org avatar

@wsvincent In , however, it is not allowed to drink after noon, and only use ( or ) on . 🍕

mjgardner,
@mjgardner@social.sdf.org avatar

There’s nothing more permanent than a temporary fix that works.

godeater,
@godeater@hachyderm.io avatar

@mjgardner I wrote a 200 line Proof of Concept, that by the time I left last job had turned into a ~14K LOC behemoth that should never have been put into production for all these reasons.

mjgardner,
@mjgardner@social.sdf.org avatar

@godeater “...[T]here are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.

“The first method is far more difficult.”

— C.A.R. “Tony” Hoare, 1980 @ACM Turing Award Lecture: https://doi.org/10.1145/358549.358561

interfluidity,

[Announcing] fossilphant — a static-site generator to self-host your posts from Mastodon archives https://github.com/swaldman/fossilphant#readme

Check out examples, themes with paging https://www.mchange.com/projects/fossilphant/example/shatter/ or as one tall page https://www.mchange.com/projects/fossilphant/example/tower/

My current instance is sunsetting, and I want to make sure the banalities I posted here remain forever public.

If you are in similar straits, I'd love it if you gave this a try!

cc @isomorphismes @jpkoning @mattlehrer @paulgp

gimulnautti,
@gimulnautti@mastodon.green avatar

@interfluidity whaaa!!? Awesome 🥳🫶

interfluidity,

@gimulnautti (thanks! i’d love it if you’d give it a shot and let me know whatever’s not so awesome!)

faassen,
@faassen@fosstodon.org avatar

Over the years as a software developer I've had projects where I spent intensely collaborating in a team, and projects where I work by myself. I feel the tension between the two.

When I'm in a team I want to collaborate, even though the human interaction is quite draining to me. This means pairing and discussing plans and strategy.

But when I am working alone I feel pleasure of being in the flow and cranking out code.

1/?

faassen,
@faassen@fosstodon.org avatar

I've had the pleasure of working in a highly effective team for a few years. The team didn't start out that way, but we got there together. The team wasn't composed of extraordinary developers, but a mixture of normal devs each with our own strengths and weaknesses. We just collaborated well and frequently.

2/n?

faassen,
@faassen@fosstodon.org avatar

The other reason teams have the wrong defaults for collaboration is because the culture and tools are heavily influenced by open source development practices.

In many ways that has been a good thing, but in this case it's not. Open source collaboration is optimized for asynchronous collaboration, different intensity of contribution, low default levels of trust.

And that's not like a tight-knit effective software development team at all.

#7/7

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • slotface
  • khanakhh
  • kavyap
  • InstantRegret
  • Durango
  • provamag3
  • everett
  • cisconetworking
  • Leos
  • normalnudes
  • cubers
  • modclub
  • ngwrru68w68
  • tacticalgear
  • megavids
  • anitta
  • tester
  • JUstTest
  • lostlight
  • All magazines