• 0 Posts
  • 17 Comments
Joined 1 year ago
cake
Cake day: July 4th, 2023

help-circle
  • For small projects, rewriting is often superb. It allows us to reorganize a mess, apply new knowledge, add neat features and doodads, etc.

    This. I’m coding to contribute to a open-source software with very small amount of coders, and with a non-mainstream Domain-Specific Language. A lot of the code I did before has been proven to work from times to time, but they all could benefit from better outputs and better GUI. So, I end up reengineering the entire and that’ll take a really long time, however, I do a lot of tests to ensure it works.




  • Chances are there’s probably something similar to dictionary in Python in your languages or at least it’s a import/#include away. Although I don’t use general programming languages at all, in my used language (G’MIC), I do something like dict$var=input where $var is a defined variable, and this way I can access input by doing ${dict$var} and that’s similar to Python dictionary. In C++, there’s hash table implementation out there via github. That being said, there are sometimes when you don’t need a hashtable dependent on the hashmap, and sometimes, it’s just as simple as basic mathematics to access data.







  • Every languages has their own pitfalls. The answer on picking a language is to pick whatever works for you. There may be even domain-specific languages if you’re interested in a domain, and it can be way more flexible than general-purpose solutions for that domain too.

    I use 4 languages.

    1. C++ for adding features to a program.
    2. C# for making .dll for an application (Paint.NET). Kinda similar purpose to what I do with G’MIC, except so much more limited.
    3. Python for processing strings
    4. G’MIC for creating/editing raster graphics images (volumetric too)

    Now, I wish there was a vector equivalent to G’MIC, but there isn’t.





  • Indentations does not really help readability that much in case of really, really, long code, and in some cases, a code can execute without with unexpected result because of one single indentation being off. Both of these why I like things like curly braces/brackets and terminators like endif/fi/done/end/etc. But, at the end of the day, if there’s a readability problem, then that’s a sign that the code needs to be reworked on.


  • My crazy take is that there needs to be a interpretative language alternative to Python which uses brackets to define scope and/or things like elif/else/fi/end of/done. Much easier that way in my opinion, and the “;” shouldn’t be necessary. I’m used to Python, but if I had another language which can be used to serve similar purpose to Python with those features, I would never code in Python again when it comes up.

    Having to code in Julia and G’MIC (Domain-Specific Interpretative language that is arguably the most flexible for raster graphics content creation and editing), they’re the closest to there, but they’re more suitable for their respective domain than generic ones.