User interface

DerStrom8

Joined Feb 20, 2011
2,390
Sorry thought that part was obvious. ;) Actually I did not know that Java came from C. I would have thought Pascal or C++.
Java is actually set up very similarly to C++. If you know C++, you practically know Java (it's just that Java does more for you under the hood).
 

WBahn

Joined Mar 31, 2012
29,978
The history of languages is seldom a simple path. This is pretty inevitable since anytime someone decides to come up with a new language it is because they don't like at least one major aspect of some other language and, instead, favor how yet another language handles that. So most new languages inherit aspects from multiple languages, tweaking things along the way. And the time scales on which new languages evolve almost always blurs the lines further as this evolution never happens in a vacuum and is constantly being influenced by what's happening with other languages at or about the same time.

While this is very simplistic, my thought framework is that C++ tried to add object orientation to C, but arguably made the mistake of trying to remain compatible with C such that you ended up with a hodge-podge mix of object and non-object programming approaches. There were also a number of things that C++ used that turned out to be less-then-optimal. Java tried to learn from these mistakes, first and foremost by making it strictly object-oriented. They also tried to put as much under the hood as they could and, in some ways, went a bit to far. So C# came along and tried to learn from Java's mistakes with a better blend and more consistent approach to things. And, of course, they didn't get everything right, so some other language will come along and try to learn from it's mistakes.
 

MrSoftware

Joined Oct 29, 2013
2,188
is visual basic c#?
No, Visual Basic is a language, and C# is a completely different language.

Let me try to clarify. Microsoft Visual Studio is a development environment that supports many different languages. This means it supports multiple different compilers and debuggers. For C# it uses the C# compiler and debugger. For VB it uses the VB compiler and debugger. The same for C/C++, etc..

The version you downloaded is 2008, which is extremely old. Languages evolve over time, new features are added. Many examples that work fine on the newer VB will not compile at all on your old 2008 VB, and the errors caused by trying to compile new code on an old compiler can be cryptic and difficult to understand. This can be a source of frustration when you're trying to learn. My advice is ditch that out dated 2008, and get at least 2013, preferably 2015.

Start with the very basics. Start with a program that prints "Hello world!" on the screen, and go from there. It sounds like you're brand new to programming, and if you just try to copy a bunch of stuff form the internet and make it work, you're going to have a lot of trouble and you won't learn much. You cannot learn programming overnight, start with the basics and work your way up. Don't just copy the example code, make sure you understand what it does and how it works.
 

MrSoftware

Joined Oct 29, 2013
2,188
I will throw in that different languages were invented for different purposes. Assembly is for extreme low level programming. You have absolute control at the lowest possible level, but it would be a nightmare to write a user application in assembly.

C would be a big step up from assembly. You can do things with one line of C that would take many many lines of assembly, but you still have really good control at the lower levels if you need it. And you can insert sections of assembly into your C code should you need even lower level control. C++ is an extension of C. To over simplify; if you need low level control, but not as low as assembly, then C/C++ are great choices. Operating systems, drivers, even user applications are often written in C/C++. It's also excellent for writing multi-platform code, though it is up to the programmer to identify those places where there are platform specific differences and to code for them accordingly. You get lots of low level power, but compared to some higher level languages simple tasks often take a lot of code, and the programmer has to be aware of and manage low level details that are handled nearly automatically in higher level languages. For example memory allocations and deallocations, memory access limits, thread synchronization, stack limits, where memory was allocated so you don't access it across specific boundaries, byte packing, etc..

C# is a higher level language than C or C++. You can do things in just a few lines of C# that would take pages of C/C++ code, and a truck load of assembly. Not only is this more convenient, but it also cuts down on programming errors and can sometimes make complicated tasks easier by allowing the programmer to address issues from a higher level and with less code. The trade off is that you give up a lot of the lower level control. It's more difficult to access memory directly, share memory across threads, directly access driver level data, I'm not aware of any way to insert assembly into C#, executable files are often much larger and execute slower, etc.. But for writing many user level applications these are welcome tradeoffs for the increased efficiency of development.

Java is similar to C# in that java code is typically interpreted as opposed to compiled (it executes in a Java Virtual Machine). OK that's not 100% accurate; it's compiled to byte codes, or intermediate code, that is executed by the virtual machine. As opposed to C/C++ which is compiled directly to a processor specific binary. Java has a lot of focus on cross platform compatibility. Because it's executed inside a virtual machine, in theory any java application will execute just fine on any platform that has a compatible JVM. Write your program once, run it as-is on Windows, UNIX, Linux, OSX, etc. and it will run exactly the same..in theory..

Scripting languages like PHP, Perl, Python, etc.. are higher level than C# and java. With very little code you can do a heck of a lot of data processing. With one line of Perl regular expressions you can accomplish what would take pages of raw C/C++ code, and probably someone with a PHD in assembly to accomplish in pure assembly code. Traditionally the scripts are not compiled at all, and instead are interpreted at run time by their interpreters (though there are binary compilers for some scripting languages..) so like Java a program written once will execute exactly the same on any platform that has the necessary interpreter. Many of the perl scripts I've written over the years executed identically on Windows, Solaris, Linux, IRIX and AIX. I've written C code that does the same, but it required recompiling on each platform, and required that I managed the platform differences myself.

Anyway... I guess the point is, different languages are invented to fill different needs. There is inevitably some overlap where there are multiple choices that will work for the same task. If you want to write basic Windows GUI applications, then C++ will fit the bill, but in many (most?) cases C# is arguably a better choice these days.
 
Last edited:

WBahn

Joined Mar 31, 2012
29,978
I completely agree with what you are saying. It's one of the things I stress in most of the classes I teach. More than 20 years ago, as a grad student, I wrote a set of simple guidelines for students learning C, including tips and pitfalls. One of the comments I made in there was that C gave the programmer extreme authority but at the price of extreme responsibility -- in other words, C was more than willing to give the programmer plenty of rope with which to hang themselves -- a reality that many new C programmers are emotionally not well equipped to handle.
 

WBahn

Joined Mar 31, 2012
29,978
Yeah I don't get it either. Even the sentence structure, while a simple sentence, does not add up with other posts.
There's a lot of funny business that goes on in India (and an increasing number of other countries, too). Talking in general terms, it is quite common for people to outright pay for someone to do their work for them and people knowingly look the other way. I read a report that talked about how common it was for a grader (or even the professor) to write a phone number on the paper of someone that did a horrible job and it was understood that it was an offer to do the work for them for a fee. That same article talked about how India is increasingly outsourcing it's engineering work because, despite the huge number of engineering graduates each year, it is becoming almost impossible for most Indian companies to find anyone in India that is worth hiring.
 

shortbus

Joined Sep 30, 2009
10,045
At one time in the past, his signature line had a link to his, "electronics learning/teaching" website. It seems to be no longer on the web though.
 

MrSoftware

Joined Oct 29, 2013
2,188
A family member has had to hire some people in India and one aspect of the culture was really challenging. Maybe someone from India can confirm or deny this, but I'm told it's socially acceptable to lie about your capabilities at job interviews, so it makes the interview process extremely difficult. The company he works for has large teams there that he speaks highly of, so there are definitely smart and capable people there. The challenge is finding them.

We hired a company there to outsource some of our development work that we were temporarily too busy to handle in-house, and I managed the workers there. The frustrating part was every couple of weeks our workers would move on and we were given new people. Now we only worked with one company and surely not all of the companies have that issue, but it was frustrating so we gave up and brought our development work back in house.
 

WBahn

Joined Mar 31, 2012
29,978
I've heard the same thing about the lying at interviews, but don't know to what degree it is true.

There are definitely some high quality institutions in India with very high standards. Of course, just about any country is a mix of high-integrity schools and low-integrity schools -- and the U.S. is certainly no exception! -- it's just a matter of the ratios.
 
Top