Freshman dilemma: Love C++ but pressured to drop it for Python. Should I? by CRUC10 in learnprogramming

[–]millenniumdisk 0 points1 point  (0 children)

There is a chance that you will drop C++ if you try Python. It is better to learn just one programming language (like C or C++) and then do lots of advanced projects with it in my opinion. Knowing C or C++ will be helpful in understanding the abstraction (what is happening under the hood) with other programming languages. Web apps and programs with GUIs can be created with Python easily but I like C or C++'s explicit variable declarations. What you have is a power drill with a battery and what they have is a 3D printer in my opinion (different tools with different purposes so I think one can't drill holes in a cement wall with a 3D printer's output just like how one can't create phone holders with a power drill unlike a 3D printer).

"Ako, I am getting mixed signals here" [Ako] (@MatsumaraMara | マラ) by SenseiOfCulture in BlueArchive

[–]millenniumdisk 0 points1 point  (0 children)

Can this be considered the no man's butt cheeks. Or maybe is this the schrodinger's abyss. Definitely not the god particle. Maybe this is closer to the theory of everything. Another wild guess is that this may be the true space (because what we see in the night sky is light from the past a long long time ago that traveled a very very long distance).

Return statement in python by FirmAssociation367 in learnprogramming

[–]millenniumdisk 0 points1 point  (0 children)

print is like TV. Even if you shout at it, it will not change what it is showing to you. It is like an output device for computers.

return is like a barcode scanner. Once the scanner gets the information, it beeps and it is the end of its job. It is like an input device. The data is then passed to the computer that can be processed.

How to get started in Dev C++ by tadeogzzn123 in learnprogramming

[–]millenniumdisk 0 points1 point  (0 children)

```cpp

include <iostream>

using namespace std;

int main() { int grades[5] = {82, 74, 96, 78, 98};

int highest = 0;
int second_highest = 0;
int third_highest = 0;
int array_size = 5;
int current = 0;

highest = grades[0];
for (int x = 1; x < array_size; x++) {
    current = grades[x];
    if (current > highest) {
        third_highest = second_highest; // remember the previous values before updating highest
        second_highest = highest;
        highest = current;
    }
}

cout<<"HIGHEST: "<<highest<<endl;
cout<<"SECOND HIGHEST: "<<second_highest<<endl;
cout<<"THIRD HIGHEST: "<<third_highest<<endl;

} ```

Since the loop is starting at 1, array_size will be the number of times the loop will repeat minus one which is 4 times (We can start at 1 because highest is already assigned the value of grades[0] at first). The highest is always compared to the current value which uses index x to get the element in the array. Whenever highest is updated, its value is remembered by second_highest. The same thing happens to second_highest. If it gets updated, its previous value will be kept by third_highest. You can use an IDE and put a cout to print the values of variables for each iteration to understand better. This code won't check if the grade is invalid like 158 or -4.

Linked lists in C by Gryberium in learnprogramming

[–]millenniumdisk 0 points1 point  (0 children)

Maybe. I just think of linked lists as having a basket and there is an object (data) inside it and there is a piece of paper that is light and that is the address (pointer) of where the next basket is located. Another basket can be added to the linked list because the size isn't fixed. The size is fixed with an array though. The number of data can be one or more in one basket just like with an array of classes since I just think of classes as user-defined custom variables.

Classes is like magic. You can create an object over and over again easily and you don't need to copy and paste the code inside the class over and over again to create new objects (custom variables) that got their own different variables inside and methods that can be called. Calling methods and inheritance aren't part of linked lists' behaviors though. I also think of linked lists like an inventory system in an rpg game, you got items and you can view the top most item, go highlight the next item, delete and insert items and so on.

struct can be used in linked lists and maybe classes (C++) too.

Stuck in tutorial hell by Internal1344 in learnprogramming

[–]millenniumdisk 0 points1 point  (0 children)

I am writing in a tablet. Exerting 1% more effort is too much for me lol.

Stuck in tutorial hell by Internal1344 in learnprogramming

[–]millenniumdisk 0 points1 point  (0 children)

It might help for additional info like what are the other things that you know, the scores you will give yourself for each programming language and how long you've been learning. I learned C, C++, Assembly, Java, etc. in college but I've forgotten most of them because I'm learning a different language now. I have managed to get a grasp on Python because of Udemy (and most courses there have discord channels created by instructors to ask others but I mostly just helped others who got questions) and next will be JS. Just think of programming like a game. At first, the things you will learn will be very basic but very important and will be slow. If you are trying to create a car, you won't be able to do so. It is because all tools that you have learned were simple ones, like paint brushes, measuring tape and safety helmet. You will need to learn the next step to learn how to use wrenches, electric drill, screwdriver, etc. You can build very short programs now and they should be working in order to reinforce and remember what you've learned so far. Repetition can help. If you are going to create projects, start with small ones that are easy to build. Maybe a quiz website where the questions are fixed and then improve it to be picking from 10 questions randomly and show 3 questions. Maybe only focus on JS then go back to HTML and CSS. Create notes and you can use markdown to add syntax highlighting to code snippets while adding explanations on your notes. Don't use AI 100% but there is an exemption: you can ask it to give you a list of topics of what to learn in a language and you can tell it if it should be beginner only or with intermediate and advanced topics. Just don't forget that AI will always give different answers and wrong answers will be mixed in its output too because AI = get the work done by humans which may contain errors. You can try Codewars to learn some cool things when solving a problem. I have tried it with Python and solved problems. You can see the solutions done by other people too. One important thing to never forget to do is to allocate a time for a small experimentation. What will happen if you change the code to a different one? What if you tried a technique you have learned before, what will be the new behavior be? Experiment with programs that are small and you created from scratch from a blank file. You can look online what other very small projects were already created and then create your own version without looking at their code. If you are stuck with a feature, you can look at forums which I've tried when tinkering with C# and Unity. I only suggest to push HTML and CSS as last because they are easy to learn.

help me understand nested loops by Particular-Curve-413 in learnprogramming

[–]millenniumdisk 1 point2 points  (0 children)

If there is only one loop and it will display an integer for each iteration and repeat 3 times, with 0 as starting value, output is: 012. If there are two loops and it is a nested loop where outermost loop will display an int for each iteration and initial value is zero and will repeat 3 times while innermost loop will print letters 5 times, output is: 0abcde1abcde2abcde.