Solemarc

joined 2 years ago
[–] Solemarc 88 points 4 weeks ago (3 children)

My favourite is always;

Lemme quickly write this test, it passes great, if I make this little change it'll fail. It's still passing, damn.

[–] Solemarc 5 points 1 month ago (1 children)

You're not wrong but I think when you're teaching someone just having 1 parent and 1 child class makes for a bad example I generally prefer to use something with a lot of different children.

My go-to is exporters. We have the exporter interface, the generic exporter, the accounting exporter and the payroll exporter, to explain it.

At school, the only time I used inheritance was 1 parent (booking) and 1 child (luxury) this is a terrible example imo.

[–] Solemarc 8 points 1 month ago (5 children)

Same, I always remember this with interfaces and inheritance, shoehorned in BS where I'm only using 1 class anyway and talking to 1 other class what's the point of this?

After I graduated as a personal project i made a wiki for a game and I was reusing a lot of code, "huh a parent class would be nice here".

In my first Job, I don't know who's going to use this thing I'm building but these are the rules: proceeds to implement an interface.

When I have to teach these concepts to juniors now, this is how I teach them: inheritance to avoid code duplication, interfaces to tell other people what they need to implement in order to use your stuff.

I wonder why I wasn't taught it that way. I remember looking at my projects that used this stuff thinking it was just messy rubbish. More importantly, I graduated not understanding this stuff...

[–] Solemarc 6 points 1 month ago (2 children)

It's not as if nothing is being done on GitHub we have both: rust-lang/spec which is being folded into rust-lang/reference.

I'm not sure why we don't have an official spec, I assume that reference was originally for rustc in particular and might include some internal weirdness instead of being a proper spec. Kinda like how gcc has some internal magic that isn't strictly to C spec.

I guess what happened was: spec for rustc -> developed rustc -> ferrocene developed from rustc spec -> "we don't have a generic rust language spec"

[–] Solemarc 87 points 1 month ago

I don't get why we're taking a swing at Linus here. The article only mentions him in relation to the rust for Linux project being slow going. But, it IS going and the US government has only stated that "you need a plan to move to a memory safe language by 2025 or you might be liable if something bad happens as a result of the classics (use after free/double free/buffer overflow/etc.)" but I don't think Linux would count it's free software and it does have a plan.

[–] Solemarc 10 points 1 month ago (2 children)

Well, I'm not American.

In Australia you either bring your own lunch or you bring cash for the school shop. If you have no lunch then the school feeds you from the shop and charges the parents later.

[–] Solemarc 66 points 1 month ago (10 children)

Hang on, does this say "schools charge transaction fees when you pay for lunch online"??? As in, a parent puts $20 on their child's tab for lunch and the school taxes it so the kid only gets $18? That's wild.

[–] Solemarc 2 points 1 month ago

My first programming language was Java and if you're looking to build android apps you only really have 3 options, Java, Kotlin & Dart. Android is built on Java so if you want to learn how android works, I'd recommend Java or Kotlin.

As for learning to program, your best bet is to think of a project and then try to build it. You will inevitably hit a wall at some point and working out how to overcome it is the best way to learn programming IMO.

The classic first apps are "Hello world" and a Todo list. Hello world is just an app which says hello to you on startup, it's hard to make a simpler app. A Todo list app is a note taking app where notes are saved between sessions, and can be deleted or updated.

[–] Solemarc 5 points 1 month ago

I could swear it was higher earlier this year/last year but looking at the survey results, Linux climbed to 2% this survey. I think maybe that half remembered headline was something like "Linux is higher than MacOS at 1.5% market share" or something like that instead?

[–] Solemarc 92 points 1 month ago (2 children)

"You can turn it off", "it's an optional feature", they didn't even last a year! What ever happened to slowly boiling the frog?

[–] Solemarc -5 points 1 month ago (1 children)

I can't be bothered to build them but looking at the releases on GitHub openssl 3.4.0 is 17.5mb and rustls is 2.6mb. both of these releases are source files not binaries but I don't see how rustls could possibly be larger than openssl.

[–] Solemarc 1 points 1 month ago

Docker came about as the answer to the "it works on my machine" problem. What it does is bundle everything your application should need into a box so that you can run it basically everywhere.

For Dev's this also means that if it runs for you it should run for everyone.

Since docker came out we've had a lot of advancement in compilers & interpreters, it's generally pretty easy to compile to another platform today and it's pretty rare for an interpreter to have a meltdown because of your OS. I imagine we'll see less docker going forwards but enterprise is slow moving.

view more: next ›