Live data from Hacker News

A Gopher Meets a Crab

miren.dev

71–79 of 79 posts

Re: A Gopher Meets a Crab

#71
post #56
post #53

Earlier quoted context omitted.

Nah, it's an awful way to learn. Especially to learn to be good or great. When you start reading, it helps to have some guidance towards good and relevant books, from e.g. school, mentors, criticism, etc. Then, when you encounter a "bad" book, you have some benchmarks from which you can build your capacity for analysis and critique. (Testing your analysis and critique with others helps, too.) If you start with "bad"…

> Reading slop code is a terrible way to build a mental benchmark for what's good The days of AI only being capable of producing unreliable slop code are long gone.

And yet the examples in this post are of slop code, so clearly they're not that long gone.

Re: A Gopher Meets a Crab

#72
post #67

Earlier quoted context omitted.

Of course I’m asking in good faith. I wouldn’t have asked how you’d implement the same problem yourself if I wasn’t interested. But you also have to understand that it’s very easy for people to say “x is bad” when actual real world problems sometimes require a small smattering of ugly code. So it’s not unreasonable for me (or anyone else) to ask how you’d write a solution to the same problem. Now what I’m trying to u…

Looking at the code briefly, the first example could be written as let msg = timeout(Duration::from_secs(2), receiver.next()).await.ok()??; // not shown in article, but next line of code let Message::Text(frame) = msg_result.ok()? else { return None; }; Looks like the fixed the second issue with anyhow::Result

Thanks for sharing. I’ve learned something.

Re: A Gopher Meets a Crab

#73
post #57

Earlier quoted context omitted.

I don't think it's a memory thing. The original rust compiler was written in OCAML. I think it's closer to an ML personally because of the strong focus on the type system rather than the chr* magic of c/c++. Over the years c++ has been influenced to offer things people like from rust. So modern c++ looks a little more like rust. But older c++ really doesn't. Similarly rusts approach to dynamic dispatch is more like O…

I think the crux of our disagreement is this: How much familiarity do you need to be starting from scratch? In a later comment you said the following: > You aren't starting from scratch in the same way that if you have written javascript you aren't starting from scratch writing c++. But I’d argue that you wouldn’t be starting from scratch with C++ as a JS developer either because you already understand all the fundam…

Go stick a backend c++ ticket infront of someone who has never written it before but only knows javascript. Give them a PR with issues in it that aren't really whack. Ask them to do a code review. I would wager on the results in favor of them not being proficient in reading the code.

Now do the same with typescript. I bet they have a fighting chance.

Re: A Gopher Meets a Crab

#74

Earlier quoted context omitted.

If you already speak French or another Romance language it isn’t a bad idea to just have a conversation in Spanish directly and then ask for clarifications anytime you don’t understand.

Which would be all the time? At which point you might be better served by learning from a source that has any guarantees of being correct and doesn't hallucinate. Like text books that have had several editions and are free on the Internet.

[deleted]

Re: A Gopher Meets a Crab

#75

Earlier quoted context omitted.

If you already speak French or another Romance language it isn’t a bad idea to just have a conversation in Spanish directly and then ask for clarifications anytime you don’t understand.

Which would be all the time? At which point you might be better served by learning from a source that has any guarantees of being correct and doesn't hallucinate. Like text books that have had several editions and are free on the Internet.

Maybe you are slower than me then. I can pretty much understand almost everything in a similar programming language that I already know.

Do I know exactly why X was choosen instead of Y? Do I know best practices? Do I know best libs etc? No, that is the reason to ask about it.

Re: A Gopher Meets a Crab

#76
post #29

Earlier quoted context omitted.

I would be very surprised if you couldn’t figure out what was happening in one C-derivative language when you’re already competent in another C-derivative language. This isn’t like learning JavaScript and then expecting to be an expert in Prolog.

The first time I looked at rust code that wasn't in tutorial I was pretty confused. Things I thought I understood I really didn't. I knew maybe 6 programming languages including some c. A lot of people struggle to learn rust because it's an ML as in OCAML and really isn't much like C at all. Some people adapt to it more easily, especially coming from languages like scala but it has a lot of unique characteristics tha…

And you understand 0% of the rust code? You could not understand anything? Wow.

Re: A Gopher Meets a Crab

#77
post #57

Earlier quoted context omitted.

I think the crux of our disagreement is this: How much familiarity do you need to be starting from scratch? In a later comment you said the following: > You aren't starting from scratch in the same way that if you have written javascript you aren't starting from scratch writing c++. But I’d argue that you wouldn’t be starting from scratch with C++ as a JS developer either because you already understand all the fundam…

Go stick a backend c++ ticket infront of someone who has never written it before but only knows javascript. Give them a PR with issues in it that aren't really whack. Ask them to do a code review. I would wager on the results in favor of them not being proficient in reading the code. Now do the same with typescript. I bet they have a fighting chance.

You really think a senior C++ developer with 10 years experience and a mastery of C++ could not wing it and solve a JavaScript ticket even if they don’t have any JavaScript experience? Where they can ask a JavaScript developer about existing code.

Re: A Gopher Meets a Crab

#78
post #60
post #58

Earlier quoted context omitted.

They might share some paradigms (focus on low level optimization) but they aren't the same. Go focuses on heavy runtime, looser type systems, and all the benefits and drawback that brings.

That’s not what people mean when they talk about paradigms in programming languages.

Ok, but still they share some programming language paradigm, but not all. They both are imperative, concurrent and functional, but Rust is generic, Go is not. Rust is structured, Go is OO.

Re: A Gopher Meets a Crab

#79
post #78
post #60

Earlier quoted context omitted.

That’s not what people mean when they talk about paradigms in programming languages.

Ok, but still they share some programming language paradigm, but not all. They both are imperative, concurrent and functional, but Rust is generic, Go is not. Rust is structured, Go is OO.

...which is basically a convoluted way of agreeing with me that there is shared knowledge one can call upon when moving between those two languages.
Post reply on HN