The Acoustic Guitar Forum

Go Back   The Acoustic Guitar Forum > Other Discussions > Open Mic

View Poll Results: Which programming language to learn
Learn C++ First 2 22.22%
Learn Java First 4 44.44%
Need to know both 1 11.11%
Doesn't matter - programming is programming 2 22.22%
Voters: 9. You may not vote on this poll

Reply
 
Thread Tools
  #1  
Old 08-02-2015, 08:33 PM
harmonics101 harmonics101 is offline
Guest
 
Join Date: Feb 2009
Location: Eastern Washington - Idaho
Posts: 7,495
Default Which programming language to learn

Java? C++? Eclipse or some other IDE? Any recommendations? I'm looking at Java code and C++ code and it all looks the same to me. I did a search on the internet and apparently, they are the same! So, which would you programmers suggest to learn first, C++ or Java? Or maybe something else? Or does it really matter,

H
Reply With Quote
  #2  
Old 08-02-2015, 08:50 PM
footbeat footbeat is offline
Registered User
 
Join Date: Dec 2013
Posts: 148
Default

Superficially, they look the same, but they are different and they have their plusses and minuses in different situations. It depends on what kind of coding you want to do.
__________________
Mike L

2013 Taylor 414ce FLTD
2015 Esteve 7C/B

My SoundCloud stream
Reply With Quote
  #3  
Old 08-02-2015, 08:55 PM
harmonics101 harmonics101 is offline
Guest
 
Join Date: Feb 2009
Location: Eastern Washington - Idaho
Posts: 7,495
Default

Quote:
Originally Posted by footbeat View Post
Superficially, they look the same, but they are different and they have their plusses and minuses in different situations. It depends on what kind of coding you want to do.
Historically, C++ is systems programming that is compiled to machine code, and Java is interpreted. You probably don't want to program rocket code with Java or the stock market algorithms either.

I guess my question is, if you fluently know Java, does that make you pretty fluent in C++? How important is the IDE that you are dealing with and the type of errors you are grappling with? From personal experience, it comes down to errors you are grappling with the IDE, be it Codeblocks or Eclipse rather than the language itself,

H
Reply With Quote
  #4  
Old 08-02-2015, 09:41 PM
dhalbert dhalbert is offline
Dan - Charter Member
 
Join Date: Sep 2012
Location: Eastern MA
Posts: 1,669
Default

As an analogy, this is a bit like asking if you should start with piano or violin. Do you have some experience programming already? What's your starting point, and what's your goal?

Is this your first language? My impression is not. If so, I would say neither - try Python instead.

Java and C++ are both object-oriented, use curly braces, and have similar control structures, but there are some pretty fundamental differences.

Java has some idiosyncrasies, and is somewhat verbose, but it's fairly straightforward. C++ is much closer to the machine, and requires you to think about storage management.

Java is a lot closer to Javascript, Scala, Python, Ruby, the new Swift language from Apple, etc.

The IDE can help, but you really need to understand the underlying model of the language. I'd avoid a fancy IDE (or avoid its hand-holding features) when you're starting out.
Reply With Quote
  #5  
Old 08-02-2015, 09:56 PM
jalbert jalbert is offline
Registered User
 
Join Date: Feb 2004
Location: San Diego, California
Posts: 2,717
Default

Quote:
Originally Posted by dhalbert View Post
Do you have some experience programming already? What's your starting point, and what's your goal?
These are excellent questions. Unless you have a need for maximum performance, I suggest staying away from C++. It provides, in the words of Allen Holub, "enough rope to shoot yourself in the foot." It's very powerful, but can be trickier than other languages (like Java, C#, Python, Swift, et al) to reliably do simpler things like database access and web site back ends. Yes Java looks much like C/C++ but they really are quite different when you're writing a full application.
Reply With Quote
  #6  
Old 08-02-2015, 10:00 PM
jalbert jalbert is offline
Registered User
 
Join Date: Feb 2004
Location: San Diego, California
Posts: 2,717
Default

Quote:
Originally Posted by harmonics101 View Post
if you fluently know Java, does that make you pretty fluent in C++?
No. C# looks a lot like Java too, but as the size of your functions/modules/applications grows there's enough language/environment specific stuff that requires time to learn. For example, I've been working on the .NET platform since it was introduced in early 2002. If I had to produce full applications in Java two things would happen: 1) I would take significantly longer during while on the wrong side of the learning curve, and 2) my Java programs would look very C#-ish. So even though they're both semicolon-terminated OO languages with many of the same control structures, they're quite different at scale.
Reply With Quote
  #7  
Old 08-02-2015, 10:17 PM
harmonics101 harmonics101 is offline
Guest
 
Join Date: Feb 2009
Location: Eastern Washington - Idaho
Posts: 7,495
Default

Thank you for all responses, here's the crux of my problem.

Currently, I'm working in a proprietary language where everything is global. I look up my data definitions in a massive Bible (categorized of course) to find data elements, structures, underlying attributes, data types, a sort of one stop shopping to get the nuts and bolts of the data structures involved.

With C++ or Java, it seems like everything is embedded in #include or macros that aren't inherently obvious. An on demand structure of the data types being programmed would be nice in Java or C++. I guess the programming background that I come from is so foreign to me, I'm trying to grasp my mind around how these standard languages are a benefit to other proprietary models out there.

H

Thanks again for all your input, you are talking to someone that has been working in a proprietary type setting for about 25 years that is trying to grasp where the standard ideal language model(s) have come thus far.
Reply With Quote
  #8  
Old 08-02-2015, 10:20 PM
3rd_harmonic 3rd_harmonic is offline
some guy from NY
 
Join Date: May 2006
Posts: 4,226
Default

decide what industry you want to work in first. What do you want to make? some industries won't use either of those two because of software assurance issues.
Reply With Quote
  #9  
Old 08-02-2015, 10:23 PM
harmonics101 harmonics101 is offline
Guest
 
Join Date: Feb 2009
Location: Eastern Washington - Idaho
Posts: 7,495
Default

Quote:
Originally Posted by dhalbert View Post
.....but you really need to understand the underlying model of the language. I'd avoid a fancy IDE (or avoid its hand-holding features) when you're starting out....
If what I need to understand is the underlying model of the language, why aren't there any good text books out there explaining this? Most of the books I see out there are either (1) Esoteric S.R. Bourne type publications or (2) Mechanics of creating Hello World Programs.

Rarely, do you see books that generically try to describe the model of a language with complete real world examples. I guess C++ and Java do come close with some publications, but those rarely, if ever have actually included CD's with real working programs,

H
Reply With Quote
  #10  
Old 08-02-2015, 10:24 PM
harmonics101 harmonics101 is offline
Guest
 
Join Date: Feb 2009
Location: Eastern Washington - Idaho
Posts: 7,495
Default

Quote:
Originally Posted by 3rd_harmonic View Post
decide what industry you want to work in first. What do you want to make? some industries won't use either of those two because of software assurance issues.
My bread and butter has been Health Care, so that's where I'm planning on staying at this time,

H
Reply With Quote
  #11  
Old 08-02-2015, 11:11 PM
jalbert jalbert is offline
Registered User
 
Join Date: Feb 2004
Location: San Diego, California
Posts: 2,717
Default

Quote:
Originally Posted by harmonics101 View Post
Currently, I'm working in a proprietary language where everything is global
How challenging that must be to design a complex system! I can imagine it must be hard to test. I suggest becoming familiar with Object Oriented Design, where the data is encapsulated in classes. Whether that's C++/Java/C#/Swift/etc doesn't make as much of a different as the leap to OO itself.

Or you could approach it using functional programming (Common Lisp, Haskell, Clojure, F#, and many others)... FP is not nearly as widespread as OO, but can be better suited for solving some problems like concurrency.
Reply With Quote
  #12  
Old 08-03-2015, 05:52 AM
dekutree64 dekutree64 is offline
Registered User
 
Join Date: Nov 2009
Location: Kansas City, Missouri
Posts: 1,263
Default

Quote:
Originally Posted by harmonics101 View Post
If what I need to understand is the underlying model of the language, why aren't there any good text books out there explaining this? Most of the books I see out there are either (1) Esoteric S.R. Bourne type publications or (2) Mechanics of creating Hello World Programs.
That's a good question. It seems like most books try to insulate you from understanding the machine, but that sort of defeats the purpose of using a language like C++ in the first place. So here's a quick overview:

There is memory, and there are CPU registers. Memory (RAM) is just a huge array of bytes, usually billions these days. A memory address is just a number... an index into that array.

CPU registers are a sort of memory too, but internal to the CPU, and there are just a few of them. Usually 32 or 64 bits each, and they are referred to by name rather than having addresses. The CPU performs operations on registers, such as adding the value of one to the value of another, or writing the value out to memory, or loading a value from memory into a register. When performing memory operations, you need a second register which contains the memory address that you're writing/reading from.

There's also a special register called the program counter, which contains the memory address of the next instruction for the CPU to execute. The program is just more ones and zeroes out in memory somewhere, which the CPU interprets to mean different operations.

In C++, pointer variables are internally no different from integers. A pointer stores a memory address. Doesn't matter what type of thing it points to, a pointer is always just a number. Either 32 or 64 bits depending on whether you're compiling for 64-bit Windows or not (32-bit pointers can only reach 4GB of unique memory addresses). The pointer type only comes into play when you dereference the pointer. Then the compiler will output appropriate instructions, for example to load an 8 bit value or 32 bit value from memory into a register, perform some operations on it, maybe write it back to memory, or whatever else the C++ code says to do with the variable pointed to.

Function calls basically boil down to saving the current program counter to memory (push it onto the stack) and then set the program counter to the memory address of the function. The CPU continues executing from there, and at the end of the function will be an instruction to read the saved program counter value back from memory (pop it off of the stack). Thus the CPU continues executing from the location that the function was called from.
Reply With Quote
  #13  
Old 08-03-2015, 06:02 AM
Dru Edwards Dru Edwards is offline
Registered User
 
Join Date: May 2007
Location: Nova Scotia
Posts: 43,433
Default

Quote:
Originally Posted by harmonics101 View Post
My bread and butter has been Health Care, so that's where I'm planning on staying at this time,

H
Another option is to get a certification in HL7, Version 2.x or 3.x. It's a health care messaging standard. Lots of work out there in messaging. I'm sure you're aware of it since you're in the health care industry.
Reply With Quote
  #14  
Old 08-03-2015, 07:23 AM
dhalbert dhalbert is offline
Dan - Charter Member
 
Join Date: Sep 2012
Location: Eastern MA
Posts: 1,669
Default

Quote:
Originally Posted by harmonics101 View Post
My bread and butter has been Health Care, so that's where I'm planning on staying at this time
Is the proprietary language MUMPS or some derivative of that? I can see how that would be a big shift.

If you are going to stay in health care, then Java certainly makes more sense. To learn the language, you could just start with the official online tutorial. Another choice might be the front part of the latest edition of Java in a Nutshell. I used an earlier edition of this in the past when I first learned Java. It was very succinct but easy to get through.

You might consider various online video courses as overviews.

I have a friend who likes the Deitel and Deitel books, though I find them very dry (but I was just trying to look something up).

Once you get past the language, Java is all about the vast set of libraries available, both built-in and add-on, like the various Apache libraries, Spring or Java EE stuff, etc. Depending on where you walk, some high-level decision has often been made to use some framework, which will very much affect how you write code.

Java 8 added a number of features (lambdas, streams (not the I/O kind), etc.) that make doing functional-style and implicitly concurrent programming much easier. I am currently reading and enjoying Java SE 8 for the Really Impatient, which is a very concise and clear intro to the new features.

If your proprietary system used its own non-relational database model, then you might also need to catch up on SQL and relational databases, and also check out the latest "NoSQL" trends and fads.

Don't get hung up on the IDE's yet. They are just the power tools. Choice is a matter of personal taste. Eclipse is the most common, but people also like IntelliJ (there's a free version). I like NetBeans, which I find to be somewhat more lightweight.
Reply With Quote
  #15  
Old 08-03-2015, 09:25 AM
harmonics101 harmonics101 is offline
Guest
 
Join Date: Feb 2009
Location: Eastern Washington - Idaho
Posts: 7,495
Default

Yep, it's a Mumps derivative. The language used to implement the system is actually an FP. They (the vendor) did start development where they had their own OS and language they both hosted. Course, that was in the mainframe years BM (before Microsoft). Nowadays though, you're either using MS to host your stuff or your pretty much out of business (sure there still are the few Unix shops around). It's rather ironic, their (Health Care Vendor) microkernel OS is ten fold more stable than MS, and now they've got to take the system down for bug fixes and security patches monthly, whereas before, when they were hosting their own OS, they were taking the system down maybe once a year.

Anyway, I agree, concentrate on the language and not the IDE, but that's tough to do sometime when the IDE is pretty much required (under MS at least) to get some source code written,

H
Reply With Quote
Reply

  The Acoustic Guitar Forum > Other Discussions > Open Mic






All times are GMT -6. The time now is 10:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright ©2000 - 2022, The Acoustic Guitar Forum
vB Ad Management by =RedTyger=