The Glade 4.0
https://gladerebooted.net/

Microsoft Visual Studio
https://gladerebooted.net/viewtopic.php?f=5&t=11599
Page 1 of 3

Author:  Diamondeye [ Mon Feb 29, 2016 8:40 pm ]
Post subject:  Microsoft Visual Studio

I bought a book on programming in C++ for beginners that came with a copy of this. Is it any good, or should I look for a different compiler? The book discusses right at the outset that it has a few minor idiosyncrasies.

I haven't done any programming in 20 years; the last time was a course in True Basic I took in college, and before I did that and Turbo Pascal in high school, but I thought it might be a good time to start learning it again.

Author:  Lenas [ Mon Feb 29, 2016 9:41 pm ]
Post subject:  Re: Microsoft Visual Studio

I hear the new version is pretty good.

Author:  Lex Luthor [ Tue Mar 01, 2016 10:17 am ]
Post subject: 

If you are doing development on Windows, then Visual Studio is the standard for C++. If you're on Linux, then use whatever the most popular open source compiler is.

C++ isn't a very good language though unless you're making native video games. I'd go with Python for general use. PHP if you want to make a quick website. Just my 2 cents.

Author:  shuyung [ Tue Mar 01, 2016 11:47 am ]
Post subject: 

gcc

You can install Cygwin/X and get a full POSIX-compliant environment on your windows machine.

Author:  Lex Luthor [ Tue Mar 01, 2016 12:13 pm ]
Post subject:  Re:

shuyung wrote:
gcc

You can install Cygwin/X and get a full POSIX-compliant environment on your windows machine.


Technically I think you should use g++, not gcc.

Quote:
The main differences: gcc will compile: *.c/*.cpp files as C and C++ respectively. g++ will compile: *.c/*.cpp files but they will all be treated as C++ files. Also if you use g++ to link the object files it automatically links in the std C++ libraries (gcc does not do this).

Author:  Diamondeye [ Tue Mar 01, 2016 11:25 pm ]
Post subject:  Re:

shuyung wrote:
gcc

You can install Cygwin/X and get a full POSIX-compliant environment on your windows machine.


What does that mean?

Quote:
If you are doing development on Windows, then Visual Studio is the standard for C++. If you're on Linux, then use whatever the most popular open source compiler is.

C++ isn't a very good language though unless you're making native video games. I'd go with Python for general use. PHP if you want to make a quick website. Just my 2 cents.


At this point I'm not really doing much of anything - I'm literally re-learning how to do things like define variables, if-then statements, while loops... I remember doing all these things years ago but I don't know the syntax in C++ at all and I'm not familiar with how to do things like print text on the screen. It's going to be a long time before I develop much of anything.

Author:  shuyung [ Wed Mar 02, 2016 1:48 am ]
Post subject: 

So, rather than installing Linux, you can simply install Cygwin (I recommend Cygwin/X, mostly because it's always nice to tunnel any sort of X session to your local desktop) and get a full shell environment (and X-windows environment, if installing Cygwin/X) on your otherwise dull or infuriating Microsoft machine. Many packages are compiled to run under Cygwin, and are installable, most notably just about every coding environment you could want. gcc is the GNU C Compiler, the single most prevalent compiler. Both things have the benefit of being free.

Author:  Corolinth [ Wed Mar 02, 2016 8:42 am ]
Post subject:  Re: Microsoft Visual Studio

DE and I had a conversation a little while ago where I suggested learning to write code. I don't know to what extent that has motivated him to go out and learn programming, but here are some of the points I presented.

It's fairly easy to pick up some basic skills. The resources are readily available. He can practice at home in his spare time.

It's low cost. Most of what he needs can be obtained on the Internet for free. If it's not his bag, he's not wasting a lot of money to find that out.

It's an in-demand skill that can be leveraged for financial gain. It also doesn't require you to have a four year degree in programming.

Once you know one programming language, learning another is not difficult. If he picks the "wrong language" to learn, he can just learn another one. Most programmers know and use several languages.

Author:  Lex Luthor [ Wed Mar 02, 2016 10:25 am ]
Post subject:  Re: Re:

Diamondeye wrote:

What does that mean?



GNU/Linux (usually just called "Linux", to the annoyance of pedantics) is an operating system. You can install a special build of Linux inside of Windows without disturbing the rest of your Windows OS. You do this using something called Cygwin. Now inside of this, you can use open source tools such as GCC to compile C++.

Quote:
At this point I'm not really doing much of anything - I'm literally re-learning how to do things like define variables, if-then statements, while loops... I remember doing all these things years ago but I don't know the syntax in C++ at all and I'm not familiar with how to do things like print text on the screen. It's going to be a long time before I develop much of anything.


In my opinion you should start with Python or Java. Both are very popular languages that are much easier to jump into than C++, which has more flaws than other common languages. A disproportionately large amount of programmers hate C++. You should see how much people talk **** about it on popular programming forums.

Python is possibly the best language to start with because you can say "print variable_name_here" to print out the contents of any variable. And the syntax is very easy to understand. However, in college programming courses, Java is the most common language taught to beginners.

For the record, Python, Java, and C++ all look perhaps equally good on resumes.

Author:  Diamondeye [ Wed Mar 02, 2016 10:42 am ]
Post subject:  Re: Microsoft Visual Studio

Corolinth wrote:
DE and I had a conversation a little while ago where I suggested learning to write code. I don't know to what extent that has motivated him to go out and learn programming, but here are some of the points I presented.

It's fairly easy to pick up some basic skills. The resources are readily available. He can practice at home in his spare time.

It's low cost. Most of what he needs can be obtained on the Internet for free. If it's not his bag, he's not wasting a lot of money to find that out.

It's an in-demand skill that can be leveraged for financial gain. It also doesn't require you to have a four year degree in programming.

Once you know one programming language, learning another is not difficult. If he picks the "wrong language" to learn, he can just learn another one. Most programmers know and use several languages.


Actually, that conversation was pretty instrumental in me deciding to try it out. I mentioned it to some IT/automation specialists here at work too, and they said similar things, so I figured why not go to the book store and get a book on it?

I picked C++ because the book they had on that seemed to be the best-written from a "teach a beginner from the beginning" standpoint; it wasn't just a reference book and didn't assume any real baseline knowledge - it explains things in pretty plain English.

It also moves things along in the later chapters. Looking back, one of my big frustrations with programming in high school was that we never really learned anything new in TrueBasic or Turbo Pascal even though TP was supposedly and AP course - we just did longer and more involved versions of "put in X, eventually get out Y" using the same very basic structures. I think we simply were at the limit of the teacher's knowledge who was a math teacher that had some interest in computers. I don't think learning it this way will suffer that limitation - plus, I have the benefit of the internet which we definitely didn't have in 1991 at home or at school.

Quote:
So, rather than installing Linux, you can simply install Cygwin (I recommend Cygwin/X, mostly because it's always nice to tunnel any sort of X session to your local desktop) and get a full shell environment (and X-windows environment, if installing Cygwin/X) on your otherwise dull or infuriating Microsoft machine. Many packages are compiled to run under Cygwin, and are installable, most notably just about every coding environment you could want. gcc is the GNU C Compiler, the single most prevalent compiler. Both things have the benefit of being free.


I'm still a bit mystified, but "free", "most prevalent compiler" and "you don't have to install Linux" area ll things I understand so I'll check this out. Where is the best place to obtain this?

Author:  Diamondeye [ Wed Mar 02, 2016 10:46 am ]
Post subject:  Re: Re:

Lex Luthor wrote:
Diamondeye wrote:

What does that mean?



GNU/Linux (usually just called "Linux", to the annoyance of pedantics) is an operating system. You can install a special build of Linux inside of Windows without disturbing the rest of your Windows OS. You do this using something called Cygwin. Now inside of this, you can use open source tools such as GCC to compile C++.

Quote:
At this point I'm not really doing much of anything - I'm literally re-learning how to do things like define variables, if-then statements, while loops... I remember doing all these things years ago but I don't know the syntax in C++ at all and I'm not familiar with how to do things like print text on the screen. It's going to be a long time before I develop much of anything.


In my opinion you should start with Python or Java. Both are very popular languages that are much easier to jump into than C++, which has more flaws than other common languages. A disproportionately large amount of programmers hate C++. You should see how much people talk **** about it on popular programming forums.

Python is possibly the best language to start with because you can say "print variable_name_here" to print out the contents of any variable. And the syntax is very easy to understand. However, in college programming courses, Java is the most common language taught to beginners.

For the record, Python, Java, and C++ all look perhaps equally good on resumes.


I can always pick up a book on those as well. I've obviously heard of Java quite a bit, and Python is something I've heard of through EVE - it was evidently originally written in Stackless Python (whatever that is) and "legacy code" is an ongoing joke in the community since apparently it greatly slows down a lot of upgrade efforts. Apparently the original code has some pretty bad inefficiencies, and the actual code-writer developers regularly curse it. They occasionally reveal some details about it which sound pretty bad even to a novice.

Author:  shuyung [ Wed Mar 02, 2016 10:58 am ]
Post subject: 

A disproportionately large amount of programmers hate C++ because it's the single language that every programmer is familiar with. Most languages have a user population in the 10s of thousands, maybe 100s. C/C++ has everybody.

Do not bother to work with Java. Due to fundamental security flaws, no one is recommended to have it in any production environment, ever. It is dying, and it cannot decay into compost fast enough.

Python is very popular, it's a more "natural" language. You can mumble to yourself what you want your code to accomplish, and that's pretty much how you type it out (without the profanities). Due to this, it's also one of the leading languages for web development. It works very well with SQL DBs. The other two languages in the trifecta are PHP and Perl.

Diamondeye wrote:
I'm still a bit mystified, but "free", "most prevalent compiler" and "you don't have to install Linux" area ll things I understand so I'll check this out. Where is the best place to obtain this?

cygwin.org

You'll download the setup executable, and then upon running that, you'll go in and select the packages you want to install. You can leave most things at the default, but you'll want to drill into the development environment or programming languages subsection and select everything that looks interesting. Later on, when you get a better feel for what it's got, you can add more stuff.

Author:  Lex Luthor [ Wed Mar 02, 2016 11:29 am ]
Post subject:  Re: Microsoft Visual Studio

Well a nice thing about Java is that it constrains the way you code. It's easy for beginners to write really bad or illegible Perl or C++, but for Java that won't happen as much by accident. So Java is good for large teams of programmers who might be inexperienced. Basically anyone can understand anyone else's Java.

I don't think Java is dying. It remains one of the most widely used languages, and not just for legacy projects. I think it's used mainly by big corporations that are well funded, rather than open source projects. It also has high performance so it can be useful for projects that need to scale.

If you want to just get something working, then Perl, Python, or PHP are the way to go. Those languages are probably the easiest to develop in.

Author:  Diamondeye [ Wed Mar 02, 2016 12:33 pm ]
Post subject:  Re:

shuyung wrote:
cygwin.org

You'll download the setup executable, and then upon running that, you'll go in and select the packages you want to install. You can leave most things at the default, but you'll want to drill into the development environment or programming languages subsection and select everything that looks interesting. Later on, when you get a better feel for what it's got, you can add more stuff.


Thanks, I'll try this out.

I did not realize that there were such strong opinions on languages, especially Java. I do remember reading some Java end-user agreement a long time ago (10 years or more, probably), when downloading it for some program or other that required you to have it installed that said something along the lines of "don't use Java for anything involving failsafes" and went on to give a long list of thins like air traffic control and nuclear reactors where you weren't supposed to use it.

:shock:

Author:  Diamondeye [ Wed Mar 02, 2016 8:09 pm ]
Post subject:  Re: Microsoft Visual Studio

cygwin seems to have a fascinating array of tools but I'm not sure what 99% of them even are. I downloaded a few that I could sorta kinda identify and as I move beyond "make ascii characters appear on a screen" I'll start using it more.

Author:  Lenas [ Wed Mar 02, 2016 8:13 pm ]
Post subject:  Re: Re:

Diamondeye wrote:
I did not realize that there were such strong opinions on languages, especially Java.


Oh boy, debates about the best languages are as numerous as any other nerd debate you can imagine.

Author:  Screeling [ Wed Mar 02, 2016 10:57 pm ]
Post subject: 

I will throw in for python as well. Pretty easy to pick up, free, and tons of resources for learning. Code Academy has modules on it.

Author:  Diamondeye [ Thu Mar 03, 2016 12:19 pm ]
Post subject:  Re: Re:

Lenas wrote:
Diamondeye wrote:
I did not realize that there were such strong opinions on languages, especially Java.


Oh boy, debates about the best languages are as numerous as any other nerd debate you can imagine.


I suppose I shouldn't be surprised. I always thought that each language was for certain purposes and it was a matter of using the right tool for the job.

Author:  Corolinth [ Thu Mar 03, 2016 5:13 pm ]
Post subject: 

A little from column A, a little from column B.

As to Java, here are the arguments for both sides.

Pro: Java is easy to learn, easy to use, and is very prevalent in devices that are connected to the Internet. Everybody knows Java and likes writing Java because it's such familiar, well-traveled ground.

Con: Java contains security holes big enough to drive a truck through. Oracle has a notoriously poor track record for handling these security vulnerabilities.

Author:  Diamondeye [ Thu Mar 03, 2016 6:43 pm ]
Post subject:  Re: Microsoft Visual Studio

This is the level I'm at. I produced this solution for a program that will produce a factorial using a function:

Code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int i = 0;
int n = 0;
int x = 0;
int result(int x, int n);

int main()
{
   int f = 0;
   cout << "To determine the factorial, input an integer greater than 1: ";
   cin >> f;
   i = f;
   x = f;
   cout << endl;
   for (i = f; i >= 2; --i) {
      n = i - 1;
      result(x, n);
      x = result(x, n);
   }
   cout << "Factorial of " << f << " is: " << result(x, n) << endl;
   return 0;
}

int result(int x, int n) {
   return (x * n);
}


It took me 45 minutes to get that to work right - almost all of which was it running fine but giving an incorrect result.

Author:  Lex Luthor [ Thu Mar 03, 2016 10:00 pm ]
Post subject: 

Glad you got it working. Here's some feedback:

1. You shouldn't be using global variables for this.
2. Your variable names are not descriptive (on second thought, this is probably fine here).
3. You're calling result(x, n) twice and only using the return value the second time.
4. The result() function is unnecessary and should be removed.

Corolinth wrote:

Con: Java contains security holes big enough to drive a truck through. Oracle has a notoriously poor track record for handling these security vulnerabilities.


I disagree about Java containing security holes. I'm sure many Java frameworks, libraries, and applications have security issues but I don't think the problem is the Java language or the Java virtual machine. You can write very secure software with Java.

Author:  Corolinth [ Thu Mar 03, 2016 10:21 pm ]
Post subject: 

Use of global variables is a bad habit that is quite common among beginning programmers. Early in one's foray into programming, it is difficult to understand why you should avoid them, and when it is appropriate to use them.

Author:  Diamondeye [ Fri Mar 04, 2016 12:37 pm ]
Post subject:  Re: Microsoft Visual Studio

Thanks for the feedback. I don't actually know what a "global variable" is yet, although the name gives some clues. I believe it's in a chapter coming up shortly though.

As for the unnecessary function, the program was an exercise from the book to write it using a function so I did it - but I see what you mean about it not being required.

Author:  Shelgeyr [ Fri Mar 04, 2016 1:17 pm ]
Post subject: 

Global variable = one whose value can be manipulated by any function or subroutine that wants to mess with it.

In really small programs (like the kind you write as homework assignments), it's really easy to keep track of everything that's being done to your variable. In larger programs, you may find yourself searching through 200,000 lines of code to find out how/where/why the value changed.

Global constants, on the other hand, are wonderful.

Author:  Timmit [ Fri Mar 04, 2016 3:07 pm ]
Post subject:  Re: Microsoft Visual Studio

shuyung wrote:
Do not bother to work with Java. Due to fundamental security flaws, no one is recommended to have it in any production environment, ever. It is dying, and it cannot decay into compost fast enough.
That's not really true. There is a huge desire by companies that do software development for Java developers, especially in the companies that do contract work for the govt (and the intelligence community specifically). They also do a lot of work in Python, C/C++, and (yuck) Fortran.

Page 1 of 3 All times are UTC - 6 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/