• 3 Posts
  • 18 Comments
Joined 1 year ago
cake
Cake day: July 24th, 2023

help-circle
  • I feel like all the points you raise could be replied by : if you do not like it, no one is forcing you into doing it.

    It is my understanding that people do this for fun - to take the occasion to get into a new language and/or exercise their problem resolution skills.

    Personally, although I love coding (it is a passion), after a whole day of coding I do not feel the energy to partake in a coding event. And during holidays I am busy doing other stuff. So I do not participate in the Advent of Code. But I am still glad that the event exists for people who enjoy it and have the time for it


  • I do not get why it would work in that case. I assume the scenario is someone with a bike coming, doing theft, then leaving with the same bike.

    Therefore there will be a period without bike, then a period with bike, then a period without bike again.

    Let’s assume there is no bike on the particular moment viewed. How do you know whether it occured before or after the theft? If you make the wrong decision, you get stuck on an endless binary search… Unless you take note at each timestamp where you made the decision, draw a tree of timestamps, and go back the tree if your search is fruitless but that’s much more complicated than what this post says.


  • There are techniques like abstract interpretation that can deduce lower and upper bounds that a value can take. I know there is an analysis in LLVM called ValueAnalysis that does that too - the compiler can use it to help dead code elimination (deducing that a given branch will never be taken because the value will never satisfy the condition so you can get rid of the branch).

    But I think these techniques do not work in all use cases. Although you could theoretically invent some syntax to say “I would like this value to be in that range”, the compiler would not be able to tell in all cases whether it’s satisfied.

    If you are interested in a language that has subrange checks at runtime, Ada language can do that. But it does come at a performance cost - if your program is compute bound it can be a problem


  • Why would you have to choose between tests and compiler checks? You can have both. The more you have the less chance of finding bugs.

    I would also add that tests cannot possibly be exhaustive. I am thinking in particular of concurrency problems - even with fuzzing you can still come across special cases where it goes wrong because you forgot a mutex somewhere. Extra static checks are complementary to tests.

    I think you can write “unsafe” code in Rust that bypass most of the extra checks so you do have the flexibility if you really need it.




  • I love that software. It’s so simple - no need for much clicking you can do a lot with just the keyboard.

    I love particularly how there is no bloatness. Creating a new task is as simple as pressing ctrl+a (or shift+a), typing the name and pressing enter. Creating a subtask is just pressing ‘a’ on the task and type the name.

    There is jira integration so I can import my jira tickets and make my own local subdivision in smaller tasks that do not need to be thoroughly described or shared. The status of the jira tickets can be updated from the app directly

    There is a pomodoro plugin that works well minor some bugs (don’t ever choose “close” when prompted to skip the break or go back to work)

    Wonder what did I do last week for writing a summary? Just look at the history in the app

    I really love it and can only recommend it for personal planning


  • Yes, getting into a new project is hard. Even when you do know the languages and frameworks it’s still hard because you have to get into the mini ecosystem that the developers of that project built. In companies there is usually an expected amount of time (days? weeks? Months? Varies on the project) where a new developer is not really expected to do anything major, just getting used to the project.

    I do not know if you are professional or hobbyist. But coding takes a lot of time, a lot of it is spent on just figuring out how you will code this or that feature ; then another bunch of time is spent debugging ; and finally, yet another bunch of time is spent integrating your new feature. That’s why it’s a whole job, and that’s also why you need a ton of free time to do this as a hobbyist.

    But the good news is that once you spent that upfront time to get into the project, you can code more efficiently (that is, get right to the features you want to make) and you will also spend a little bit less time getting into other projects because although projects are different, there is always some level of organization that remains similar. The more advanced you become, the quicker you can get into a “production” state where you can code right away thanks to spending less time figuring out how things work.





  • Yes. My windows takes literally 10 minutes to boot. I am counting here from the moment i press the button to the moment it is usable (when I can run applications and use them). I have a HDD and each time I boot windows services are always looking to update something which starves the other apps. It’s really a clog. If I want to use it faster I need to bring up the task manager and kill each update thing one by one until I killed them all.


  • Program easily and efficiently. Not having to wait 5 minutes for a window to come. Fast boot/reboot times (less than 10 minutes). Native support for many things without having to install them. Installing is usually as easy as running an apt-get command. Not having to kill update processes because they take 100% of your disk bandwidth and starve all your other apps.

    Windows feels like an ugly and sloggy system with a ton of duck tapes. Only reason I use it on my gaming laptop is for games.

    Linux on the other hand just works. Nothing fancy, but it’s just what someone who wants efficiency needs.



  • Interesting take. I prefer spaces because each piece of code that I see with tabs has an implicit tabsize you really need to have if you don’t want the code to look ugly - especially if the person has been mixing tabs and spaces - and they usually do. Sometimes unadvertently.

    When you remove all tabs at least everyone is on the same page.

    To the actual problem raised by the article:

    I have ADHD. Two spaces per indent makes it damn near impossible for me to scan code. My brain gets too distracted by the visual noise. Someone who’s visually impaired might bump their font size up really large, and need to scale up or down the amount of space per indent. Someone might just prefer it because…

    I wonder if it could be possible to adjust the “indent number of spaces you see” in code editors. Code editors are able to figure out what are indents and what are not, so in theory it should be possible. Perhaps that would be an idea for a new feature?




  • We need to choose something which most closely represents the data.

    Why do you need to do that? You do not have to choose the optimal memory model to code a Tic Tac Toe game.

    A Vec works fine, and is also simple to understand (so it is maintainable).

    If you invent your own complex data structure for the Tic Tac Toe you trade maintainability for… what gain?

    How to build a grid whose orientation does not matter?

    The orientation is how you iterate on your grid. If you iterate from first element to last element on X-axis, you have the “normal” orientation. If you iterate from last to first, you have the Y-symmetrical orientation.

    A 2D array is already a grid whose orientation does not matter. No need to over-complexify this.

    If you want to be picky, you could say that you want a grid with optimal performance. Meaning that your data should be contiguous (ideally, your data should be in the same cache line to prevent cache misses).

    If you start playing with complex data structures with lots of pointer indirections and such, your performance will go down, your code will be more complex to understand, and will (certainly) be bigger in memory. You will lose in both maintainability, performance and size.

    A single vector of 9 elements is enough, really.


  • In StackOverflow, when a user asks a similar question to one that was already asked, most of the time the question gets closed with a link to the “original” question without being told why the question is similar or how the answers to the “original” question can help the author.

    That might be OKish for us experienced developers. But for a total beginner, I find this approach to be unsuitable. Most programming beginners don’t even know how to phrase their question because they are not sure what they are struggling with themselves. Most of their posts will be like “There is something wrong with my code but I can’t figure out what it is”. That would not have a place on StackOverflow ; the post would get downvoted to infinity and the beginner - who is just looking to learn - will most probably say “Ok, StackOverflow no more” and move to other media for help.

    One time I asked a question about Perl semantics ; I could not figure out the behavior of a program I wrote. My answer got closed and redirected to another question that did feature a similar program to mine, with a similar behavior. But the answer to that question was not it. It was not explaining the wrong behavior on my program ; although it was similar. At the end of the day I did manage to figure out what was happening ; it turns out it was an effect different from the post that was linked. I tried to make an Edit and asked for reopening my question in order to provide the real answer to that question but I think that did not get accepted.

    Actually, now I cannot even find the question in my profile anymore. It probably got removed altogether.

    I agree that the multitude of programming help communities is a problem and my proposition would exacerbate that. But StackOverflow is clearly not the answer for me.