Trying to decide which programming language I want to learn

Click For Summary
Choosing a programming language to learn can be challenging, especially for someone with a background in older languages like assembly, Fortran, and Pascal. C# and C++ are considered for firmware design, while Python is favored for its ease of use and relevance to gaming, particularly with grandchildren. C++ is noted for its speed and compactness, making it suitable for game programming, but it may require more effort to learn compared to C#. Resources like Visual Studio for C# and various online tutorials can help beginners get started, while microcontroller programming can be explored through platforms like Arduino and Raspberry Pi. Ultimately, the choice should align with personal interests in scientific or gaming applications.
  • #31
pbuk said:
You can't use C# on a microcontroller, the only "advantage" C# (which is a Microsoft product) has over any other version of C is that it can create interfaces that look the same as any other Microsoft product.

You would be much better off with C++, and if you are already familiar with microcontrollers and electronics then this would be a great way to get into it: I recommend one of the Elegoo Arduino kits available on Amazon.
Although C# isn't suitable for writing microcontroller code, you can mix C# and C++ together in the same program.

@yungman, if the last language you learned was Pascal, you'll have a bit of a learning curve with C or C++. Since C is more-or-less a subset of C++, you'll probably have an easier time learning C than C++.
 
  • Like
Likes FactChecker
Technology news on Phys.org
  • #32
Mark44 said:
Although C# isn't suitable for writing microcontroller code, you can mix C# and C++ together in the same program.

@yungman, if the last language you learned was Pascal, you'll have a bit of a learning curve with C or C++. Since C is more-or-less a subset of C++, you'll probably have an easier time learning C than C++.
Thanks, this is the first time I use Visual Studio, that's a learning curve already. I have no interest in Visual Studio, I am going to see how little I have to learn to do C++.
 
  • #33
Since everyone else has gone through all the boring stuff:

You mentioned pascal - you may want to check out Lazarus -I like it for windoze general programming. (its a RAD IDE system based on FPC) You can do impressive things very quickly with it.

and the opposite for smallest and fastest...

To excercise your brain in a microcontroler way (I'm suprised you didnt mention it) : read
https://www.forth.com/starting-forth/
the PDF download seems to be free now. There are many "free" Forths and a couple of commercials ones.
(which may have free variants)

PS I don't think you can really say there are any "new" languages - they mostly seem
to be the same just with different syntaxes to make them appear different. There are probably
no more than about four different types of languages I'd guess but Forth is about as different to those
you mention as you will probably get.
 
  • #34
jack2020 said:
Since everyone else has gone through all the boring stuff:

You mentioned pascal - you may want to check out Lazarus -I like it for windoze general programming. (its a RAD IDE system based on FPC) You can do impressive things very quickly with it.

and the opposite for smallest and fastest...

To excercise your brain in a microcontroler way (I'm suprised you didnt mention it) : read
https://www.forth.com/starting-forth/
the PDF download seems to be free now. There are many "free" Forths and a couple of commercials ones.
(which may have free variants)

PS I don't think you can really say there are any "new" languages - they mostly seem
to be the same just with different syntaxes to make them appear different. There are probably
no more than about four different types of languages I'd guess but Forth is about as different to those
you mention as you will probably get.
I don't dare to say anything about the new language as I have been out of the loop for so long. But yes, that's how I felt when I learned even Assembly, Pascal after I learn Fortran. They are pretty much the same, they work the same way. Didn't take much time to learn the new language even Assembly. It's learning the way computer think...that it is dumb, no common sense, you have to specify everything...BUT, it has infinite patience to repeat the process over and over and over...! Hope I can pick up C++ reasonable fast, I am sure my brain is nothing like when I was in my 20s. Those days, I could pick up new things just like that. Now is like going in one side and leak out from the other side.

I don't get what you mean by "exercise brain in a microcontroler way. You mean designing the hardware? That's very easy, I designed enough CPU boards and microcontroler boards already.
 
  • #35
One of the main selling points of C# is the built in support for GUI development on Windows and other systems stuff. Another selling point is that the popular game development engine (unity) is done using C#. That and compared to C++, it is a little higher level, like it manages memory for you in the background, whereas in C++ you have flexibility to use manual memory management, although modern C++ supports some level of automatic memory management. You need to install the .NET framework, and maybe need specific versions of the .NET framework to be installed along with your program. I never actually used C# before, because I don't care about automatic memory management and don't like the proprietary nature of it, and need to have .NET. There is a thing called Mono, which is an open source cross platform version though.

People complain that C++ is too large and complex, and takes a ton of time to learn the whole thing. There are many details you need to worry about and opportunities to make mistakes. You can do cross platform GUI development pretty easily in C++ using QT. And you can get away with never touching windows API's (which I never, ever want to do) if you use third party libraries. I generally only use cross platform libraries and mainly use linux. You can use glwf to just make windows and do graphics rendering directly, or use a library like SDL. Or you can use the state of the art game engine like Unreal engine. That all said, C++ will require a lot of learning the complexities of the language. It might be a little bit of a drag if you want to do it for fun.

For making games on a Mac, there might be some special considerations, because they keep getting rid of support for stuff and forcing people to use their proprietary API's for certain things.

I agree Python is a good choice, because of the wide array of packages available for things like mathematics, statistics, science, and machine learning. The syntax and overall language is simple and easy to use. It is a really convenient language compared to C++ or C#. It's become one of the preferred language for mathematics researchers, scientists, data scientists, etc. It's slow in the sense that the code you write in Python will not be as fast, but functions can be coded in C or C++ and cuda, and then be used in Python to get all the performance bennefits of the faster compiled language and parallelism. And a lot of the libraries you use have already done that.

Actually, I would suggest considering javascript and then you can use three.js to do graphics/games. The reason is that three.js makes it really easy to do GPU accelerated 3D graphics compared to others, and you can even do VR this way.
https://threejs.org/

You can always learn multiple languages.

For fun, and mental stimulation, a functional language could be worthwhile. They force you to think in a different and pretty neat way.
 
Last edited:
  • Like
Likes atyy and yungman
  • #36
I can see there is a big learning curve already, I have no idea what are QT, glwf , SDL, Unreal engine etal.! I just google these terms, they are about open platform and cross-platform software. What is this? Is it like someone write a big library of subroutine to do things that you can use? For example, someone wrote a subroutine to read from keyboard and another routine to display on the screen. So you just call the subroutine to read keyboard, then do something, and call the subroutine to display on the screen?

I am still trying to learn a little bit more what is Visual Studio. I am an analog, RF and hardware guy. I can only think as far as designing micro controller pcb and program some simple stuff at this point. For this, I don't think I have to call a lot of subroutine from those cross platform stuffs.

Tell me am I right, I am trying to learn the new lingo!
 
  • #37
yungman said:
I am still trying to learn a little bit more what is Visual Studio. I am an analog, RF and hardware guy.
Visual Studio is, IMO, pretty straightforward. Basically it is a development environment with an editor, debugger, and some other tools all combined. With it, you can write code in C, C++, C#, x86 assembly, as well as some other languages.

With your background experience in assembly and Fortran and Pascal, it shouldn't be too hard for you to get started with C++ or C# or C. You might do a web search for tutorials in whichever language you decide to use. Or you mentioned a book you have -- that's a good place to start as well.
yungman said:
I am an analog, RF and hardware guy. I can only think as far as designing micro controller pcb and program some simple stuff at this point. For this, I don't think I have to call a lot of subroutine from those cross platform stuffs.
Cross-platform programming is where you write code in a particular environment that is intended to run on a different architecture and/or operating system. If you're just starting out, I wouldn't advise trying to do anything like that.

I would advise learning about writing functions, though, as monolithic programs are a lot harder to debug. Both C++ and C# extend the C struct concept (called a record in Pascal) to the class concept, a data structure that can contain data members (properties) and function members (methods).
 
  • #38
I am surprised nobody has mentioned it, but Cython seems well suited to what you want. You can even write straight C in Cython if you want. As an old time programmer whose first languages learned were Fortran and Pascal, but spending 20 years of my programming life writing in a language called Natural, when going back to do a bit of programming Python was a breeze. Cython converts your Python to C, which is why you can write your Cython code as C code if you want, but except for speed in critical parts why bother. Personally I do not do that, I use NUKITA (another Python to C compiler, but does not allow inline C) and Luajit - but it's not as compatible with C (it requires the Luajit interpreter) - although interestingly is nearly as fast as C thanks to the highly optimised just in time compiler built into the Luajit interpreter.

See:
https://honnibal.wordpress.com/2014/10/21/writing-c-in-cython/

Thanks
Bill
 
  • #39
yungman said:
I can see there is a big learning curve already, I have no idea what are QT, glwf , SDL, Unreal engine etal.! I just google these terms, they are about open platform and cross-platform software. What is this? Is it like someone write a big library of subroutine to do things that you can use? For example, someone wrote a subroutine to read from keyboard and another routine to display on the screen. So you just call the subroutine to read keyboard, then do something, and call the subroutine to display on the screen?

I am still trying to learn a little bit more what is Visual Studio. I am an analog, RF and hardware guy. I can only think as far as designing micro controller pcb and program some simple stuff at this point. For this, I don't think I have to call a lot of subroutine from those cross platform stuffs.

Tell me am I right, I am trying to learn the new lingo!

You're right.

Code that depends on the operating system tend to be a pain, and need to be maintained to keep working with new OS versions. Regular C++ code is cross platform (meaning it will compile and work on a mac, or windows, or linux, or whatever) but GUI stuff (graphical windows, mouse input etc.) requires low level system dependent stuff. To make your life easier, you can just use a library (just some code developed by others and packaged to be reused), that does that complex and tedious stuff and automatically does it correctly for whatever system you're on.

QT, glfw, SDL, etc. are just examples of some code that some companies or people have written to do some of those types of things. You don't need to know those things unless you want to use them and there are a bunch of choices. So I would just forget about it for now. If you decide one day you want to make a video game with graphics, just start googling to see what is available to make your life easier, or ask for advice on a forum.

To start with, you'll probably just be making console programs and won't require anything extra.

Hallo
I am really having a hard time navigate the Visual Studio. I have been going through the example of "Hallow World" and run Ctrl F5 to look at in command mode and all. I even copy the syntax and all another line "How are you" and display in the command mode. I saved in the desktop folder. I closed the program, I tried to open it and I can't even open it back. I went through the help tab, it is absolutely of no help.

I went on Youtube, there is only one or two on C++ for Visual Studio 2019. They have for older version, but it's not the same. I am going around and around.

All I need is to have explanation how to open an existing file and edit and save and I can't even do that so far.

Any book or site you can suggest? There is only two books for 2019 I can find on Amazon, both are rated very low, I don't want to waste money buying them.

Please Help.

Thanks

I feel for you. I started with Visual Studio as well and hated it. It's like having a control room to run a city when you just want to turn the lights off and on in your house.

Maybe you could just try the command line. Get some text editor like sublime text or notepad++. Then just compile your file directly. Once you want to do a large project, or use a debugger, or profiler, then consider using an IDE?

https://www.sublimetext.com/
https://notepad-plus-plus.org/

You can try from the command line.
$ cl /EHsc yourfile.cpp

Or follow these instructions.
https://docs.microsoft.com/en-us/cp...-cpp-program-on-the-command-line?view=vs-2019

You can also use an online tool just to try running a simple program https://ideone.com/ (you can select from a bunch of languages here as well).

Otherwise, if you want to use Visual Studio as an IDE, have you tried creating a new project? I think it will create a directory for you somewhere and manage all your files for you and everything. I haven't used it in years, so I can't give specific advice.
 
Last edited:
  • Like
Likes yungman
  • #40
Jarvis323 said:
You're right.

Code that depends on the operating system tend to be a pain, and need to be maintained to keep working with new OS versions. Regular C++ code is cross platform (meaning it will compile and work on a mac, or windows, or linux, or whatever) but GUI stuff (graphical windows, mouse input etc.) requires low level system dependent stuff. To make your life easier, you can just use a library (just some code developed by others and packaged to be reused), that does that complex and tedious stuff and automatically does it correctly for whatever system you're on.

QT, glfw, SDL, etc. are just examples of some code that some companies or people have written to do some of those types of things. You don't need to know those things unless you want to use them and there are a bunch of choices. So I would just forget about it for now. If you decide one day you want to make a video game with graphics, just start googling to see what is available to make your life easier, or ask for advice on a forum.

To start with, you'll probably just be making console programs and won't require anything extra.
I feel for you. I started with Visual Studio as well and hated it. It's like having a control room to run a city when you just want to turn the lights off and on in your house.

Maybe you could just try the command line. Get some text editor like sublime text or notepad++. Then just compile your file directly. Once you want to do a large project, or use a debugger, or profiler, then consider using an IDE?

https://www.sublimetext.com/
https://notepad-plus-plus.org/

You can try from the command line.
$ cl /EHsc yourfile.cpp

Or follow these instructions.
https://docs.microsoft.com/en-us/cp...-cpp-program-on-the-command-line?view=vs-2019

You can also use an online tool just to try running a simple program https://ideone.com/ (you can select from a bunch of languages here as well).

Otherwise, if you want to use Visual Studio as an IDE, have you tried creating a new project? I think it will create a directory for you somewhere and manage all your files for you and everything. I haven't used it in years, so I can't give specific advice.
Thanks for clarifying this.

About Visual Studio, it's not about taking time to learn a lot of things, it's their documentation is not right. I read their "Hallo World", it is all over the place. I even type in exactly the added line according to the picture showed and did Ctrl F5. It said 3 errors. I check and I check, I typed it in correctly. There is no explanation on anything, and when the example is totally wrong, it make it very hard to learn.

I decided to go with Visual Studio because it also support C# and Python and other languages. This means even if it is painful to learn, I don't have to learn the second time when I learn another language ( If I want to learn another language!).

Any suggestion on links or books that explain Visual Studio 2019? Seems like it's so new that not many people publish stuffs. I saw a pretty good youtube on 2015, but the it is quite different and I stop watching after about 15 minutes as I cannot follow what he was doing in 2019. The two youtube on 2019 was not good, not only the content are no good, it really doesn't help if both people are foreigners with heavy accent. I am a foreigner, last thing I need is to try to understand someone speaking with heavy accent! No offense!

Thanks
 
  • #41
Books are not very popular in the context of programming, anymore. I think for Visual Studio you can just Google for particular questions. For example, your 3 errors with no explanation sounds like you are looking at the last line of the build report. Visual Studio has an explicit error tab where you get a list of all errors and warnings and can also click on them to jump to the offending code location. Trying to find a picture of it for you I googled "visual studio errors" and quickly came here: https://docs.microsoft.com/en-us/visualstudio/ide/find-and-fix-code-errors?view=vs-2019 .
 
  • #42
yungman said:
I am really having a hard time navigate the Visual Studio. I have been going through the example of "Hallow World" and run Ctrl F5 to look at in command mode and all. I even copy the syntax and all another line "How are you" and display in the command mode. I saved in the desktop folder. I closed the program, I tried to open it and I can't even open it back. I went through the help tab, it is absolutely of no help.
The Help link is very useful, but you have to know what to look for.
CTRL F5 opens a command prompt window and starts the program.
You can't type your program into the command prompt window -- that's just where the output from your program goes.
When you open Visual Studio, your first step is to create a new project. I usually create either a Console App or an Empty Project. There's a default name (Project1 for the first one you create), but I prefer to enter a more explanatory name. After you click OK, the top line in theSolution Explorer pane will have "Solution 'Project1'" or whatever name you've chosen for your project. Immediately below it will show the name of your project in bold. Under that there are several folder icons, among which are Header Files and Source Files. The only one that you need to use at your stage is Source Files.
Right-click the Source Files icon, and Add a New Item. This is where you create your C++ (or C) source file. The default name is Source.cpp, but you should give it a more descriptive name.
After you do this, type in or copy-paste in the source code for your program. Once you've done that, select Build from the menu, and click Build Solution. If your program builds (compiles and links) with no errors, you can then run it by pressing F5 (run in debugger) of CTRL F5 (run in command prompt window).
yungman said:
I went on Youtube, there is only one or two on C++ for Visual Studio 2019. They have for older version, but it's not the same. I am going around and around.
Don't search for examples in Visual Studio 2019. Just search for more general C++ tutorials. For what you're doing, I doubt that there's all that much difference between examples in VS 2019 or those in older versions.
yungman said:
All I need is to have explanation how to open an existing file and edit and save and I can't even do that so far.
After you have created your project and the source code file, look in the Solution Explorer pane, and select the top item there. In the properties for the solution, it will show the directory path where everything is saved. Inside that directory, there's a file named <project name>.sln. If you double-click that file, it will open Visual Studio, showing the file that you typed in.
 
  • Like
Likes yungman
  • #43
Thanks for the new information.

I have been playing around and I am going somewhere ( a little bit). This is like chicken and egg, if I spend time reading the C++ book without actually typing into VS, it's hard to sink in. But if I play with VS to get a feel of the program and how to edit it, then I don't know what the hell am I typing!

I just follow "Halloworld!" and experiment with some of the information here. I found a few interesting things I don't quite understand. This is the program I modified ( just by copying the line by guessing)

#include <iostream>

int main()
{
std::cout << "Hello World!";
std::cout <<" How are you!" << std::endl;
return 0;
}

I managed to run and display "Hallo World! How are you!" and in cmd mode ask me to press any key to go back. My error last night was "endl" I typed end1 as the picture from the VS help file is end1. I read it, even with magnifying glasses!

My question is

1) There is a #include <iostream>. This is obviously a group of subroutine to perform the display. My program is NOT stored in repos, I saved in my own folder on the desktop. How can VS know where to get the <iostream>?

2) Is VS a compiler or interpreter(like Basic)?

3) I made sure the repos folder is empty. Then I create a new file in "Console App" in C++. I put the project name "Holloworld" in repos, then I UNCHECKED "place solution and project in the same directory.", The whole Halloworld.cpp displayed without me typing anything. I did say creating new file, why the whole .cpp comes out as if it is already written?

4) Why is it if I CHECK "place solution and project in the same directory.", nothing comes out?

Sorry to ask stupid question like these, as I said, it's chicken and egg, I guess I choose eggs, blind playing with the VS to get a feel how to input .cpp, create .cpp and all first before reading the C++ book to learn the command. I don't think I can learn if I read the book without actually typing it in and try.

thanks
 
  • #44
It seems that you are making some progress.
yungman said:
1) There is a #include <iostream>. This is obviously a group of subroutine to perform the display. My program is NOT stored in repos, I saved in my own folder on the desktop. How can VS know where to get the <iostream>?
When you installed Visual Studio, it "knows" where the header files are. The usual place is in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include. Your installation might have Microsoft Visual Studio 15.0. I'm running VS 2017, which is one version older.

The header files don't contain the subroutines for the most part -- just the declarations or prototypes for the functions and types that you use. When you build a program, the linker adds in the code for whatever functions you're using.
yungman said:
2) Is VS a compiler or interpreter(like Basic)?
VS is an integrated development environment (IDE). It contains a compiler (called VC) and a linker and some other tools.
yungman said:
3) I made sure the repos folder is empty. Then I create a new file in "Console App" in C++. I put the project name "Holloworld" in repos, then I UNCHECKED "place solution and project in the same directory.", The whole Halloworld.cpp displayed without me typing anything. I did say creating new file, why the whole .cpp comes out as if it is already written?
It depends on what sort of application you have chosen. I usually select Empty Project, so it doesn't create a source file for me. If you choose Console Application, VS will prepopulate a source code file for you to help you get started.
Here's what I get:
C:
// ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
int main()
{
    std::cout << "Hello World!\n";
}
I didn't copy the whole thing -- there is a block of comments with tips on getting started. VS 2019 might be slightly different.
yungman said:
4) Why is it if I CHECK "place solution and project in the same directory.", nothing comes out?
I don't know what you mean "nothing comes out."
When I created the application I showed above, VS created a direction in my repos folder. Here's the file hierarchy.
Code:
repos
...ConsoleApplication1
...ConsoleApplication1.cpp  <--- this is your source code file
... plus 3 other files that VS uses
...ConsoleApplication1.sln
When you build your program, VS will create a bunch of other files.
 
  • Like
Likes yungman
  • #45
Thanks Mark44
I just want to acknowledge you first. It will take me some time to digest these.
 
  • #46
I have been looking for the location of the subroutines. I found it. It's different from yours. I think it's because mine is 2019. That's the reason there is a good youtube on VS2017, but I couldn't follow as it looked very different.
Include file for VS.jpg


Now I know I can click the "External dependency" to view what subroutine it has and can click each to see the code inside to understand more ( not that I understand any line at this point, but it's a start).

My question is whether I can redirect the program to look for subroutine somewhere else where I can write my own subroutines? Or do I have to add my subroutines into the location where VS store the rest of the files? That won't be very convenient.

I still have to try create and dummy .cpp file using Empty Project command so I know how to start my own .cpp. I think I am going somewhere, I am stoked.

I decided to go with VS even though it's hard to learn, but it support C#, Python etc. I hope if I ever learn another program, this extra effort learning how to navigate VS will pay off.

Thanks
 
  • #47
yungman said:
My question is whether I can redirect the program to look for subroutine somewhere else where I can write my own subroutines? Or do I have to add my subroutines into the location where VS store the rest of the files? That won't be very convenient.
Actually, the header files don't contain the subroutines (which BTW isn't terminology that is used in C, C++, C#, etc.). Most of what's in the header files, such as iostream, are the declarations or prototypes of the functions that you use. These declarations provide information about a function: how many parameters, the parameter types, and the return type. The actual code is in the lib directory -- the linker inserts the code for the functions you use.

And yes, you can write your own header files. I was working today on a program I wrote about a year ago, adding more functionality to it. The application consists of two projects -- one written in C++ and the other in C#. There is also a header file. The entry point (a Main function) is in the C# file. The C++ portion gets compiled to a DLL (dynamic link library). The C# code uses (calls) the functions in the DLL and does I/O. In C# parlance, this is called interop (short for interoperability).

The compiler generates an object file -- machine code for the code your write, but nothing else. The linker adds the code for library functions, to make the complete application.
yungman said:
I still have to try create and dummy .cpp file using Empty Project command so I know how to start my own .cpp. I think I am going somewhere, I am stoked.
Good. With an empty project, I think it's easier to not get confused by a bunch of extra stuff.
 
  • Like
Likes yungman
  • #48
So those are not called subroutines, they called declarations or prototypes of the functions now a days?

The Include folder, in the C drive is called "Header files"?

I am trying to learn the new names which is very important to understand what I am reading. I find Google is very good at that. I read about Solutions, Build solution, Clean Solution. These are all new to me. That Solution and just Compiling the program and Link the Prototype function in the Header files to produce the final executable file( I don't know the name yet). is it .exe?

Can you tell me what other important terms I need to look up?
 
  • #49
I just looked at the VS help documentation, I realize what I missed. In the explanation like Build and Run C++, the screen pictures are actually moving showing where to point and open files and run the build.

I have neck problem and it's not comfortable reading on the laptop, so I copy onto word file and print them out to read. Obviously the pictures are NOT moving anymore and I miss the whole picture instructions! No wonder there's a big disconnect from reading on paper to the real operation.

Now I know, it becomes a lot clearer. Wow, I wasted so much time on this! Luckily I was told here the documentation is very good, so I give it another chance.
 
  • #50
C++ is an old language but still one of the most important (the other one is Java, a much slower and buggy and annoying language), and it's very fast.

The new alternative to C++ is Rust.

And would also suggest Julia, the future for scientific programming. It's a very fast and capable scientific language which is going to supersede R+Python+Fortran.
 
  • #51
yungman said:
So those are not called subroutines, they called declarations or prototypes of the functions now a days?
What you're calling subroutines are functions. Both Fortran and Pascal distinguish between blocks of code that return a value (functions) and blocks of code that perform some action (subroutines in Fortran and procedures in Pascal).
Some additional terminology that is used in object-oriented languages is method, a function that is associated with a particular class.

Here is an example of a function prototype. The prototype (or declaration) provides the name of the function (triangleArea), the number of parameters (four) and types of the parameters (all are type double), and the type of value returned (double)
C:
double triangleArea(double sp, double a, double b, double c);
Here is an example of a function definition. The function definition includes the function header and the code for the function.
C:
double triangleArea(double sp, double a, double b, double c)
{
    double area = std::sqrt(sp * (sp - a) * (sp - b) * (sp - c));
    return area;
}
In large programs, it's often convenient to place the function declarations in their own file -- a header file, usually with a .h file suffix.
yungman said:
The Include folder, in the C drive is called "Header files"?
The Include folder contains the standard library header files. If you write your own header files, you could add them to the Include folder, but this is not a good idea. Usually any user-written header files would be placed in the same folder as the source code for your program.
yungman said:
I am trying to learn the new names which is very important to understand what I am reading. I find Google is very good at that. I read about Solutions, Build solution, Clean Solution. These are all new to me. That Solution and just Compiling the program and Link the Prototype function in the Header files to produce the final executable file( I don't know the name yet). is it .exe?
An application (called a solution in VS) can consist of a number of projects, but at your stage of learning, an application will involve only one project. Building an application entails compiling the code your wrote, which translates the code that you wrote to machine code, and then linking any library code together with your object file. The net result of this is usually an executable (.exe extension), but it's also possible to create a static library file (.lib extension) or a dynamic library (.dll extension). These library files are containers of function code that can be linked into programs that you write.

At this stage, though, you shouldn't concern yourself with library files.
 
Last edited:
  • Like
Likes sysprog and yungman
  • #52
yungman said:
Hi

I just want to learn a language, but I don't know which one is best for me. I did programming back in the 70s and early 80s, mainly in assembly language. I learned Fortran, Basic and Pascal before, but they are so old. I since changed my career to analog and RF electronic designs and had not tough programming since. This is mainly for mind excise, I rather this than crossword puzzles for retirement.

I am thinking about C# or C++ as this is used in firmware design. Another one is like Python because both my grandkids are into gaming, I bought a book of Python for Kids to my teenage grand daughter and she is learning it. So that is like playing with grand kids. One kind I don't want is language for business, I have no interest in business, mainly scientific or maybe gaming.

Any suggestion will be appreciated. Also how to get started when I decide on one language.

Thanks

Python is fine, but if you are interested in numerical simulations, Fortran is still worth considering. The language is old, but it has evolved considerably -- the latest standard is Fortran 2018. It has neat array features like Matlab of Python with numpy. I use the free gfortran compiler, part of gcc.
 
  • #53
yungman said:
Hi

I just want to learn a language, but I don't know which one is best for me. I did programming back in the 70s and early 80s, mainly in assembly language. I learned Fortran, Basic and Pascal before, but they are so old. I since changed my career to analog and RF electronic designs and had not tough programming since. This is mainly for mind excise, I rather this than crossword puzzles for retirement.

I am thinking about C# or C++ as this is used in firmware design. Another one is like Python because both my grandkids are into gaming, I bought a book of Python for Kids to my teenage grand daughter and she is learning it. So that is like playing with grand kids. One kind I don't want is language for business, I have no interest in business, mainly scientific or maybe gaming.

Any suggestion will be appreciated. Also how to get started when I decide on one language.

Thanks
If you have already learned a programming language, then learning another should be easy. I also learned BASIC, FORTRAN, PASCAL in my youth. When I learned BASIC, I also had to learn coding logic. After BASIC, I knew coding logic, so learning the other languages were only a matter of becoming familiar with new syntax. Today, I can pick up a new language in a few days just by looking at example programs and imitating them for other purposes, and that's how I learned Python and Prime Programming Langauge (HP Prime) and whatever that language is that those high-end Casio calculators use. Really, learning another computer language after you've already learned several isn't all that difficult. The biggest problem I have is that, sometimes, while programming my HP Prime, I'll mistakenly use Python syntax for the top line of a loop, and then have to correct it when the compiler detects an error.
 
  • Like
Likes yungman
  • #54
Jenab2 said:
If you have already learned a programming language, then learning another should be easy. I also learned BASIC, FORTRAN, PASCAL in my youth. When I learned BASIC, I also had to learn coding logic. After BASIC, I knew coding logic, so learning the other languages were only a matter of becoming familiar with new syntax. Today, I can pick up a new language in a few days just by looking at example programs and imitating them for other purposes, and that's how I learned Python and Prime Programming Langauge (HP Prime) and whatever that language is that those high-end Casio calculators use. Really, learning another computer language after you've already learned several isn't all that difficult. The biggest problem I have is that, sometimes, while programming my HP Prime, I'll mistakenly use Python syntax for the top line of a loop, and then have to correct it when the compiler detects an error.
I hope so, I am still trying to learn all the terminologies like Class, Object, Object Oriented programming etc. When it comes down to reading the codes, it's not that intimidating ( I hope).
 
  • #55
Some general comments

Python is extremely slow compared to other languages, unless most of what the code is doing is Python's library code which is written in other languages like C.

Java has limited functionality with native types versus object types such as "int" versus "Integer". Java's native linked list and iterators are terribly designed. There's no way to rearrange a list similar to C++ std::list::splice(), which can "move" one or more nodes within a list or from one list to another. Any operation that changes the linkage in a list will break all iterators to that list (except for the iterator that made the change).

Most low level embedded stuff, like hard drives are written mostly in C with some assembly (for interrupt handling, context switches, ...).

Knowing how to program with common languages will require some adaptation for uncommon languages like APL, with it's fairly large number of greek letter generalized operators that work with scalars, vectors, mutli-dimensional arrays, ... . A somewhat popular example of APL code is an implementation of Conway's game of life, which would normally take quite a few lines of code in a common language, but just one line of code in APL. This example uses some statement separators for a delay and to change display output.

 
  • Like
Likes sysprog
  • #56
@rcgldr from https://www.dyalog.com/uploads/files/presentations/CodeGolfWebinar.pdf $$\mathtt{(\{≢⍸⍵\}⌺3~3∊¨3+0,¨⊢) ~W}$$or in J (with explanation quoted) from https://rosettacode.org/wiki/Category:J
$$\mathtt{life=: (3~3 (+/~e.~3\text {+0,4}\&\{)\text{@,;._3}~]\text{)@(0,0,}\tilde{~} \text{0,.0,.}\tilde{~}\text{])}}$$
In other words, given a life instance, the next generation can be found by:
  1. adding extra empty cells, surrounding the life instance,
  2. tessellating the result, finding every overlapping 3 by 3 subinstance,
  3. totaling the number of live cells in each subinstance,
  4. treating a subinstance as a live cell iff that total is a member of the sequence 3,x where x is 3 if the center cell was previously dead, and 4 if the center cell was previously alive (that said, note that 4 is also the index of the center cell, with the sub instance arranged as a flat list).
 
  • #57
yungman said:
Thanks

So I just download Visual Studio and I can write the code and compile C#?

My grandson told me just now that C++ is better for writing game programs, is that true? I have no idea.

I went on google, it said C++ is more compact thereby run faster, C# needs a lot of library, it's slower and bigger. That C++ is superior for needing speed and much smaller. Maybe I should look into C++ instead.
I am an "early retired" Visual C++ programmer, and I have switched over to C# WinForms. Writing Windows programs is always a good skill to have as a hobbyist as you can make nice Windows applications. I do still like the C++ language, just that I fund Visual C# to be nicer than Visual C++.

If I recall, I think Microsoft has an API to build gaming apps for the XBox system that uses any of its languages. The fact that the top-level code is in slower C# doesn't really matter since such code would be calling functions that have been written in C++ (or even assembly) to be optimized for performance.
 
  • #58
Regarding Visual Studio, it is possible to create hybrid programs comprised of C#, C / C++ and assembly, by creating a DLL (dynamic link library) for the C / C++ / assembly "unmanaged" code. Visual Studio even supports source level debugging for both the C# and the C / C++ / assembly code.
 
  • #59
I just put in and ran a little program on my own! This started out as an exercise, but I added in display and making new lines by using <<endl command and put text in it. It worked! this is my little program:

#include <iostream>
int main()
{
int x = 8;
int y = 6;
std::cout << std::endl;
std::cout << "x-y=" <<x - y << "" << std::endl
<< "x*y=" << x * y << "" << std::endl
<< "x+y=" <<x + y << "";
std::cout << std::endl;
return 0;
}The cmd.exe shows:
C++ Class Object 2.jpg


This is my first one. I am stoked.
 
  • Like
Likes jtbell and sysprog
  • #60
I had a really hard time starting in C/C++ years ago. Might I suggest that you look at Starting Out With C++ Early Objects, Tony Gaddis. I learned from it, still refer to it every time I start a new coding project. (I found some versions online in pdf form.) I have a paperback on my desk and have it loaded on pretty much every computer I work with.

He explains enough to get going and be able to ask intelligent questions on google for what you need to know.
 
  • Like
Likes sysprog

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 133 ·
5
Replies
133
Views
10K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
16
Views
3K
  • · Replies 54 ·
2
Replies
54
Views
5K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 58 ·
2
Replies
58
Views
4K