Skip Navigation
I'm Not Participating in This Year's Advent of Code For Very Good Reasons
  • 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

  • Programmer tries to explain binary search to the police
  • 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.

  • How are you all playing these insanely complex games?
  • For a first time don't try to get the strongest character possible. It's a time sink to do that. Usually the main campaign of games are beatable even if you screw up something. The worst that can happen is you backtracking a bit and spending time to level up before doing the next quest.

    When you played the game once and got used to the mechanics you can make a 2nd char and plan it more deeply ahead if you wish. You know what mechanics you like so the prospect of finding what to invest in what is worth etc.. becomes more streamlined. But you don't have to. You can just be happy to have finished the game and call it a day.

    That's what I did for Diablo 4. After the main campaign I did not feel like venturing more into the game or making another character so I started playing another game. If you really want to 100% a game it does require a ton of time and planning but you don't have to

  • 280 million e-bikes are slashing oil demand far more than electric vehicles
  • On the world’s roads last year, there were over 20 million electric vehicles and 1.3 million commercial EVs such as buses, delivery vans, and trucks.

    But these numbers of four or more wheel vehicles are wholly eclipsed by two- and three-wheelers. There were over 280 million electric mopeds, scooters, motorcycles, and three-wheelers on the road last year

    There are about 20x more e-bikes than electric cars. Of course its going to demand more oil.

    The real question is what is best in terms of oil demand between electric cars and e-bikes

  • Push Ifs Up And Fors Down
  • Agreed that some people can find it easier with explicit names - however some people find it easier with short meaningless names as it makes them focus on the abstraction rather than the naming. There is no right or wrong here. It all depends on the reader.

  • What's the biggest change you would like to see in computing/tech?
  • A specialized architecture will always be better than a general purpose processor no matter how advanced the tech gets.

    So you will always need a GPU as a GPU is quite literally a Graphical Programming Unit, that is a specialised architecture for Graphical computations

  • What's the biggest change you would like to see in computing/tech?
  • A friend of mine got asked if she had a boyfriend. She asked back "why that question". It was to know whether she would be likely to get pregnant and miss work.

    What a horrifying mentality some companies have

  • Why Git is hard
  • Hot take: Git is hard for people who do not know how to read a documentation.

    The Git book is very easy to read and only takes a couple of hours to read the most significant chapters. That's how I learnt it myself.

    Git is meant for developers, i.e. people who are supposed to be good at looking up online how stuff works.

  • [Blog] Can Rust prevent logic errors?
  • 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

  • [Blog] Can Rust prevent logic errors?
  • 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.

  • [Blog] Can Rust prevent logic errors?

    Cross-posting this here as I saw some misconceptions about Rust language

    I think that blog describes well the pros of using a strongly-typed language like Rust is. You may fight the compiler and get slower build times but you get less bugs because of the restrictions the language imposes you.

    The biggest con of Rust is that it requires learning to be used, even for someone who has already programmed before. It's not like Python or Ruby where you can just dive in a code base and learn on the go. You really need to read the Rust book (or skim through it) to get through the notions. So it has a higher entry level, with all the misunderstandings that come with it.

    4
    What got you into coding ? (aside from money)
  • When I first got daily access to internet (back in 2009), I got curious about how programs are built. Like, if I wanted to make my own application, what should I do?

    I googled something along that direction and it linked me to a famous french website for learning programming (site du zéro) where I learnt C language.

    After the course I made a 2D Snake game with SDL2. How naive was I to think I could write it in one go without testing anything in between! I scrapped the 1st attempt because it was a disaster and randomly inserting/removing * was not helping.

    I started again from scratch, testing in smaller steps, and I really liked it. After a couple of weeks I had my Snake game working! I was so proud of it that I showed it to my mom. I do not have the source files anymore but I still have the binary somewhere

    Afterwards I sticked with it and continued programming - I was back in school without much access to internet so I programmed on my TI-83+ instead. Eventually I pursued computer science studies then a PhD.. It got me hooked real good.

  • Where will we all be(e) next year?
  • About your specific example I find the Rust code to be much simpler to understand than your equivalent Golang code..

    To understand the Rust code I just have to understand each case. 0..1 returns false. Ok. 2..n returns true iff no divider was found between 2 and n-1. Ok the function is primality test

    The Golang code is much harder. I do not take into account the division by 2 because its not part of the original Rust code.

    A for loop starting at 2 that look for divisors. Then the return value > 1. Why is it OK to just return value > 1? Oh that's because the loop did not return. Why did it not? Either no dividor was found or we did not get into the loop at all. If value > 1 we have the guarantee the loop was executed so it's really a primal number. If value <= 1 it is either 0 or 1 which are not primal. Ok, so we return value > 1.

    I think people dislike Rust because it has a lot of functional languages constructs and people are not used to code in functional languages.

    Whatever you fight in Rust you end up saving time by avoiding runtime bugs that would have plagued your productivity anyway. I'd much rather have a language with a hard entry but with solid and maintainable code rather than fast-written spaghetti that no one knows what it is supposed to do 2 years after.

  • Super Productivity - Keep Your Life Organized
  • 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

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

  • Removed Deleted
    *Permanently Deleted*
  • This is such a basic functionality. It does not deserve advertisements, it should have been there from the start.

    and it's not locked behind a paywall

    Are we supposed to cheer?

  • Say I want to make an app on my phone for personal use. How to begin?

    Hello there,

    I am an experienced programmer. I can do C/C++/Rust/assembly/Ruby/Perl/Python/ etc.. The language itself is not a barrier.

    The barrier to me is that I have never coded a single web or android application. I guess it must be surprising but I am more of a low-level programmer in my job (I develop a compiler backend) and I never really had the opportunity or idea to work on an app.

    What would be a good starting point for making an android application?

    A quick search got me this: https://google-developer-training.github.io/android-developer-fundamentals-course-concepts-v2/unit-1-get-started/lesson-1-build-your-first-app/1-1-c-your-first-android-app/1-1-c-your-first-android-app.html

    Would it be a good starting point?

    Side note: my app will not have to interact with any service. If I were to code it as a command-line program, it would not take me more than a day or two. The actual app would involve (for now) no more than a text field, a button, some logic attached to it - the hard part for me being to choose a framework to build it, "upload it" to my phone and use it.

    26
    Should we create a community for programming help?

    I used to be a lurker of r/C_programming where people would ask questions and get answers. It mostly consisted of students wanting to get a human answer to their problem.

    I liked chiming in there and answering from time to time. Although you always had that one student who ordered to do the homework for them, there were some nice and helpful interactions in that subreddit.

    Would people be interested in a community focused around helping each others in programming? Or would this very community do the job already?

    11
    InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)PO
    potterman28wxcv @beehaw.org
    Posts 3
    Comments 92