Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

General programming discussion

x_c_x

Coder
I'd appreciate some help with the following questions for my further understanding of programming/how to's/dont's, the like. Even if some of you can share your testimony of how you understood some of these topics in your journey would also be helpful to me. If this is posted incorrectly please advise, too. =).

Why are some code statements in various languages started as values in some defined variable (e.g. let v = document.getElementById('id'); in JS, for example)? Is this necessary for the script to work?

Is simply learning a language (from novice to advanced) going to give an understanding of writing some third party utility for Windows? Better yet, how does one understand from just learning a language (and practicing it/projects, of course) that one can write a program that will communicate with registry keys in Window, let's say? None of my programming knowledge understands things like this! Lol.

If I want to run programs outside of my editors, does this require converting my source code files into some executable types?

Thanks again and code for good! =).
 
Why are some code statements in various languages started as values in some defined variable (e.g. let v = document.getElementById('id'); in JS, for example)? Is this necessary for the script to work?
You should assume so. If a script has stuff that is not necessary, it is badly coded.
Is there something you do not understand about the general concept of declaring a variable and assigning a value to it ?
Is simply learning a language (from novice to advanced) going to give an understanding of writing some third party utility for Windows?

No. Languages typically do not offer much operating system functionality except for basic low-level things like file handling. In most cases you'll also need knowledge of the necessary API's (Application Programming Interfaces), packages or modules that can do the things you want.

Better yet, how does one understand from just learning a language (and practicing it/projects, of course) that one can write a program that will communicate with registry keys in Window, let's say?

"Just learning a language" does not give you these specialized skills. You need to know the basic concepts of the registry, and typically you will need an API, package or module. Because programming languages are most often platform neutral. Having said that, C# offers just about any interface to Windows you could wish for, right out of the box.

If I want to run programs outside of my editors, does this require converting my source code files into some executable types?
Depends on the language. Python, Node.js or bash scripts for example can be directly executed by the respective interpreters. C, C++ and C# programs need to be compiled into executables. Java needs to be compiled into class files that can be executed by the Java Virtual Machine.
 
Is simply learning a language (from novice to advanced) going to give an understanding of writing some third party utility for Windows?
Even though I've been there, I'll never understand what it is with beginning programming and wanting to jump straight in at the deep end.

@cbreemer summed it up perfectly: if you want to write utilities for Windows/MacOS/Linux/etc. you'll need to learn the APIs/libraries for those systems. But before you do that, you need to invest a significant amount of time into learning the language and also spend a good amount of time practicing it. If you think it's possible to start learning a language and jump straight in at the deep end once you know how to write a function, then you're setting yourself up to fail in two minutes.

When you're learning a language, don't do what I did which was try to understand every single little detail: you'll fry your brain and you'll kill your passion for programming quickly. It's enough to have a general understanding of a concept and once you've got some practice with it, then feel free to go more in-depth with it. But the little things like how values are assigned to variables - don't get caught up with them, you're wasting your time(unless you're trying to write another language which we don't need).
 
You should assume so. If a script has stuff that is not necessary, it is badly coded.
Is there something you do not understand about the general concept of declaring a variable and assigning a value to it ?


No. Languages typically do not offer much operating system functionality except for basic low-level things like file handling. In most cases you'll also need knowledge of the necessary API's (Application Programming Interfaces), packages or modules that can do the things you want.



"Just learning a language" does not give you these specialized skills. You need to know the basic concepts of the registry, and typically you will need an API, package or module. Because programming languages are most often platform neutral. Having said that, C# offers just about any interface to Windows you could wish for, right out of the box.


Depends on the language. Python, Node.js or bash scripts for example can be directly executed by the respective interpreters. C, C++ and C# programs need to be compiled into executables. Java needs to be compiled into class files that can be executed by the Java Virtual Machine.
Great info, cbreemer. Thanks! To answer your question, there is but, I don't know what! Lol. I understand variable declaration/initialization/definition. What I struggle with regarding variables is when to use them. And even this is particular to mid-program, let's say. I understand the declarations/definitions at start (top) of programs, typically. Thanks again, both! =).
 
@x_c_x, what is it you don't get about when to use variables? Variables are simply used when you want to store a particular piece of data, rather than having to write out the value of that data all the time. This is handy when we wish to recall information later in our program, do calculations, and also store information on the user's computer.

If you store a variable midway through a function, it simply means it won't be available to the earlier parts of the function, whereas storing it at the top makes it available to the entire function. It's all a matter of where and when you want data to be available in a function.
 
Back
Top Bottom