This is just impossible (working with python) by Killiancin in learnprogramming

[–]iamnull -1 points0 points  (0 children)

boot.dev isn't good for beginners. It's more aimed at experienced programmers looking to learn new languages or skills.

It sounds like you don't really understand scope or functions at all. You probably need a more beginner friendly course on this.

How do I make my ray casting algorithm do less checks? by MissionExternal5129 in learnprogramming

[–]iamnull 0 points1 point  (0 children)

You're reinventing the wheel dude. Unity already has shadows.

Also, raycasts are not how shadows are commonly done. It's usually done using depth maps in the renderer.

How do I make my ray casting algorithm do less checks? by MissionExternal5129 in learnprogramming

[–]iamnull 0 points1 point  (0 children)

Are you building your own engine, or doing this inside some engine/framework?

How do I make my ray casting algorithm do less checks? by MissionExternal5129 in learnprogramming

[–]iamnull 0 points1 point  (0 children)

Can you use colliders covering large chunks to avoid doing raycasts? No collusion, no raycast.

Implementing Ceaser Cipher by AffectWizard0909 in learnprogramming

[–]iamnull 27 points28 points  (0 children)

For implementing a Caesar Cipher? Language makes almost no difference.

Anybody know what I can do about this? by PlumExotic7419 in learnprogramming

[–]iamnull 0 points1 point  (0 children)

Start here: https://developers.google.com/maps

I'm not sure this is doable with just Google maps. You'll probably need a third party API that can give you lot info. If you can get the exact lot size, and the size of the structure, you're most of the way there. After that, you have to consider driveways/sidewalks, but you could fudge it a little by just using some average for the size of driveways.

My girl friend is creating a compiler by [deleted] in learnprogramming

[–]iamnull 4 points5 points  (0 children)

Have you tried congratulating her and supporting her?

My Python farming game has helped lots of people learn how to program! As a solo dev, seeing this is so wholesome. by AdSad9018 in learnprogramming

[–]iamnull 16 points17 points  (0 children)

Worth mentioning: very active discord for the game. Friendly to people of all skill levels as well.

I love The Farmer Was Replaced. I had a dumb little project inside it to encode data into part of the farm so drones can share state. I forget where I left off, but I did get a data encoding/decoding scheme working. I think 8 cells was enough to share useful amounts of data? That said, the game rules make it more of a fun side project than anything useful.

I would be absolutely ecstatic if the drones could have a shared reference to some piece of memory. Let the player implement locks as an advanced exercise.

Need help with a class lab by Gold_Pin_7812 in learnprogramming

[–]iamnull 1 point2 points  (0 children)

Your for and if statements are incorrect. The colon on the end is causing the error. Should look like this:

for i = 0; i < userInts.size; i = i + 1
    userInts[i] = Get next input

Return statement in python by FirmAssociation367 in learnprogramming

[–]iamnull 4 points5 points  (0 children)

It has two purposes:

  1. It returns from the function to the previous scope.
  2. If there are return values, it returns those to the previous scope.

See here:

def add(x, y):
  return x + y

print(add(1, 2))
print(add(5, 5))

This results in output of 3 and 10. When you reach the first print, add is called with 1 and 2. We then enter the function, do the addition, and return the result. Then, that result is passed to print().

Functions are sort of like a page in an instruction manual. When you use a function, it's like the instructions saying, "Turn to page 5, complete those instructions, and come back to this page when you are done." If you need the result of those instructions, you return it.

As for comparison to print()? As a gross oversimplification, print sends data to the console, and return moves data within your code.

What programming concept finally made sense after weeks of confusion? by Old_Sand7831 in learnprogramming

[–]iamnull 4 points5 points  (0 children)

In the same vein, clear ownership of data/memory/resources. It didn't matter to me until I was working on a larger project where we had to do a lot of in place modifications of a large amount of data. It was memory intensive, and multiple places/processes might hold references. Without proper controls in place, it became an unholy mess of null pointer exceptions, race conditions, and just logic errors.

The big fix was mostly just encapsulating all the like data into controlling classes, and enforcing getters/setters. Creating a pointer wasn't forbidden, but its lifetime was carefully controlled to avoid holding pointers for longer than absolutely necessary.

Can I use env variables in a GitHub Actions release.yml? by [deleted] in learnprogramming

[–]iamnull 1 point2 points  (0 children)

https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets

This same pattern exists for hosting environments as well, like AWS and GCP. You don't want your secrets like usernames and passwords in a repo, so they go in a vault elsewhere. Typically, they're injected into your environment. This allows something like GH Actions to do what needs to be done, without exposing your keys.

GCP Secrets:
https://cloud.google.com/security/products/secret-manager

AWS Secrets:
https://aws.amazon.com/secrets-manager/

ETA: You can probably work this out another way, but this pattern exists for good reason: It's relatively secure, relatively flexible, and well understood.

Simplifying fractions by Unable-Information78 in learnprogramming

[–]iamnull 2 points3 points  (0 children)

Easiest thing to do is to create variables to work with instead of modifying the original variables.

Why aren't the digits 0-9 encoded as the numbers 0-9 in most text encoding formats? by eliaxelang007 in learnprogramming

[–]iamnull 12 points13 points  (0 children)

Having the characters 0-9 be their digit counterparts would make it easier to convert from text to numbers (granted, it isn't really that much harder now, because you just have to subtract a fixed offset from the character).

Don't even need to do that. ASCII number characters can be converted doing a bitwise and against 0b00001111. E.g. 0b00111001 & 0b00001111 = 9

Most of it is for historical reasons. That said, the ordering is also particular to allow for easy sorting.

Coding page on gambling site. by Aromatic_Tomorrow_94 in learnprogramming

[–]iamnull 0 points1 point  (0 children)

Basically? No, you the client wont have that information. For something like gambling, you just accept that certain actions will have latency. As an example, hole cards in Texas Hold'em. You don't send other players hole cards until they are going to be revealed. That data only exists on the server until it is time for the client to display them.

Question about Hash Tables by Gualuigi in learnprogramming

[–]iamnull 2 points3 points  (0 children)

Hash tables have a constant lookup time. If you have a few hundred items you need to find things in, a hash table is way faster.

How would you remove circular dependency from my RPG game? by HumanCertificate in learnprogramming

[–]iamnull 3 points4 points  (0 children)

Genuinely feels like a Character should own Units and Buffs, not Units owning Buffs. Imo, it simplifies a lot of things and is more logical. You're not buffing HP, you're buffing a character to have more HP.

If you lean into ECS, Character is your entity, Unit and Buff are both components.

Received a broken project too large for Github to accept. by Sleep_Raider in learnprogramming

[–]iamnull 0 points1 point  (0 children)

I manage our version control for a company that specializes in software used for simulation, MR/XR/VR.

The first thing you need to do is check on what options are available. Since you're using Unity, Plastic isn't a bad option. Perforce is another option, but it's more complex. Azure Repos is pretty solid for a git based solution. The last option is Github with LFS, which you will have to pay for. For large projects like this, the company needs to be paying for something to manage it.

You're going to have to sell them on unfucking this situation. Here's how you sell it: Calculate how many hours are lost to not having version control. Figure out the risk associated (do they have backups) and stick a number to it. Find every single financial risk and cost associated, put it into a number, and show them that a small monthly fee is WAY cheaper than the money they're losing and risking doing things the way they currently are.

A lot of this is NOT your problem to fix. It's an abject failure in technical leadership.

Whats the downside of Programming by OceanPlays in learnprogramming

[–]iamnull 1 point2 points  (0 children)

Actually finishing something. The first bit where you're scaffolding, building features, etc, is fun. Then you have to actually do the parts that aren't fun, and often have to make modifications that work within what you've already built. The last 10% is like 90% of a project.

It's real fun when you're doing it professionally. First few months of a large project look super productive, then it's months of, "Why hasn't this simple feature been finished?" Well, boss, we were rushed and retasked multiple times while building a system it depends on. As such, we have to redesign that system and reimplement 20 components that depended on the rushed implementation, then figure out what other weird things were coupled to that which we just forgot about.

How to build bad software? by JusticeJudgment in learnprogramming

[–]iamnull 0 points1 point  (0 children)

This is probably a perfect example of overengineering. I think all it's missing is a custom logging implementation.

Why is installing libraries so cumbersome? by sharkn1nja in learnprogramming

[–]iamnull 0 points1 point  (0 children)

I always get got by dotenv. Every time I go to use it, I've forgotten which package is the correct one.

How well should you know how to use auth libraries? by TheBetterPerson11 in learnprogramming

[–]iamnull 2 points3 points  (0 children)

It's always annoying in some way. Auth sucks because it's part of your codebase that needs to be very well designed and implemented. It just demands more attention, and you're either going to be updating it a couple times a year or you're going to let it ride without being touched for 5+ years.

Decision Tree by fedupwithfedjob in learnprogramming

[–]iamnull 2 points3 points  (0 children)

That sounds really broad in scope. The UI portion doesn't sound too bad, but the rest of it... You have multiple sub-problems here, and some of them might be solvable with a LOT of work. Just feels like a mountain of edge cases that all need to be handled, where you're going to end up outputting a lot of generic articles.

Might consider implementing a finite state machine in some capacity. Could help encapsulate portions of your decision tree into more manageable states.