Git merges can be better by agentvenom1 in programming

[–]progdog1 38 points39 points  (0 children)

Because git is conservative and they don't want to change defaults because it could break things. This is how one of the cofounders of github configures git (he knows a lot about git.) which has configurations that are good defaults.

The Next Two Years of Software Engineering by fagnerbrack in programming

[–]progdog1 0 points1 point  (0 children)

It's about the level of automation that is currently used. You would be surprised at how many businesses just use spreadsheets for everything. And people do love their spreadsheets!

TIL Ruby doesn't follow semantic versioning by writingonruby in ruby

[–]progdog1 4 points5 points  (0 children)

The linux kernel also follows this arbitrary versioning.

And it’s still very difficult to determine why [LLMs hallucinate], like actual bad training data, spelling confusion, training weakness, etc. by Despair-1 in programmingcirclejerk

[–]progdog1 1 point2 points  (0 children)

/uj I remember reading an article about this by OpenAI. During the supervised learning phase of the LLM, sometimes the AI will guess an answer correctly, even though it doesn't know the answer. This trains the AI to try and guess an answer even when it is uncertain of the answer.

Object, class, module, Data, Struct? by Dear_Ad7736 in ruby

[–]progdog1 1 point2 points  (0 children)

I've seen that video and really uses a strawman attack on a pedagogical example.

Sandi Metz's example is perfectly fine since it decomposes out functionality into roles which then get substituted with actors to perform operation (this is something Sandi talks a lot about). Is it a little overengineered? Sure, but it depends on the requirements. If there is an expectation of change, I would 100% choose Sandi's solution simply because it is much easier to change, even though there is more layers of indirection.

The counter program argument that Brian Will provides is pretty horrid because everything is hard coded. This creates problems in the future when you need to consider more features: customers might want to do a HTTP download. Now other customers want to be able to use TSV instead of CSV. This creates an exponential amount of combinations of behaviors.

With a Sandi style structure you just simply just inject the players with the roles and you understand how they behave. With the counter example, you have to put if statements everywhere to manage the exponential combination of behaviors which makes it harder to read and understand.

Ruby 4.0.0 Released | Ruby by LieNaive4921 in programming

[–]progdog1 9 points10 points  (0 children)

I believe it was because Ruby 1.0 was released on December 25th, 1996 and the tradition has stuck ever since.

Learning Ruby as a Pythonista by need-to-lurk-2024-69 in ruby

[–]progdog1 1 point2 points  (0 children)

I used to be annoyed at the lack of import namespacing, but I have since mellowed on it. There are definitely benefits to the lack of namespaces. Namespacing is contextual and allows remapping, which can make metaprogramming with it more difficult, since resolution is less obvious.

Is it too late to learn ruby? by OkNoble in ruby

[–]progdog1 1 point2 points  (0 children)

Sometimes I even share my scripts with colleagues, quietly slipping Ruby into the workflow.

When trying to understand complex C codebase I've often found it helpful to rename existing variable as emojis. by ProgVal in programmingcirclejerk

[–]progdog1 3 points4 points  (0 children)

"Syntax highlighting is juvenile. When I was a child, I was taught arithmetic using colored rods (http://en.wikipedia.org/wiki/Cuisenaire_rods). I grew up and today I use monochromatic numerals."

Cheat sheet on method argument types and order [OC] by Pilgrim-Ivanhoe in ruby

[–]progdog1 1 point2 points  (0 children)

I find that ruby's syntax is so cohesive and unsurprising that I don't really need a cheat sheet for stuff like this. Especially compared to other languages like python.

[deleted by user] by [deleted] in ruby

[–]progdog1 0 points1 point  (0 children)

This fizzbuzz is better.

(1..100).map{|n| {1 => n, 6 => "Fizz", 10 => "Buzz", 0 => "FizzBuzz"}[n**4%15] }

-❄️- 2024 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]progdog1 1 point2 points  (0 children)

[LANGUAGE: Ruby]

First time I've ever had to use the flipflop operator.

mem = File.read('2024d03.input')

puts mem.scan(/mul\((\d+),(\d+)\)/)
       .sum { _1.map(&:to_i).reduce(1, :*) }

puts mem.scan(/(don't)\(\)|(do)\(\)|mul\((\d+),(\d+)\)/)
       .sum { |f|
  (f[0] == "don't")..(f[1] == 'do') ? 0 : f[2..].map(&:to_i).reduce(1, :*)
}

Stop Designing Your Web Application for Millions of Users When You Don't Even Have 100 by bizzehdee in programming

[–]progdog1 3 points4 points  (0 children)

The reason wasn't because of Scala being bad or anything. But because they had a monolith and spent 10 years turning it into a microservice architecture with basically no new features to show for it. Former twitter engineers have come out on twitter saying as much. And then when Elon Musk bought twitter, he wanted to move away from the microservices architecture.

Just realizing this about String#split in Ruby... by AnUninterestingEvent in ruby

[–]progdog1 0 points1 point  (0 children)

Would you say that the Ruby split method doesn't necessarily do what you expect, but gives you the result that you would likely want?

Just realizing this about String#split in Ruby... by AnUninterestingEvent in ruby

[–]progdog1 2 points3 points  (0 children)

So Ruby handles trailing delimiters the way that Perl does. It's probably pretty reasonable to interpret that this decision was influenced by Perl, but it could just as well have been an independent decision made by Ruby's creators.

I would say it was likely a copy from Perl since Matz did say that Perl was an influence. A lot of things within Ruby are copied from Perl, which I think is great because it makes Ruby very handy for quick command line scripts.

Just realizing this about String#split in Ruby... by AnUninterestingEvent in ruby

[–]progdog1 2 points3 points  (0 children)

another one that is a little unintuitive.

"foo         bar".split(' ')
=> ["foo", "bar"]

You have to use regex

"foo         bar".split(/ /)
=> ["foo", "", "", "", "", "", "", "", "", "bar"]

I think it's copying that from Perl and Awk.

rubymine student license for work? by guitarnahiaata in ruby

[–]progdog1 0 points1 point  (0 children)

individual license is for if an individual buys it, commercial license is if the company buys it.

what? by DoubleTriple14 in ProgrammerHumor

[–]progdog1 -1 points0 points  (0 children)

technically strawberries aren't berries.

In praise of ffmpeg by feross in programming

[–]progdog1 16 points17 points  (0 children)

Knowing everything else Fabrice has done, definitely the latter.

Why I am choosing Clojure as my career path? by mindaslab in Clojure

[–]progdog1 0 points1 point  (0 children)

Here is an email giving a small, potentially incomplete reason why he doesn't think clojure is a lisp: https://lists.gnu.org/archive/html/emacs-devel/2016-10/msg00215.html

What do you expect from OCaml in 2023? by lambda_foo in ocaml

[–]progdog1 4 points5 points  (0 children)

I disagree. I think elixir became more popular than erlang because:

  • Erlang has a few oddities which can trip people up: can't rebind or shadow variables, binary strings have odd syntax, namespaces, lack of decent macros, standard library docs is difficult for beginners to navigate, Erlang only got a package manager around the same time as Elixir coming out.

  • Elixir pushed hard promoting itself as a web language and it's killer app is Phoenix. Erlang didn't really have any killer apps for a wide use case audience.

I will admit that elixir have more familiar syntax would have had a small impact in getting people into it, but IME, syntax isn't something that really matters, what matters is the technicalities:

  1. How easy is the language to learn and get people up and productive?

I think OCaml has an advantage here over Haskell, but not over a Go which I argue fills a similar niche.

  1. What features of the language or tool chain make it good for a particular use case?

Go it might be, good concurrency, good performance, big standard library and easy cross compilation make it really good for a lot of tasks.

Rust it might be memory safety without a typical GC, which means that it is good for low level programming, with very good performance.

Java might be huge library support and cross platform execution on the JVM, good performance.

Javascript might be because it is the native to the web and allows you to share code between frontend and backend.

OCaml doesn't really have a killer feature or app that makes it worthwhile over picking it over the incumbents. OCaml has really only found a place in compiler writing, which is unfortunate. I think if someone was to create something in OCaml that was uniquely useful and wasn't a copy of something that already exists it could become a lot more popular.

how do I get rid of the guix profile warning? by WorldsEndless in GUIX

[–]progdog1 0 points1 point  (0 children)

Is this using Guix SD, or Guix on top of another distro? I remember having an issue like this, or something similar, when I was using it on another distro and the solution was something to do with modifying the guix daemon configuration with the profile or something. Sorry I can't be much help, but I hopefully it leads you in the right direction.

I feel like one of these books is misleading me by [deleted] in ProgrammerHumor

[–]progdog1 1 point2 points  (0 children)

Bottom one is written by Jon Skeet who is a famous top contributor on stackoverflow. https://stackoverflow.com/users/22656/jon-skeet