jadero

joined 1 year ago
[–] jadero@programming.dev 4 points 8 months ago (2 children)

Add a bit of the right structure and you've got the pseudocode for dead reckoning. (I guess that was probably the point, but I'll hit the ol' post button anyway...)

[–] jadero@programming.dev 3 points 8 months ago

Canada used to recommend 1 car-length for every 10 miles per hour. Along with metrification, that was changed to 2 seconds, but it's been set at 3 seconds for a long time.

I've yet to drive in traffic where even 1.5 seconds is manageable. More space than that and some slips into the gap, even if that leaves something like a loaded tractor-trailer hanging a second off their rear bumper.

[–] jadero@programming.dev 4 points 8 months ago* (last edited 8 months ago)

Edit: Bear with me while I sort out the difference between my display and the resulting code block. Ok, close enough.

Ok, thanks. I would instead (and prefer to ) do something like this:

function test(&obj, &obj2, &a) {
$obj---->doSomething()
---->--->doSomethingElse()

$obj2--->doSomething()
---->--->doSomethingElse()

$a-->--->doSomething()
---->--->doSomethingElse()
}

In this case, the ">" are showing the tab stops and the "-" the resulting white space. Note how all the calls are lined up. (My preferred alignment style, not necessarily anyone else's.)

Yet another edit: I see that I missed addressing alignment on other than tab boundaries. To me, that's just sinful! 😀

[–] jadero@programming.dev 4 points 8 months ago (1 children)

The way you explain it sounds like how tabs works in MS Word ( or other word processors ).

That is exactly how they work, and after 40 years, I still struggle with the whole "tab as a shortcut for spaces" thing. It's not that I started with word processors, either, just that as soon I started working with them, everything got so much easier for me.

There are some code-specific things that keep me from just going back to a word processor, but I think our code editors are missing some useful features that are found in word processors.

[–] jadero@programming.dev 4 points 8 months ago (5 children)

If I correctly understand what you are saying, you are describing "relative" tabbing, where /t moves a constant distance from the current position. I prefer "stopped" tabs where /t moves to the next tab stop. If my /t doesn't create the spacing/alignment I'm after, I just tab to the next position.

Thus, I would set mine with the first tab position (for indenting) at 1.5 cm and subsequent tab stops at 3, 4, 5, ... cm. That way I'd get perfect alignment with both fixed and proportional fonts.

I'd also set line-wrap or line-continuation to use a hanging indent based on the start position of the line being wrapped or continued.

I'd also set a boundary between code and comments so that lines always wrapped before the boundary and using the comment character at the end of a line would jump to the other side of the boundary with optional leaders (the characters, usually periods that connect the end/beginning of a gap). In an ideal world, I would be able to "hide code", pulling all the inline comments into a "hanging indent" structure with their "parent" comments.

Yes, before the advent of IDE editors and all the fancy intellisense stuff, I used word-processing software for coding. 😀

[–] jadero@programming.dev 10 points 8 months ago (8 children)

Why not tabs for both indentation and alignment? (Actually, I see indentation as just a specific use of alignment.) Word processors have been doing it for decades (and typewriters for over a century!). Surely we can convince our code processors to use user-definable, fixed position tabs instead of relative position "tab = x spaces".

Keeping the [TAB] character in the file then allows everyone the layout they like.

Or has working solo for 40 years fried my brain?

[–] jadero@programming.dev 5 points 8 months ago

Me too.

I found that my 2600 t-shirt keeps them at bay. First, they ask what 2600 is, then they make sure that nobody allows me near their computers.

[–] jadero@programming.dev 6 points 8 months ago

I didn't suggest otherwise. I was merely pointing at a couple of examples where some pretty smart, pretty experienced people used Go to successfully implement entire collections of algorithms in some very performance-sensitive systems. It's just by coincidence that I chose those examples because that is where my study is right now. Ask me in a year and I might point to your project as an example when the next person is asking for similar advice.

If Go isn't going to be fast enough to perform your task, then you're probably going to be sorely disappointed when you finally get the performance you're after and then have to stick it at the end of a wire with all kinds of stuff between you and your end users:

Operating systems, databases, hardware, virtual machines, containers, webservers, firewalls, routers, HTML/CSS/whatever, DNS, certificate authorities, more routers and firewalls, ISPs, modems, more routers and firewalls, WiFi connected machines of all kinds, and random browsers implementing any of several different rendering engines.

Quite frankly I can't imagine a language that won't offer enough performance to meet your needs in that environment.

[–] jadero@programming.dev 2 points 8 months ago

The CSS also came, with the idea that HTML should focus on text information while CSS should do so on the visual design.

My biggest beef with CSS is that it's on the wrong end of the wire. What ever happened to the idea that the client is in charge of rendering?

Or maybe it's that the clients have abdicated their responsibility: the browser included with OS/2 Warp had a settings page that let me set the display characteristics of every tag in the spec. Thus, every site looked approximately the same: my font, my sizes, my indents, my spacing, whether images displayed (or even downloaded, I think) and whether text split at an image or wrapped around it. And it's not like I had to customize everything for each site: if you used a tag my browser recognized, my browser took over.

[–] jadero@programming.dev 2 points 8 months ago

I was referring more to the people around me who are outside tech. Based on interactions with friends and family, I'd guess that a little over 50% know what a bookmark is, around 25% actually use bookmarks, fewer than 5% know what RSS is in very general terms and I know only one other person who actually has any RSS subscriptions.

I know people who work in IT who have never heard of RSS!

Just thinking about how far we have to go and how badly trained people are sometimes makes me want to cry. And I'm just a hobbyist; what must I be missing out on?

[–] jadero@programming.dev 7 points 8 months ago (2 children)

Bluesky Social, or at least their PDS (personal data server) uses Go and their Docker package includes Caddy, a webserver written in Go.

I don't know what you're doing, but I have difficulty accepting that Go cannot meet your performance requirements.

[–] jadero@programming.dev 21 points 8 months ago (3 children)
  1. I'm a programmer, so I must know how to get X done in Y software.

  2. I don't use or so I'm some kind of Luddite and can't possibly know anything useful about computers.

One thing that fascinates me about #1 is that the absolute raw dependency people have on Google doesn't seem to ever lead to searching for a tutorial.

view more: ‹ prev next ›