Programming

nicd,

We're facing the possibility of changing the VAT from 24 to 25.5% here in Finland. My thoughts and prayers with all the financial sector programmers who get to patch all the systems where the VAT field is an integer without additional precision capabilities.

Di4na,
@Di4na@hachyderm.io avatar

@nicd that is rare because load of country have or have had other rate. And it is not rare for some industry to have a decimal and different vat

henrikjernevad,
@henrikjernevad@mastodon.social avatar

I think that testable code is reusable code. When you test a function, you run the code in another context than it was built for (the production code). If your code is not reusable you will feel that pain in your tests.

This blog post gives an example of how getting side effects out of functions make them both easier to test and reuse.

https://henko.net/blog/testable-code-is-reusable-code/

underlap,
@underlap@fosstodon.org avatar

@henrikjernevad Nice example of the single responsibility principle too.

owiecc,
@owiecc@en.osm.town avatar

Can any of you suggest a 2D plotting library for Rust? I need to plot some polygons on a canvas and save to (ideally) pdf.

fil,
@fil@hachyderm.io avatar

@owiecc
Looks like plotters is the default, its documentation https://docs.rs/plotters/ has a "snowflake" example, which might be what you are looking for. There are also a couple of alternatives https://lib.rs/keywords/plot

sos,
@sos@mastodon.gamedev.place avatar

I hate when programmers tell other programmers "Don't do this" "Don't do that". Don't listen to these people.

And don't gatekeep other people's code. Let people program however they want.

Worst thing is, person posting this DOES use early return in their code.

I think programmers just think they're better than others. "I can do this, but you can't". Don't be like that. It's not OK.

#programming #coding

sol_hsa,
@sol_hsa@mastodon.online avatar

@slembcke @sos
Wouldn't know. But if you think of a very complex function with many nested structures, having a random return in the middle of it can make it really hard to parse.

Nifflas,
@Nifflas@mastodon.gamedev.place avatar

@sos yeah, I agree so much! The better of a programmer I become, the more I learn it's not about knowing what to always do, or never do - but knowing when to do what.

Plus, I use different practices for different contexts. In networking code or anything where security is a factor I avoid patterns I'd happily use for game logic.

schenklklopfer, German
@schenklklopfer@chaos.social avatar

Grund 409638045983 warum ich dieses ganze Universum verachte:

Habe Code - nicht meiner, kann daran nichts ändern.
Code hat sich seit 7 Monaten nicht geändert.
Vor 7 Monaten ist die Pipeline gelaufen und hat ein Image erfolgreich gebaut.
Heute läuft die Pipeline nicht mehr, weil sich irgendeine Abhängigkeit anders verhält als vor 7 Montaten.

Und nu?

Ja, bleiben diese 9,8er CVEs halt drin in dem Image, weil neu Bauen geht nicht.

thomas,
@thomas@metalhead.club avatar

@schenklklopfer wo es in der Firma nicht anders geht, sichern wir uns mittlerweile den ganzen node_modules Ordner weg und archivieren den. Einfach vor Angst, dass mal ein Modul nicht mehr verfügbar sein könnte oder irgendein anderer Scheiß passiert. Hilft aber natürlich nicht bei CVEs.

notsle,
@notsle@kzoo.to avatar

The Time Lords have a special torture chamber on Gallifrey for app developers that write apps, used cross timezones but dont properly store timezone data.

vga256,
@vga256@dialup.cafe avatar

i'm embarrassed to say that it took me 5 hours to understand 9% of lua's metatables so i could implement basic OOP inheritance

i swear that 3/4 of my time is spent unlearning C++

mezz,
@mezz@mstdn.games avatar

@vga256 Metatables are fun, especially once you start overriding the lookup function and do whackier stuff than just inheritance :cat_sip:.

vga256,
@vga256@dialup.cafe avatar

@mezz yup that is the plan. just wanted to get the basics working first

dominucco,
@dominucco@mastodon.social avatar

One of the best ways to bond with your kids is through coding! This Sunday, why not try coding up a classic game with Pygame? It's a fun and easy way to introduce your child to the world of programming. Check out this quick getting started guide and have a happy Funday! #programming #stem #python

Link: https://dominickm.com/sunday-funday-pygame-for-kids/

wervice,
@wervice@fosstodon.org avatar

What is your favorite programming language?

stevensanderson,
@stevensanderson@mstdn.social avatar
ngmi,
@ngmi@mastodon.online avatar

@wervice rust, but I'm bad at it 😂

maralorn,
@maralorn@chaos.social avatar

current status: calling a executable from typed template

pmidden,
@pmidden@fosstodon.org avatar

@maralorn uhmm, isn't this just "exec()"? 😃 (or createProcess, whatever)

maralorn,
@maralorn@chaos.social avatar

@pmidden Yeah, I am not saying it’s complicated, it just feels a little cursed.

ross,
@ross@rossabaker.com avatar

I was thinking about the Lean Scala hubbub when a song from an early Chicago album came on shuffle. Chicago's "legacy" albums adroitly blended genres in ways few did before or since, until the band pivoted to AOR and Christmas albums, alienating most of its fans.

Anyway, I'm going to go listen to Chicago II. It still sounds great and it's still here.

jonoabroad,
@jonoabroad@mastodon.nz avatar

@ross lean is good, expecting everything to be ditched for shiny new smacks of no real world experience.

kzoneind,
@kzoneind@mstdn.social avatar

: are used in computer programming to implement .

What are the different types of Programming Languages? What are the trends in design?

https://knowledgezone.co.in/trends/explorer?topic=Programming-Language

amigalove,
@amigalove@mastodon.social avatar

Won’t this be fun?

(Back in the day I was desperate enough to try…)

image/png
image/png
image/png

RL_Dane,
@RL_Dane@fosstodon.org avatar

@amigalove

Yowza, that's a LOT of DATA statements. %)

eed3si9n,
@eed3si9n@mastodon.social avatar

scopt 4.1.0 is back published to 2.12, 2.13, and Scala 3 on Scala Native 0.5.x

scopt is a little command line options parsing library
https://github.com/scopt/scopt/releases/tag/v4.1.0

vascorsd,
@vascorsd@mastodon.social avatar

Been having fun with , made more than a hundred lines of code with it. It's really refreshing having a language that compiles fast and takes barely any memory and cpu to run.

Not having to care about the build tool too much, hundreds of compiler flags, language versions, compiler plugins, formatting plugins, or any of the usual things that fill the brain I'm used to in is a huge breath of fresh air.

Not having to care about the JVM is amazing.

vascorsd, (edited )
@vascorsd@mastodon.social avatar

The syntax sometimes is not very pretty (subjective). Functions receiving functions as parameters get a bit ugly with 'x |› map(fn(v) { ““ })' feeling like having too many parentheses.

syntax is prettier in this aspect with
'x.map { v =› "" }’ being more lightweight.

And formatting sometimes doesn't do what I'd like.

And I dearly miss the 'for { y <- stuff } yield ""' syntax. The 'use syntax' doesn't really click with me yet.

Anyway, overall, great experience 😉

vascorsd,
@vascorsd@mastodon.social avatar

Was writing a bit of code here: https://github.com/vascorsd/glxdg

The gleam command is really great. Any language nowadays not having a full integrated DX in a single command to drive the code will not survive in the next decade.

gleam docs is really nice and quick too.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • DreamBathrooms
  • magazineikmin
  • khanakhh
  • everett
  • Youngstown
  • slotface
  • GTA5RPClips
  • cisconetworking
  • Durango
  • rosin
  • modclub
  • kavyap
  • thenastyranch
  • InstantRegret
  • bokunoheroacademia
  • mdbf
  • ethstaker
  • cubers
  • Leos
  • tacticalgear
  • anitta
  • normalnudes
  • osvaldo12
  • tester
  • lostlight
  • relationshipadvice
  • HellsKitchen
  • sketchdaily
  • All magazines