Better HN
topnewbestaskshowjobs
Log inSign up

codesnik

1,035 karma · joined Mar 11, 2009 (17y ago) · 496 submissions

Submissions

comment 4y ago · link · parent

It's just git's UI is based on operations on the underlying storage instead of workflow intent. From that perspective branch switching and reverting a file are actually similar operations.

For many cases this would be a wrong approach. But git's storage model is quite simple and elegant, and both gives unlimited freedom in adapting it to your needs and could be dangerous if you don't understand it.

When coaching junior devs on git usage I always start with merkle trees, not with a list of commands to remember. This detour takes 20 minutes, but actually gives intuition to fix even worst mistakes without my help when they happen. I can't imagine the same with any other VCS.

comment 4y ago · link · parent

I sometimes think that staging area could be represented as a special WIP commit instead. Non pushable, automatically squashing. This potentially could cut amount of commands to learn by third. But of course I'm missing something important.

comment 4y ago · link · parent

they don't have to be shallower, just bank angle increase should be slower than usual.

comment 4y ago · link · parent

well, you can scoop green peas with fork with no trouble, for example. I'm sure there're asian people who can do it efficiently with chopsticks, of course, but I just can't imagine, how.

comment 4y ago · link · parent

well, it sure does know how to beep

comment 4y ago · link · parent

so, trams?

comment 4y ago · link · parent

it's not only a code, it's a also current _state_ of the system, no? some kind of root/singleton objects, their instance variables, etc. I mean, for a web application most state should be in a database, but this takes some discipline.

And importing updated code to a live system sounds like a black magic. What happens while it's still in progress? Or does one have to start a new process, like we do in other frameworks? Erlang has live updates, but I imagine live update in smalltalk works very differently. So many questions!

comment 4y ago · link · parent

I always wondered, how do you deploy it? Are you able to use git or other VCS? Are there other developers working on the same image?

comment 4y ago · link · parent

sometimes when I visit twitter, browser or whatever starts to think that Russian twits are actually Bulgarian, and this changes shape of some Cyrillic letters, making text looking somewhat funny to russian eye. T is one of them, IIRC.

comment 4y ago · link · parent

is it low cost, though?

comment 4y ago · link · parent

There're colonies of russian old believers everywhere. Some were assimilated, like most californian ones. Some colonies are still well, in Brazil for example.

comment 4y ago · link · parent

You're talking about iPhone SE2, probably. I'm still using original iPhone SE, and its shape is on every pair of jeans I had in those 5 years.

comment 4y ago · link · parent

I suppose, they were hunted along the way. Humans were already there. https://www.horsetalk.co.nz/2015/03/25/horses-hunted-north-a...

comment 4y ago · link · parent

joke aside, it is a per-tty setting, right?

comment 4y ago · link · parent

All six features listed are very redundant or useless, in my opinion.

Contracts? how they're different or less verbose than plain asserts? what they do better?

"reactive programming"? if remove that strange code editing "replace", just a chain of definitions instead of variables in, say, ruby, gives you basically the same effect.

etc.

What I'd love to see is a language with a first class grammars to replace many uses of regexes or badly written DSL's, like what Perl6 tried to do.

and, somewhat related (both are using backtracking), adoption of some of the ideas of https://en.wikipedia.org/wiki/Icon_(programming_language), not on a whole language level, but in some scoped generator context would be nice for some tasks I had to do.

comment 4y ago · link · parent

some ISPs still to this day try to inject their ads when HTTP is used, especially on mobile. I was very angry when I noticed it first time with my mobile operator. No such luck with HTTPS.

comment 4y ago · link · parent

I sometimes use term "mid-level engineer syndrome", for "too many levels of abstraction in the codebase". It is very common in my experience. And untangling it's usually harder then extracting common stuff from "dumb" code. I usually don't DRY things up until three repetitions. And in test code - try to not DRY at all, copypaste is a friend of readable and mantainable specs.

comment 4y ago · link · parent

then he should test it against ringbuffers, IMHO.

comment 4y ago · link · parent

wow. Does ADA lawyer thing work with whiteboard interviews? I'm only half-sarcastic, I hate my handwriting and this makes whiteboard interviews double hard for me.

comment 4y ago · link · parent

You don't have to sacrifice that simplicity, actually. (And I insist on that simplicity being a wrong type, it'll bite users of your library basically right away, when they try to use it for anything apart from storage/serialisation)

But you can just give an upgrade path! consider something like this:

  class Address
    attr_accessor :street, :city
  end

  class Person
    attr_accessor :address
  end

  class AddressMapper < Shale::Mapper
    mapped_class Address
    attribute :street, Shale::Type::String
    attribute :city, Shale::Type::String
  end

  class PersonMapper < Shale::Mapper
    mapped_class Person
    attribute :address, AddressMapper
  end

  # use like this
  PersonMapper.from_xml("...."); PersonMapper.to_xml(person)
and then, for _dead_ simplicity, you can add another method generate_mapped_class "Person"

which will define that PORO class for user for extra DRYness. API is basically the same, no repetition, but amount of rewrite with new requirements is drastically less.

I'm not asking you to rewrite your library, and I probably won't write and release mine, just saying that considering future self isn't that hard. And yeah, it's a bit of a rant about ActiveRecord from user of Rails, since 2006.

comment 4y ago · link · parent

One of the things that keeps being repeated in ruby land is that domain objects are usually married to storage/serialisation method. At some point of application maturity you'll need some other method of serialisation, some other type casting or conversion logic for your form or something else, but by that time a lot of surrounding code would depend on implicit logic of the original base library. ActiveRecord does this, and your library does it too. Object mappers which can initialize or serialize instances of other classes, including PORO, are much more versatile and future-proof. And API for doing that could look almost the same as yours.

comment 4y ago · link · parent

the same stuff happened long time ago with ruby. I mean, not exactly the same stuff, ruby was perl-inspired from the start.

Nowadays instead of `perl -lne` oneliners I usually make `ruby -lne` oneliners, just for a chance my coworkers could make sense of them.

let's celebrate perl at least for native support of utf-8 strings before it was cool.

comment 4y ago · link · parent

I'm really surprised by this move. Starlink will need as many customers as it can get all over the world, and there're too many countries, even some in EU, who'd want to filter some content, or otherwise would ban terminals. Some are huge, like India. For those declaring that all traffic would go to the in-country land station could work. With that arrangement even China wouldn't totally out of the question. Making spacex free-speech outpost is nice and would create some contraband market for terminals, but...

comment 4y ago · link · parent

sadly, Putin lives in 19th century and wants everyone join him there

comment 4y ago · link · parent

optimizing for simplicity is optimizing costs and speed of further changes. So, basically the same as 1) and 2). Effect isn't immediate, but it's not in a far future.

comment 4y ago · link · parent

I always wanted to ask, why such circle-crop formations are usually in a square greed, instead of hexagonal? is it because it's easier to move tractors and other stuff between them, or is it because land isn't that scare resource as I imagine it?

comment 4y ago · link · parent

I'm just a bit of a fan of Elon Musk. It won't happen by 2028 of course. Price isn't a problem at all at scale, but regulatory pressure will be. If a cargo point-to-point flight will happen, it already will be something, but I don't know of any cargo, military included, that requires such a speed.

comment 4y ago · link · parent

calling many of those a "good reason" is.. I don't have a word. Something brittish probably.

But yeah, just calling it out straight away sometimes shuts down communication, people become combative, and that's not good if you want to fix something eventually.

comment 4y ago · link · parent

To have your own mountain just to dig it up and ponder about stuff! What an usual idea. I'll remember your comment, thank you. Who knows, maybe I'll pass by sooner or later.

comment 4y ago · link · parent

Interesting. I guess that spar wasn't critical https://www.post-gazette.com/local/city/2022/01/28/pittsburg...
1
91011
17