Ruby website redesigned
171–180 of 224 posts
Re: Ruby website redesigned
#172I thought it would be interesting to try the showcase examples in Raku (since I am always saying how good Raku's imitation of Ruby is)... - https://glot.io/snippets/he42jpfm27 - https://glot.io/snippets/he42trx6w6 - https://glot.io/snippets/he434b6ryj Obviously Raku leans more to `{}` and `my $var` than Ruby - but otherwise I think it does a credible job. Obviously these are carefully chosen Ruby snippets to highlit…
Man. Haven’t thought about Raku for a while. Does it have a good web framework these days?
Re: Ruby website redesigned
#173I thought it would be interesting to try the showcase examples in Raku (since I am always saying how good Raku's imitation of Ruby is)... - https://glot.io/snippets/he42jpfm27 - https://glot.io/snippets/he42trx6w6 - https://glot.io/snippets/he434b6ryj Obviously Raku leans more to `{}` and `my $var` than Ruby - but otherwise I think it does a credible job. Obviously these are carefully chosen Ruby snippets to highlit…
Ex 1
let say = "I love OCaml"
let () = print_endline say
(* Requires linking in the 'str' library *)
let say = Str.replace_first (Str.regexp {|\(.*\)love\(.*\)|}) {|\1*love*\2|} say;;
let () = print_endline (String.uppercase_ascii say)
let () = ignore |> Seq.init 5 |> Seq.iter (fun () -> print_endline say)
Ex 2 module StringSet = Set.Make(String)
let cities = StringSet.of_list [
"London";
"Oslo";
"Paris";
"Amsterdam";
"Berlin";
]
let visited = StringSet.of_list ["Berlin"; "Oslo"]
(* Requires the 'fmt' library *)
let string_set fmt v = Fmt.Dump.list Fmt.string fmt (StringSet.to_list v)
let () =
Format.printf "I still need to visit the following cities: %a\n"
string_set
(StringSet.diff cities visited)
Ex 3 module Greeter : sig
type t
val make : string -> t
val salute : t -> unit
end = struct
type t = { name : string }
let make name = { name = String.uppercase_ascii name }
let salute t = Format.printf "Hello %s\n" t.name
end
let g = Greeter.make "world"
let () = Greeter.salute g
Obviously, OCaml is a much lower-level language than Ruby or Raku–notably, regex support is not as great, and we have to explicitly tell it how to print values of custom types. Still, I find its lack of syntax sugar makes it easy to read nearly any OCaml code I come across in the wild!Re: Ruby website redesigned
#174 cities = %w[ London
Oslo
Paris
Amsterdam
Berlin ]
Do it properly with quotes you lazy people :)EDIT: typical ruby (on rails) code: saves a few characters, breaks readily (Hint: consider "New Orleans")
Re: Ruby website redesigned
#175Earlier quoted context omitted.
Because as a user, I want to change the light/dark of your site, not every set, and not my OS. If you don't have a toggle, you are making assumptions that aren't accurate.
I am assuming that if the user selected a specific brightness mode, they want sites they visit to respect that theme. Call me crazy but this seems like common sense.
Re: Ruby website redesigned
#176Earlier quoted context omitted.
It's a common philosophy for developers with standards of robustness and accessibility to not hard depend on js for things that don't need js to function. > Why the target audience of the ruby, probably primary web developers, whould do that? In my experience, it's mostly web developers who care about this in the first place.
> mostly web developers who care about this in the first place. I’m not sure what you mean by this. We care about our users and how they use our websites. JavaScript is everywhere and has been the de facto frontend standard for the past few years. Supporting no-JS is starting to feel like supporting a new browser. As much as I’d like to, from a business and product point of view, the numbers are just too small for us…
Re: Ruby website redesigned
#177Earlier quoted context omitted.
"Programmer's best friend" is precisely the wrong thing to do though (it says nothing and only makes the reader confused. Are we talking about a language or a pet? I'm not looking for a friend.). They took a step back with that. For reference this is the old one, which is much better: https://www.ruby-lang.org/images/about/screenshot-ruby-lang-... From: https://www.ruby-lang.org/en/about/website/ The old one was bett…
Dunno, it's a comfy tagline. I never got into Ruby but it always feels to me like it's a really ergonomic and cozy language. Sure, the best friend thing is a stretch, but it's honestly a slogan. How many people land on this page with no knowledge of what Ruby is and will confuse it with an app to make friends?
Re: Ruby website redesigned
#178Earlier quoted context omitted.
I am assuming that if the user selected a specific brightness mode, they want sites they visit to respect that theme. Call me crazy but this seems like common sense.
I know some web developers think that that’s true, but looking at the average people I know, they tend to want different settings depending on the site. People don’t generally want computer-wide settings for darkmode.
Re: Ruby website redesigned
#179[flagged]
Re: Ruby website redesigned
#180Bad branding community wise to quote DHH on the frontpage. Will immediately turn away many. He isn’t worth wasting the reputational loss that comes with printing his words.