• 1 Post
  • 22 Comments
Joined 1 year ago
cake
Cake day: September 1st, 2023

help-circle

  • First of all, you can totally do it! The field is massive, but also full of very bad programmers, and seeing how you were able to write a coherent text of three paragraphs, that already puts you ahead of the curve. Determination and perseverance is key.

    I would suggest to play to your strengths. Java is still Java. Most of the progress since the 1990s was in the libraries and tooling, which only recently have become passable. The language itself also evolved somewhat, but there’s nothing that you won’t pick up in a couple of days of working with it.

    Start with [1], work through all the boxes that are unfamiliar to you, practice a little on a pet project, or an open source project, and you’ll land a job in no time.

    [1] https://roadmap.sh/java


  • You likely have a mental model of Subversion, so what I would suggest is to try to forget as much of it as possible first, as Git is very different.

    Take a tutorial that is aimed at Git beginners, e.g. [1]. This will help you start building a new mental model as well as get first practical experience.

    After that, read the official docs starting wtih the object model[2]. The reason why many people struggle to get into git, especially after using other VCS, is that it was built from the ground up, without much regard of the established conventions and terminology. Linus Torvalds once mentioned that he used his experience designing file systems when developing git.

    So the object model of git is very simple, but also not intuitive. However, once you understand it, everything will start making sense, including the xkcd you’ve linked.

    [1] https://gitimmersion.com/ [2] https://git-scm.com/book/en/v2/Git-Internals-Git-Objects











  • I would argue that having distinct match and search helps readability. The difference between match('((([0-9]+-[0-9]+)|([0-9]+))[,]?)+[^,]', s) and search('((([0-9]+-[0-9]+)|([0-9]+))[,]?)+[^,]', s) is clear without the need for me to parse the regular expression myself. It also helps code reuse. Consider that you have PHONE_NUMBER_REGEX defined somewhere. If you only had a method to “search” but not to “match”, you would have to do something like search(f"\A{PHONE_NUMBER_REGEX}\Z", s), which is error-prone and less readable. Most likely you would end up having at least two sets of precompiled regex objects (i.e. PHONE_NUMBER_REGEX and PHONE_NUMBER_FULLMATCH_REGEX). It is also a fairly common practice in other languages’ regex libraries (cf. [1,2]). Golang, which is usually very reserved in the number of ways to express the same thing, has 16 different matching methods[3].

    Regarding re.findall, I see what you mean, however I don’t agree with your conclusions. I think it is a useful convenience method that improves readability in many cases. I’ve found these usages from my code, and I’m quite happy that this method was available[4]:

    digits = [digit_map[digit] for digit in re.findall("(?=(one|two|three|four|five|six|seven|eight|nine|[0-9]))", line)]
    [(minutes, seconds)] = re.findall(r"You have (?:(\d+)m )?(\d+)s left to wait", text)
    

    [1] https://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html

    [2] https://en.cppreference.com/w/cpp/regex

    [3] https://pkg.go.dev/regexp

    [4] https://github.com/search?q=repo%3Ahades%2Faoc23 findall&type=code





  • I’m not necessarily disagreeing with you, but that estimate could have been wrong by a factor of 10 easily. The idea of an “average video” being 50MB, for example, is questionable: at typical bitrates of 1080p videos this would amount to about a minute-long video. I don’t think that’s an average video at all. It also doesn’t account for many things, for example the cost of replicating new videos to the CDN.

    I also don’t find the idea of YouTube not being profitable ridiculous or hilarious. YouTube definitely wasn’t profitable before monetisation, and Google used to run it for prestige and data collection purposes at a financial loss. They clearly have been trying to make it more profitable, but whether or not they have crossed the break-even point in the past or are still hoping to cross it in the future is not as clear to me as it is to you.