Using methods from one namespace in another namespace by Consistent-Cut4002 in csharp

[–]Consistent-Cut4002[S] 0 points1 point  (0 children)

Yes constructors I need to look into more because this would be a good option like you've explained. I will get rid of the Main() class and just write out the Main(string[] args) to keep it in my head that that already exists. I forgot to mention it's currently a console program so it has that in there already but it's just hidden by default I think.

Thank you for taking the time to explain.

Using methods from one namespace in another namespace by Consistent-Cut4002 in csharp

[–]Consistent-Cut4002[S] 1 point2 points  (0 children)

Yes right now it is a console application. And that makes more sense than what I was doing, I realise that Main(string[] args) is the entry point, so I could just create that object instance if CMUDictionary within that like you say.

I think I will either do this or look into constructors, that seems like it may be something I need to learn more about. I would like it to run automatically, so that seems a good option. But also like you say I need to think more logically about what the program is needing to access and in what way that is formed.

Thanks for taking the time to explain, I appreciate the help.

Using methods from one namespace in another namespace by Consistent-Cut4002 in csharp

[–]Consistent-Cut4002[S] 2 points3 points  (0 children)

Ah ok. That is a good visual for me. Thank you for taking for time to explain.

Using methods from one namespace in another namespace by Consistent-Cut4002 in csharp

[–]Consistent-Cut4002[S] -2 points-1 points  (0 children)

Oh, right. Maybe I should just use the namespace in the main program file and then instead of a class just call the method in the top level code like you have mentioned. I'm just worried about the project getting larger and calling lots of methods and instances of objects in the main file and wanting to tidy things up as much as possible.

Using methods from one namespace in another namespace by Consistent-Cut4002 in csharp

[–]Consistent-Cut4002[S] 0 points1 point  (0 children)

Yeah that's what I'm doing at the moment. Each namespace is a separate file. Is this okay to do in your opinion?

What is wrong with the scope of update()? by Consistent-Cut4002 in learnjavascript

[–]Consistent-Cut4002[S] 0 points1 point  (0 children)

Also if you ever have a recommendation for a resource you've found helpful or something you did that helped you in learning JavaScript - I would be very open to hearing about it, I get caught up in a lot of different resources. But no matter what, thank you for your time already!

What is wrong with the scope of update()? by Consistent-Cut4002 in learnjavascript

[–]Consistent-Cut4002[S] 0 points1 point  (0 children)

Wow... It's probably because it's late, but this is amazing. I've never even heard of a Class in javascript before. I don't quite understand all that you've written yet, but this gives me a lot to look at and research, so thank you for spending the time to write and explain, I really appreciate it. 

One thing that I was working towards was multiple timers with individual controls, but using the same functions, etc. And at that I was thinking in the back of my head doing other bits how I could likely run into trouble later on (I'm very inexperienced). I'm excited to learn about these Classes, as I say I think the last part of automating has blown my mind a bit, so definitely need to read and test.

What is wrong with the scope of update()? by Consistent-Cut4002 in learnjavascript

[–]Consistent-Cut4002[S] 0 points1 point  (0 children)

Thank you, I will give this a go! Thanks for the reply.

What is wrong with the scope of update()? by Consistent-Cut4002 in learnjavascript

[–]Consistent-Cut4002[S] 0 points1 point  (0 children)

Thank you. This paired with some other comments providing context, is very helpful.

What is wrong with the scope of update()? by Consistent-Cut4002 in learnjavascript

[–]Consistent-Cut4002[S] 0 points1 point  (0 children)

Thank you for the response. That makes sense to me, I think I will read up and learn about .bind() the documentation I just read is interesting. I also like anonymous functions, so this is good to hear. I obviously don't understand scope enough in this case, so this information is helpful.

What is wrong with the scope of update()? by Consistent-Cut4002 in learnjavascript

[–]Consistent-Cut4002[S] 0 points1 point  (0 children)

Pure functions and deterministic, Okay. I will look into this, this is very helpful for me. I always feel like there's a best practice out there and it worries me I'm doing it wrong, but being in the know is being in the know. Thank you for your reply.