• 2 Posts
  • 33 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.



  • This could be an XY problem, that is, you’re trying to solve problem X, rather than the underlying problem Y. Y here being: Why do you need things to be in decimal in the first place?

    I wouldn’t say it’s needed, but this is more of a fun thing for me. The only thing I’m using this is for Tupper’s Self-Referential formula, and my current approach of converting base 1>>24 to base 1e7 works instantly for 106x17 binary digits. When I load a image to that filter that’s greater than somewhere over 256x256, delays are noticeable because the underlying algorithm isn’t that great, but it could have to do with the fact that G’MIC is interpretative, and despite the JIT support in it, this is not the kind of problem it’s meant to solve (Domain-Specific). On the bright side of thing, this algorithm will work with any data type as long as one data type is one level higher than the other, and in this case, I’m using the lowest level (single and double), and the bigger data type, much faster it can be.




  • Coming from some one who used 4 different languages (C#, C++, Python, and G’MIC), I just feel more comfortable when there’s a explicit end blocks, which is why I don’t like Python. Of all of those languages, only Python does not make that explicit end block which is off-putting in my opinion, and there isn’t any other options with the similar role to Python.






  • 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.




  • I didn’t say it doesn’t help. But, it alone does not really help for bad and long code, but you are correct in that it would be worse with the wrong indentation. Like you pointed out, the program could do the wrong thing if there is a wrong indentation where indentation matters which is one of my issue with something like Python. And languages with explicit exit scope tend to not have that issue while adding to the benefit of making longer code readable. Where white-space sensitive languages really shine on in my opinion are small codes, and that’s where I think of using Python.


  • From some one who used Python as it was the easiest solution to few of my problems, and having to experience languages with brackets and/or endif/fi/done as ways to limit scope, I find that having things like brackets and/or scope terminators easier to parse and less error-prone. I’m thinking about moving on to Ruby whenever I had a need where Python would be a good choice, but the time it takes for me to understand a new language is blocking me from that.