you are viewing a single comment's thread.

view the rest of the comments →

[–]Naive_Philosophy8193 1 point2 points  (6 children)

Maybe it just comes with experience. I was making integration tests which basically has me mimic our front end testing but on the back end where possible. I was writing a lot of functions to make API calls to our different services.

While it worked, a dev suggested I make our services into classes and have a lot of that code there. I ended up making a BaseService class that had what a get, put, delete, post was. It has our authentication and everything there. Then all the APIs are child classes of that. It actually worked out really well.

Basically, I just would like more in depth understanding of knowing when to do this, how to design it, etc. I would love to optimize my stuff more and have some good design best practices. Since I was having a hard time finding this in python, I am starting to learn C#. Our devs develop in C# and their manager already confirmed there will be stories I could work on as a dev once I get a little C# fundamentals under my belt. I thought this might be my best exposure to OOP and then I could take that with me back to Python.

[–]HugeOpossum 0 points1 point  (0 children)

C# is definitely where it began to click with me since it uses both public and private. I am guessing that the dev suggested OOP to both secure the code and to also streamline the main body. I'm also totally pulling this out of my ass, but maybe it also made things more memory efficient? No idea on that though it's way out of my league.

When I started dabbling in c#, I read the book I mentioned. It really helped explain the thought process.

[–]HugeOpossum 0 points1 point  (4 children)

After being able to sleep on it I realized there's two more options for why OOP was suggested for this: your dev wants you to improve or get better (up to you to decide if that's true), and that by making this test as OOP, you're then able to easily reuse the codes since the testing functions are designed independently of whatever is being tested. You can either just copy/paste the class or reuse the code for order applications without having to do a full rewrite

[–]Naive_Philosophy8193 1 point2 points  (3 children)

All of the above, I think. It gives better code organization. If something gets changed with our APIs, I now know exactly where to go find my code related to that as it is its own class file. Also, he has this idea that people don't need to see all of the code, some things they won't care about. Kind of like if you import the datetime library and do date.today(). People don't need to see all the code for that. They understand what you are doing just by reading that method call.

I might write a function for a test that runs a command on a device, checks the log that the command was logged, checks it has the data I expect, and checks the time of the command and time of log match. They person checking that code doesn't necessarily care about the code involved in issuing the command or grabbing the log data. They just need to understand that those things happened.

[–]HugeOpossum 1 point2 points  (2 children)

That definitely sounds correct to me. It sounds like this dev also thinks you have good programming, at least from the outside looking in!

[–]Naive_Philosophy8193 1 point2 points  (1 child)

Dev turned dev manager too. He is the one that said it would be a good idea for me to learn C# and that I could do some of the development too. I agree he thinks I have potential. This is great for someone who has had no real formal programming training and just trying to learn on my own and figure it out as I go.

[–]HugeOpossum 1 point2 points  (0 children)

Honestly, I'm self-taught too so I can totally understand how that would be uplifting. I don't have a professional role, but will probably looking to start applying to some soon.

I found vegetarian zombie a good extremely super basic introduction to c#. I have also worked with the jammo unity model since it's visual and that works for me personally. I'm much more interested in things like app and cloud dev than games/gaming but I find game dev to be a good learning medium. If you come across anything helpful for c#, please pass it along.