• 1 Post
  • 67 Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle





  • This article uses the term “parsing” in a non-standard way - it’s not just about transforming text into structured data, it’s about transforming more general data in to more specific data. For example, you could have a function that “parses” valid dates into valid shipping dates, which returns an error if the input date is in the past for instance and returns a valid_shipping_date type. This type would likely be identical to a normal date, but it would carry extra semantic meaning and would help you to leverage the type checker to make sure that this check actually gets performed.

    Doing this would arguably be a bit overzealous, maybe it makes more sense to just parse strings into valid dates and merely validate that they also make sense as shipping dates. Still, any validation can be transformed into a “parse” by simply adding extra type-level information to the validation.





  • Putting the message in git puts the information closer to the code, since the pr isn’t in git itself but instead the git forge. You can for example search the text of git messages from the git cli, or come across the explanation when doing git blame. I sometimes write verbose commit messages and then use them as the basis for the text in the pr, that way the reviewer can see it easily, but it’s also available to anyone who might come across it when doing git archeology


  • It’s fine to want a gui debugger and I want to clarify that I’m not actually trying to persuade you to use gdb! My actual advice would be vscode (or other ide) with it’s gdb/lldb integration which allows you to debug from your ide in a gui-oriented way.

    I do however think that you’re wrong about how hard it is to learn gdb. I learned to use it not that long ago and it doesn’t take “1 month”. Using gdb on a basic level is actually not particularly hard, and I can recommend this talk for anyone actually curious about learning gdb. It’s just 15 minutes, but the same speaker has done a couple of other talks on the same theme that are longer if you want to learn even more, you can probably find them in the recommended videos sidebar.

    What I actually think is the case is that learning gdb takes a bit more mental effort because it’s a different paradigm than gui debuggers, and a lot of things aren’t intuitive. If you’re prepared to be a bit uncomfortable and lost for an afternoon, and maybe even flip through the official document for a bit you can be “good enough” at gdb in less than a day.

    Gdb is also more powerful than most gui-only editors, because you can do scripting in gdb. For example you can execute an arbitrary series of gdb commands when you hit a certain breakpoint which can be really useful in some circumstances. My preferred way of debugging in linux is actually to both have a gdb window that I can enter commands in so I can do more scripting stuff if I want to, and also some extra bells and whistles for viewing source code and setting breakpoints etc. I edit in vim so I use the termdebug plugin that comes bundled with vim, but use whatever exists for your editor if you don’t use vim yourself.


  • I like this quote

    and just the other day I caught myself wondering who will clean out my Inbox after I’m dead


    I think that it’s bad to become too dependent on a certain tool, especially if that tool is owned by microsoft, although in this case your dependent on various microsoft api:s anyway so that’s probably a bigger problem in that regard. Experimenting with programing without Visual Studio is a good idea and will probably teach you lots of things about yourself and microsoft api documentation in this case. If microsoft has built a system that is so impractical that you need visual studio to navigate it, that’s a pretty bad sign for the health of the microsoft ecosystem, but that’s not exactly surprising anyone



  • One of my acquaintances has actually made a small game in Odin (Cat and Onion) and after that written a book about the language (Understanding the Odin Programming Language). I don’t know much about Odin myself but from what I’ve gathered there isn’t that much quality documentation or that many good tutorials etc. so it can be a bit hard to get in to the language, which is why he decided to write the book.





  • Helix has better defaults for sure and I get why people might prefer it but I have a very hard time imagining it being a better choice than vim in every situation even with a lot more development.

    Also, if you work with programming for example your editor is going to be one of your main tools and I think that “reading guides” is an acceptable amount of effort to put in to learning such a tool. Vim has a higher barrier of entry than it needs to (this can to some extent be explained with backwards compatability) but with Helix you still have to put some time in to understanding the editing model anyway.


  • The biggest thing missing from helix right now imo is plugin support, so a lot of plugins that I really like wouldn’t be available. I use fugitive a lot for working with git for example.

    Another one is the quickfix list in combination with ex commands. One thing you can do for example is setup :make to run your compiler and then when you get compilation errors they’ll show up in your quickfix list. You can then use :Cfilter to focus on one type of error and then :cdo to for example do a find and replace on the remaining lines.

    In general, if I don’t have an lsp available for whatever reason (I work in cmake a fair amount at my $DAYJOB for example) I would much rather use vim, in particular because of the stuff that you can do with ex commands that I mentioned above (also works great with grep) but also because of the ctags support.

    Helix can do a lot of nice things out of the box for a lot of cases of software editing, but it’s not nearly as broad or as customizable of a tool as vim