HNHacker News
TopNewBestAskShowJobs

sodapopcan

3,244 karma · joined March 19, 2014

submissionscomments
sodapopcan··on Gleam Is Pragmatic
Actually in Elixir when doing string building you want to use "improper" lists which lets you very efficiently build up a string without doing any copying.
sodapopcan··on Gleam Is Pragmatic
Ha, I was going to mention this but there is none. `+` is for both ints and floats. OCaml, which is statically typed, has a separate operators for ints and floats, though.

I don't want to get into it but Erlang is dynamic by design. There have been several attempts to bring static typing to it over the years which have failed. People are still trying, though!

sodapopcan··on Gleam Is Pragmatic
++ is for concatenating lists, it's not the only functional language that uses this.

Really though who cares? `=` is already misused in most programming languages.

sodapopcan··on Rust needs a web framework
For sure, but the article is from the perspective of knowing Rust and wanting to work around, well, Rust. I'm saying if that's what you want, use a language suited for that. Variety is a good thing.
sodapopcan··on Gleam Is Pragmatic
Sorry, the end of my comment is quite reductive. Compiling to JS is pretty nice.
sodapopcan··on Gleam Is Pragmatic
Oh ha, duh me, I did not consider it wasn't invented by Postgres.
sodapopcan··on Rust needs a web framework
"Right tool for the right job," no?

Learn multiple languages.

The whole "I want to do everything in the language I already know" is why the least interesting--and straight-up pretty terrible albeit very capable--languages are dominating our field.

sodapopcan··on Gleam Is Pragmatic
Are there any articles that do a deeper dive into this? I ask because straight up I've been curious about Gleam, but not enough to do a really deep dive because Elixir is too good and, like Erlang, is a very special kind of dynamic language that doesn't leave me feel too lacking.

As I understand it, there have been a few "high profile" attempts to bring static typing to Erlang, all of which gave up when it came to typing messages. Your comment essentially confirms my bias, but is Gleam making real strides in solving this, or is it poised to merely cater to those who demand static-typing with curly braces--everything-else-be-dammed?

sodapopcan··on Gleam Is Pragmatic
Ha, ok so I gotta give one of these "that's a really strange thing to get hung up on" responses.

Erlang and Elixir don't overload the `+` operator. In fact, they don't overload ANY operators. If you can forgive the syntactic choice of the operator itself (which I think it pretty fair considering Erlang predates Postgres by a decade and F# by two decades), this allows them to be dynamic while maintaining a pretty high level of runtime type safety. For example, one of the "subtle bugs" people refer to when criticizing dynamic languages (even strongly typed dynamic languages) is the following would work when both args are given strings or numbers:

    function add(a, b) { a + b }
Erlang/Elixir eliminate this particular subtle bug (and it goes beyond strings and numbers) since:

    def add(a, b), do: a + b
will only work on numbers and raise if given strings.
sodapopcan··on Show HN: I Wrote a Book on Java
Awesome, thanks for the clarification.
sodapopcan··on Show HN: I Wrote a Book on Java
A typed dict is more like what I mean. Obviously I know about classes as I'm no stranger to OO.
sodapopcan··on Show HN: I Wrote a Book on Java
That's what I thought. I obviously don't know Python well enough and didn't know you can name dicts (like, beyond setting them to a variable). I guess you can export from a module so they are prefixed! Didn't think of that one earlier.
sodapopcan··on Show HN: I Wrote a Book on Java
I think I misunderstand OP's problem then.
sodapopcan··on Show HN: I Wrote a Book on Java
Python's not really built for that AFAIK, though. In languages built for it, you can type your dicts/hashes/maps/whatever and its easier to see what they are/know where the functions that operate on them live. I'm most familiar with Elixir which has structs which are simply specialized map (analogous to dict in Python) where their "type" is the name of the module they belong to. There can only be one struct per module, In this sense is easy to know exactly where its functions live and is almost like a class with the very key difference that modules are not stateful.
sodapopcan··on Holding a Program in One's Head (2007)
Oh lordy, I'll bite.

I was responding to your blanket claim that server-side is misguided in general.

I have no idea what you consider complex, but most people pushing toward server side UI are not advocating that it's a one-stop solution, just that it simplifies a large majority of situations that many of us are in which is building CRUD apps. You can even get pretty complex, like say an email client though at that point we're in a grey area where you could kind of go either way. If we're talking something like building PhotoShop in-browser or even a calendar or gantt chart (which I have worked on) then, no, I would not personally advocate server side and instead use a good client-side view library.

The Elixir/Erlang comment was that it makes server-side even easier as you can hop into running production systems and debug them.

sodapopcan··on Pivotal Tracker will shut down
People have very different views on this and there are no rules, but in my view one of the major benefits of pairing all the time is NOT doing code review.
sodapopcan··on Pivotal Tracker will shut down
> I've never been as productive or had that much fun at work.

This was my experience as well.

sodapopcan··on Holding a Program in One's Head (2007)
You’ve clearly never used Elixir/Erlang.
sodapopcan··on Pivotal Tracker will shut down
I never worked at Pivotal but did work in a 100% pairing cultural (it wasn’t forced but our team did it for three years) and I desperately miss it. It’s so hard to find companies that do it.
sodapopcan··on Kagi Assistant
For me, any downside of Kagi is worth dealing with to not support Google.
sodapopcan··on Kagi Assistant
I agree, but they aren't _that_ much better and I'd rather do a little more digging than support Google. I still find what I need and make good money. I can also rationalize it that I'm not always just taking the first result and actually reading multiple solutions to my problem but yanno, YMMV there.
sodapopcan··on Typing lists and tuples in Elixir
> There's the common idiot of returning either `{:ok, ____}` or `{:error, ____}`, but what can be inside the error tuple is not always clear.

That's the result of Elixir being dynamic and not having built-in monads. You always have to check the docs/code.

> The other thing is that sometimes a function can both throw an exception and also return a success tuple.

I would say this is just poor design (though maybe someone could point me to an exemplary use of this?). As I see it (which is from how I've read it described and how most good lib do it):

  - If function can error and the caller can do something about it, return :ok/:error.
  - If the caller can't do anything about the error, raise.
  - If the function can't fail, return a raw value.
sodapopcan··on Typing lists and tuples in Elixir
The wording was a little odd, but there are certainly user-facing errors in 1.17, namely:

- Map keys (called with '.') are checked at compile time.

- Using comparison operators with different types causes a warning.

I may be forgetting something.

sodapopcan··on What About Static Typing in Ruby?
Ruby should likely strive to this:

  def initialize(name => ::String, age => ::Numeric)
    @name = name
    @age = age
  end
or better yet?

  def initialize(name => String, age => Numeric)
    @name = name
    @age = age
  end
I've been out of Ruby for a while so I don't understand by why the top level qualifiers are necessary.
sodapopcan··on I've built my first successful side project, and I hate it
Would love to know from OP and others why this isn't the most sound advice.

I worked for a very small online retail company recently (I know it's not exactly the same but in the same vein) and raising the price for $18—$40 items by $5 had zero affect on the number of people placing (sales weren't amazing but not bad).

But ya, in the first line you say you made $15k over....... FOUR YEARS? Obviously that's a bunch for some people, but certainly not MOST people in tech?? You could have made much more and had a lot more fun bartending or even being a barista.

Having read the whole post... keep it up! Just raise your prices by... like, a LOT! Like, a lot a lot!

sodapopcan··on Apple's requirements are about to hit creators and fans on Patreon
For sure, I was using a simplistic description. My point is that my experience (and it's just my experience) is that many people don't care to understand what a browser is or how to use it properly, they want apps. I stress this is just my experience but I'm one of those people who tries to (unsuccessfully) teach them. They just don't care (though I'm probably a bad teacher).

And yes, see also people who print emails so they can scan them XD

sodapopcan··on Apple's requirements are about to hit creators and fans on Patreon
mmmhmmm, indeed. You need to consider the mentality of the people who chose to live this way. Most don't want want to type an address into a browser, ever, they want to tap an app.
sodapopcan··on Apple's requirements are about to hit creators and fans on Patreon
Me too, but shockingly there are a lot of people who don't have a computer, just a phone. I even know people in their 40s like this.
sodapopcan··on Okay, I Like WezTerm
Nice write up, may try out WezTerm though I only just recently switched to Kitty and I don't like hopping around too often. Correction related to Kitty, though. It does not use either YAML or TOML, it has its own simple config DSL and is otherwise fully scriptable via Python.
sodapopcan··on Python with Braces
Sure but that doesn't quite answer my question: is the parser trick really that bad?

I do see what you mean, of course, and am aware of the arguments but I've never found lack of non-whitespace expression terminator even remotely confusing. I can clearly see indentation in my periphery signalling that it's multi-line. I can also say that in ~13 of using exclusively using semicolon-less languages, I've never had or even heard of a problem caused by someone misunderstanding where an expression ends.

Anyway, this is getting pretty bikesheddy, lol but ya, to each their own, obviously.

← PreviousPage 20 of 34Next →