Fully retired now and one of the things I’d like to do is get back into hobby programming through the exploration of new and new-to-me programming languages. Who knows, I might even write something useful someday!

  • 0 Posts
  • 50 Comments
Joined 1 year ago
cake
Cake day: July 4th, 2023

help-circle









  • 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.


  • 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! 😀


  • 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.


  • 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. 😀


  • 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?



  • 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.


  • 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.




  • That IT subject matter like cybersecurity and admin work is exactly the same as coding,

    I think this is the root cause of the absolute mess that is produced when the wrong people are in charge. I call it the “nerd equivalency” problem, the idea that you can just hire what are effectively random people with “IT” or “computer” in their background and get good results.

    From car software to government websites to IoT, there are too many people with often very good ideas, but with only money and authority, not the awareness that it takes a collection of specialists working in collaboration to actually do things right. They are further hampered by their own background in that “doing it right” is measurable only by some combination of quarterly financial results and the money flowing into their own pockets.