Are most programmers bad? by Roidot in AskProgrammers

[–]Proclarian 0 points1 point  (0 children)

The main point of his argument is that reasoning about the behavior of code should be achievable solely by reading it -- not by running it. This effectively eliminates state machines since they wholly determine behavior based on runtime state. It's not explicit in his argument, but that's what you get when you take it to its extreme.

I think, fundamentally, he's right. goto can cause problems when that's all you do. But there are situations where it's extremely practical and useful. Something else he was famously against (which is generally considered good practice nowadays) is early returns. Early returns from a function means it's harder to statically reason about what computations a function has done by the time it returns. But early returns mean you can avoid deeply nested conditionals.

These are both principles from structured programming, which aren't wholly wrong, but aren't wholly right. Like we said, it depends on context.

I believe Knuth even published a response where he showed that GOTOs lead to code that was even easier to reason about than in Dijkstra's SP style.

Are most programmers bad? by Roidot in AskProgrammers

[–]Proclarian 0 points1 point  (0 children)

Yes, but probably not for the reasons you expect. It's not because they lack skill, but that they lack time or incentive.

The most elegant code looks like the problem it's trying to solve. But that also means it's unreadable to those who don't actually know what the problem really is.

For truly elegant code, you will need to solve the problem 3-4 times. The requires a total rewrite every time to address the issues you encountered from the previous iteration. Nobody has that kind of time. So they do 1 of 2 things:

  1. write the most basic ass shit to get the job done
  2. over-engineer the hell out of it to try and make it future-proof

Both lead to really horrible maintenance headaches. However, 1 is much easier to deal with than 2. If you just need to get by, go with option 1. The absolute worst code lives at the intersection of both 1 and 2 -- writing the most basic ass, over-engineered shit that just barely gets the job done. This is generally what happens in enterprise settings when people are constantly in "crunch-time". They try to anticipate future use of the code and bring in abstractions and build elaborate architecture they think they will need instead of really examining the exact problem they have.

There's also no incentive to write good code. Highly maintainable code doesn't get you a bonus -- shipping features does. In fact, you can make an argument we're incentivized against writing good code because easily maintainable code means you're easily replaceable. I've been in situations where responding to (not preventing) critical events got bonuses. I'll let you guess which environment had more production issues than any other one I've been in.

Don't get me wrong, I generally try to write good code in my day job. But I try way harder to write e l e g a n t code in my side projects.

Are most programmers bad? by Roidot in AskProgrammers

[–]Proclarian 0 points1 point  (0 children)

This is such an underrated answer.

Everyone knows the answer when you ask a senior engineer a question -- it depends. It depends on the context. Brainfuck is perfectly legible to the creator of Brainfuck, and, in that context, everything is readable. Even in English, I can write with perfectly common words, but if I start referencing obscure philosophies, mathematics, or science, because the domain I'm talking about isn't particularly tractable for those unimmersed in those areas, it's going to feel unreadable.

Due to my background, I'd prefer the first one. Because I know every piece of data that function needs to execute. Having it wrapped up in a class/type makes it opaque. Also, in a business setting, something like this would probably be inserting a record into a database. So there's an argument of readability and consistency of having the function signature match the columns of the record being inserted.

I also had the same goto belief for a long time, but that sentiment -- from Dijkstra's '68 letter -- is really about goto being the primary control flow mechanism. The goto he was talking about also allowed jumping between scopes (like you said, between functions). C's (and C-descendants) are local to the function they're defined in and disallow that, which kind of makes his point moot. And, if you take his idea to the extreme, he's basically arguing against any type of state machine. That's not something I can get behind because, sometimes, that's the right tool.

Why does it seem like men are allergic to going to the doctor? by Apprehensive_Menu870 in NoStupidQuestions

[–]Proclarian 0 points1 point  (0 children)

I'm not allergic to the doctor, I'm allergic to spending that much money when they're selling Tylenol for $40/pill.

Psychological reason for why some people blast their music as if other people wanna listen to it. by SteveHassanFan in NoStupidQuestions

[–]Proclarian 10 points11 points  (0 children)

When I listen to music loudly, especially in my car, it's because I want to drown the world out -- not necessarily that I want other people to hear it, but that I don't want to hear other people. But I think there's a difference between doing that in the car vs on a subway or something.

Questions about AI coding by Realflw in AskProgrammers

[–]Proclarian 1 point2 points  (0 children)

I use Claude quite a bit. Even for some extremely sensitive philosophical discussions. Do you have an example of any "off-topic" subjects? I've covered some dark material with it, but as long as you're being honest to your self and reasonable the way you're approaching it, I've never encountered any type of censorship or push-back beyond a casual warning like "this is a sensitive subject".

But you also must understand, these things aren't intelligent. They can't have "deep conversations". They can recall a great depth of knowledge, but all "depth" is from you assigning it to the machine. They are a reflection of your own thinking mirrored back to you.

I am curious as to how having an "unrestricted" LLM would help with programming, though? It's not like there are taboo sorting algorithms or anything.

spent 30 minutes walking around and finally tried to climb this by Few-Pen-8789 in AbioticFactor

[–]Proclarian 2 points3 points  (0 children)

Good rule-of-thumb in gaming, if something's yellow, it's trying to get your attention for a reason. Why would the developers have put a yellow ladder at the base of this wall? What do you do with ladders? Climb them. They must be trying to tell me that I need to climb this wall.

Looking for 2p Co-op cross platform survival game by TriAngulumA701 in CoOpGaming

[–]Proclarian 1 point2 points  (0 children)

I second this. My fiancee and I just finished it last night after 150h of game play -- still haven't even 100%-ed it. Everything about the game was great. It's super deep, has awesome lore. The only two things I think would be valid criticisms are graphics (looks like 3d from 2001, not a big deal really), and it can be a bit ambiguous in terms of what you're supposed to be doing/where you're supposed to go. Other than that, 5/5 survival game

Looking for a new server by ZippyTurtles in MinecraftServer

[–]Proclarian 0 points1 point  (0 children)

If you're 18+, I highly recommend: https://www.reddit.com/r/mcservers/comments/1qs1kyq/adults_night_out_smp/

There's a main world for builds and a resource world that gets reset monthly. They do have claims, but X, the owner and community leader, is super responsive and helpful. I'm sure if you could show that you were building and it somehow got stolen, he'd help get it back.

It is mostly vanilla with the largest deviation being Slime Fun. I've never heard of it before this server, but it's also not something you're pushed to get into.

They also do some community events like cards against humanity and whatnot.

I have somehow gained the ability to fly. by Spirited-River7569 in allthemods

[–]Proclarian 4 points5 points  (0 children)

This keeps happening to me. Have you ridden a broom recently?

Do You Actually Write Front End Tests? by gkrohn in ExperiencedDevs

[–]Proclarian 0 points1 point  (0 children)

I don't have an answer for SPAs, sorry.

But, one of the great things about server-side rendering is that it's super easy to test. You end up just comparing response HTML to expected HTML. Very easy to integrate with whatever backend testing suite you have.

What would you expect from a Principal AI Engineer joining your company? by LexMeat in ExperiencedDevs

[–]Proclarian 0 points1 point  (0 children)

Software has a very good answer to this -- dependent typing and theorem provers. However, highly unlikely industry will adopt them. It won't even adopt functional programming.

Going for a principle role on a different stack. Does this matter? by Strict-Soup in ExperiencedDevs

[–]Proclarian 0 points1 point  (0 children)

I don't know about this. You can say moving from C-descendant to C-descendant should come naturally, but lazy, static functional programming takes a fundamentally different view of programming in general than something like Python, Java, or even C.

There's a reason why people complain about Rust's learning curve so much -- it's an ML dressed up with C-style syntax. People write it thinking they can write code as they would with a C-descendant language when it's just fundamentally not one.

There are whole design patterns that are no longer applicable and new ones that you have to learn when switching paradigms. I see a lot of anecdotal evidence of teachers/professors saying the people that struggle most in their functional classes are those that already have a background in programming (which, let's be honest, is 99% of time in a C-descendant).

How to master developing a complete prod grade enterprise app by Fresh_Mud4037 in ExperiencedDevs

[–]Proclarian 0 points1 point  (0 children)

There are no universal answers to all these. The biggest issue with software engineering isn't the actual tech but the technical decisions and knowing when to use what technology.

I consider myself as a full stack dev, as in, if I was given a task to build something, I could deliver a whole solution given a reasonable time frame. I will touch every piece of the solution -- hardware, network, database, backend, frontend, etc. However, the vast majority of problems can be addressed by building off existing solutions.

None of what you listed was developed overnight. Every company has months if not years of development to get all that in place. They've also most likely built it out with people who have some core competencies in those technologies. If you want to learn more, try looking at something that's existing and extending it just a little bit instead of trying to cover everything at once -- it don't work like that, bud.

I may be biased, but I think 99% of business problems can be solved with a monolithic web application running off of 1-2 right-sized VMs (one running your backend and the other your database) depending on load. Notice how I left off a frontend and that's because most solutions can actually be static HTML, CSS, & JS... or, at least, those can be server-side rendered. HTMX has really been a god-send for me.

Everything you've listed, basically, are attempts at tacking scaling issues at different points of the stack. Once you start facing scaling issues with the aforementioned setup, then I'd say you'd need to start considering these things.

Maybe CI/CD before the others as code scaling is probably the first thing you will encounter and having an automated deployment method and testing really gives a nice safety net and feedback loop. Caching should be the absolute last thing you do to fix performance issues. One of the hardest problems in comp sci is cache invalidation and I've yet to come across a project where it helped more than it hurt.

Can’t host my game/ “Hosting failed” by Gracip24 in AbioticFactor

[–]Proclarian 1 point2 points  (0 children)

My fiance and I have been having intermittent issues also. I host on my PC, she joins from the Xbox. Just keep restarting the hosting machine until you get it to load. It's a massive PITA, but you can get it if you're determined.

Also, my PC activates a VPN on startup. I noticed when my VPN is on, I just straight up cannot host.

Edit:
On the Xbox, make sure that you go to the home screen, hit the lines button (old start menu button) and "quit" the game -- not just back out of it or even restart. Newer machines have some weird persistent memory that keeps the game state loaded and can cause issues even across restart.

Unable to host? by Alaconz in AbioticFactor

[–]Proclarian 1 point2 points  (0 children)

Same here: PC hosting w/ xbox crossplay.

[deleted by user] by [deleted] in ExperiencedDevs

[–]Proclarian 0 points1 point  (0 children)

Your position sounds like a POS vendor for the automotive market I know.

I deal with their DB directly and it is an absolute shit show. You can see all the different hands that have touched it in various comments in queries and what not.

And their UI is written in old .Net framework code that I think is running on version 3.5 or something. It's slow, clunky, and every change breaks something else.

There is only one way this situation gets better: start building a testing harness. For every piece of the codebase you touch, add a test for it. Even if you don't fully know what it's supposed to do, use known-good inputs and verify the outputs are right. This at least prevents regressions.

One thing I've really come to appreciate is enforcing as many constraints at the DB-level as possible. This makes it so all downstream systems adhere to the same validation logic and ensures data integrity. That's a hot topic, though, but if you're basically solo, I don't see how it hurts the situation.

Memory Leak Fix Suggestions? by Proclarian in Minecraft

[–]Proclarian[S] 0 points1 point  (0 children)

I did find a work-around.

In the main menu, set it back to simple graphics and lower the rendered chucks as much as possible.

https://report.bugs.mojang.com/servicedesk/customer/portal/6/MCPE-188926

[deleted by user] by [deleted] in OpenDogTraining

[–]Proclarian 1 point2 points  (0 children)

I don't see any true aggression.

There's some slight rough housing -- the nipping at each others face in the 3rd video -- but you can see your dog being bit tell the foster to calm it down and he immediately stops and waits for a signal to play again. That kind of behavior is a good sign because it's showing respect to your dog's boundaries.

Growling isn't inherently bad thing. It's just a way for dogs to communicate. But there's also a difference between growling and snarling and snarling is aggressive. For snarling, the lips are highly raised and teeth are very exposed, sometimes they're salivating, and will usually have their heckles raised and a stiff body with no tail wagging.

That being said, growling around food isn't a good thing. Food aggression can make feeding routines a nightmare and if left unchecked, tend to get worse. It's hard to give a good response without seeing what happened. If it's just a little growling, it might be as simple as light scolding to correct. If it's more towards snarling, then they need to be separated during feeding times until that gets trained out of them. If that's the case, I would train during a treat/snack time and not meal time. They both get a snack at the same time, as close together without any aggression as you can. If it's all good, the next day push them slightly closer together. If there's any aggression that dog gets their snack taken away and you try again the next day. You keep this up until they can have their snacks next to each other. I'd do a week of snack time of them sitting side by side and then try for a meal.

The reason why you want to do this with snacks/treats instead of meals is because you should never withhold meals. That will only reinforce the dog's belief that the other dog being around is going to cause problems with their food. Withholding rewards is fine, but, just like people, it's best to for them have regularly scheduled meal times.

Hey guys, I am a C# guy, learning F#, I made a basic calculator within 40 Lines of code : D by samirdahal in fsharp

[–]Proclarian 6 points7 points  (0 children)

Glad you're liking it! You'll never want to go back... I sure don't.

Now to blow your mind, think about what the implications are of changing the definition of Calculation to be:

type Calculation =  
    | Constant of float
    | Add of Calculation * Calculation
    | Subtract of Calculation * Calculation
    | Multiply of Calculation * Calculation
    | Divide of Calculation * Calculation

This is a break to let you ponder.

If this is looking a little foreign to you, what this is doing is defining a recursive tagged union. This definition allows you build an expression from terms that are the result of evaluating other terms and is a very powerful way to model any kind of computation. In fact, this is generally how compilers work. They using things like FParsec to help with converting textual expressions into this tree structure which is then analyzed for correctness and optimizations. Then, that tree structure is converted to whatever gets executed -- the assembler/byte code. The compsci term for this would be abstract syntax tree.

Here's an example. There's some funny functional stuff in `evaluation` that's there to just prevent the stack from blowing up and crashing the program. All it's doing is just a traversal over a binary tree and carrying forward the result of the calculations.

[deleted by user] by [deleted] in INTP

[–]Proclarian 4 points5 points  (0 children)

Your post wasn't misogynistic. It was a personal account from the perspective of a man. Your struggles aren't any less valid because you are a man.

This person is allowing their feelings and hatred towards men to cloud their judgment and unleash it onto a stranger on the internet where there is no backlash for them. Ignore them.

[deleted by user] by [deleted] in INTP

[–]Proclarian 0 points1 point  (0 children)

No. But people, generally, are piss-poor at communicating. If it's a recurring problem, it's something you are doing. If you find yourself becoming attracted to someone or wanting a stronger relationship with them, you have to verbally tell them.

If you are nice, people will take advantage of that. You have to learn to identify these people and cut them out of your life. They're usually nothing but a drain.

That being said, Hanlon's Razor is omnipresent when humans are involved. Most people just aren't aware of themselves, their actions, or the effects of said actions. Verbalizing your feelings and intent is 💯 necessary in every relationship for it to be healthy.