this post was submitted on 16 Sep 2024
41 points (97.7% liked)

Programming

17022 readers
472 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

Hi ! I've been working on this article for the past few days. It would mean a lot to me if you could provide some feedback.

It is about implementing a physico-chemical simulation as my first attempt to write a shader. The code is surprisingly simple and short (less than 100 lines). The "Prerequisite" and "Update rules" sections, however, may need some adjustments to make them clearer.

Thanks for reading

you are viewing a single comment's thread
view the rest of the comments
[โ€“] pcouy@lemmy.pierre-couy.fr 1 points 2 days ago (1 children)

I did not expect such a detailed code review (the fact that you wrote it on mobile impresses me even more), but I strongly agree with everything you mentioned. I think I was so caught up learning GLSL and its quirks, then playing and experimenting with the simulation, that I "forgot" my coding standards. Anyway, I'll make sure to take some time to update both the code and the article following your recommandations.

[โ€“] towerful@programming.dev 2 points 2 days ago* (last edited 2 days ago)

Like I said, impressive work.
Converting science to shaders is an art.

I guess your coding standards follows scientific standards.
And I guess it depends on your audience.

I guess the perspective is that science/maths formulae are meant to be manipulated. So writing out descriptive names is only done at the most basic levels of understanding. Most of the workings are done on paper/boards, or manually. Extra letters are not efficient.
Whereas programming is meant to be understood and adapted. So self-describing code is key! Most workings are done within an IDE with autocomplete. Extra letters don't matter.

If you are targeting the science community with this, a paragraph about adapting science to programming will be important.
Scientists will find your article and go "well yeh, that's K2". But explaining why these aren't named as such will hopefully help them to produce useful code in the future.

The fun of code that spans disciplines!

Edit;
Om a side note, I am terrible at coding standards when I'm working with a new paradigm.
First is "make it work", after which it's pretty much done.
Never mind consistent naming conventions and all that.
The fact you wrote up an article on it is amazing!
Good work!