sos, to cpp
@sos@mastodon.gamedev.place avatar

Just looked up how to do callbacks in C++ and YOU CAN'T (unless you write a bunch of templates and wrappers yourself).

When you pass a pointer to non-static member function, yopu need to handle the class pointer yourself. This is like the simplest thing, why can't C++ have that?

Love how the ISO standard website just tells you "Don't". What a joke.

#cpp #programming

gracicot,
@gracicot@mastodon.social avatar

@sos @morten_skaaning If you want to create a callback just out of a member function and this the STL actually got it for you, no need for templates:

auto callback = std::bind_front(&type::member_function, this);

It's a bit like javascript where you need to bind a class function with an instance to properly use it as callback.

gracicot,
@gracicot@mastodon.social avatar

@sos @morten_skaaning The other answer would be of course "just use a lambda" because they work for pretty much all cases, even for C functions that can get a void*

Natanox, to webdev
@Natanox@chaos.social avatar

I probably get flooded by asking this but welp, here I go:

I'm looking for a good, visual (!) for that focuses on Codium, Firefox and other Open-Source tools. My specific interests are to learn , , and . Perhaps some minor , however I'd like to primarily work without it.

I'm a visual learner, extended theory in text won't help me at all. As language is visual to me, so is .

Anyone knows something that checks these boxes?

Natanox,
@Natanox@chaos.social avatar

@Crell Only if necessary, it makes the learning process unnecessarily convoluted (harder to scrub through a video than a website and the pace is always changing).

Crell,
@Crell@phpc.social avatar

@Natanox That's why I don't usually like videos, either. :-) What counts as visual, then? Lots of code samples?

jbzfn, to programming
@jbzfn@mastodon.social avatar

⏳ Am I too old to create a popular programming language?

"Is it too late to create a popular programming language after age 40? Let's find out!"

https://pldb.io/posts/age.html

RL_Dane,
@RL_Dane@fosstodon.org avatar

@jbzfn

I'm curious why and are listed separately.

gregorni, to programming
@gregorni@fosstodon.org avatar

Somehow the following pseudocode:

if not condition:  
 return;  
do_stuff  

feels much more intuitive to me than

if condition:  
 do_stuff;  

Anyone else feel that way?

kramo,
@kramo@fosstodon.org avatar

@gregorni Definitely agree. Also helps make the code more readable by reducing indentation.

chrisg,
@chrisg@fosstodon.org avatar

@gregorni I feel you - I also appreciate getting the "quick" case out of the way so the complicated branch is not nested.

The reason I don't commit to it consistently is the negation of the condition. It's one thing to read

if !thing.in_use() {
return;
}
// do things with in use thing

and another to read

if !thing.has_been_accessed() {
// wat!?
}

In general, I think simplicity of condition is more important than nesting.

matdevdug, to random
@matdevdug@c.im avatar

10 years ago: Our monorepo is a pain to deal with. Changing one tiny thing here breaks something there!

5 years ago: We’re migrating to microservices. That way everything is decoupled and you can do what you need to.

3 years ago: Microservice maintenance keeps falling behind. We need some way to enforce service contracts between services but now our stack is too complicated to do full integration testing.

1 year ago: We’re proud to announce we’re migrating to a new concept: a monorepo!

Everything old is new again.

willhbr,
@willhbr@ruby.social avatar

@matdevdug s/monorepo/monolith/g?

matdevdug,
@matdevdug@c.im avatar

@willhbr In this case I mean there was one repo where everything lived and that (often) contained the monolith application. Then as time went on the stack was switched to microservices with their own repos, but then maintaining the service contracts between them became more of a pain so then you end up back with one place to make changes because developers were tired of making 600 pull requests every single time they need to change a Dockerfile.

gerowen, to python
@gerowen@mastodon.social avatar

Just posted an update for my little project that downloads videos from sites like YouTube. You can check it out here:

https://sourceforge.net/projects/youtube-dl-gtk/

maegul, (edited ) to tech
@maegul@hachyderm.io avatar

Is there an established term/neologism for the whole tech-bro attitude/belief/common-response of

"there is no UI issue, this is a good tool, anyone who's bothered to learn it understands this ... you just have a skill issue"

vimism? (genuine suggestion for a genuine question ... it's the term my brain uses)

underlap,
@underlap@fosstodon.org avatar

@maegul Over-complicated?

jimfl, to programming
@jimfl@hachyderm.io avatar

Hurl is a language based on exception handling. It’s a real shame that it isn’t tail recursive though.

https://hurl.wtf/

stevensanderson, to Finance
@stevensanderson@mstdn.social avatar
dentangle, to programming
@dentangle@chaos.social avatar

ThreadSanitizer seems to have improved a lot since I last used it seriously. Incredibly useful tool for working with memory barriers / atomics.

I think I'll integrate it it into our test suite for #librecast

#C #programming #ThreadSanitizer

pixel, to swift
@pixel@social.pixels.pizza avatar
FATHI, to programming Persian
@FATHI@mstdn.social avatar
treyhunner, to python
@treyhunner@mastodon.social avatar

Note that this function uses an "if" statement that returns, and an "else" that also returns.

Read more 👉 https://trey.io/FlSco3

dentangle, to programming
@dentangle@chaos.social avatar

After protracted negotiations, ThreadSanitizer has blessed my threadly abuses.

#C #programming

Moosader, to ComputerScience
@Moosader@mastodon.gamedev.place avatar

Since I'm working on my summer course notes/"book": what is something you wish programmers knew/did?

#ComputerScience #Education #Programming

raptor85,
@raptor85@mastodon.gamedev.place avatar

@Moosader stack/heap differentiation and memory allocation in general. I'm tired of things that complexity-wise would run on a C64 bringing my modern r9 with 128 gigs of ram to it's knees O_x

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