General Using ChatGPT to program in Python, C, and Java - Artificial Intelligence (AI) general discussion

Everybody's heard of ChatGPT at this stage. It's an AI-powered chatbot that makes use of natural language processing models to produce answers to complicated questions. Those answers may not necessarily always be accurate, but they tend to be...
See....
Using ChatGPT to program in Python, C, and Java
ChatGPT is scarily good at writing code.
www.xda-developers.com

Related

What Programming Language should i learn first??

im a noob to programming and since school is now over i would like to get started with some android dev. But first want to learn a Computer language, which one would be ideal for Android Dev?
It's not hard at all I don't know any languages and I made my own rom I have advanced knowledge in cmd though, but I guess if you had to pick on I see a lot of XML documents so try that.
c++ hands down.
EDIT:
Wait didn't read all of your post.
Android apps are written in Java...end of story.
There is a MonoDev thingy somewhere that lets you write in C# and convert...but I am not sure how well that will work.
To get started in programming and actually have a comprehension of what you are doing. c++ and console apps.
You can't do GUI until you understand what is going on in the background.
EDIT #2:
Beers are getting to me, and I am gettin lng winded.:
Google Dev site has a VERY good tutorial on setting up Eclipse (The prefered Android Dev IDE) and also some decent tutorials on writing an app.
Hello World doesn;t count in Android, Elcipse write the whole dam program for you by detalt.
english ftw
Kcarpenter said:
c++ hands down.
EDIT:
Wait didn't read all of your post.
Android apps are written in Java...end of story.
There is a MonoDev thingy somewhere that lets you write in C# and convert...but I am not sure how well that will work.
To get started in programming and actually have a comprehension of what you are doing. c++ and console apps.
You can't do GUI until you understand what is going on in the background.
EDIT #2:
Beers are getting to me, and I am gettin lng winded.:
Google Dev site has a VERY good tutorial on setting up Eclipse (The prefered Android Dev IDE) and also some decent tutorials on writing an app.
Hello World doesn;t count in Android, Elcipse write the whole dam program for you by detalt.
Click to expand...
Click to collapse
ok so java is the way to go, then from there learn c++ ??
did not know that google mobile apps where created using JAVA.
cool...
Kcarpenter said:
c++ hands down.
EDIT:
Wait didn't read all of your post.
Android apps are written in Java...end of story.
There is a MonoDev thingy somewhere that lets you write in C# and convert...but I am not sure how well that will work.
To get started in programming and actually have a comprehension of what you are doing. c++ and console apps.
You can't do GUI until you understand what is going on in the background.
EDIT #2:
Beers are getting to me, and I am gettin lng winded.:
Google Dev site has a VERY good tutorial on setting up Eclipse (The prefered Android Dev IDE) and also some decent tutorials on writing an app.
Hello World doesn;t count in Android, Elcipse write the whole dam program for you by detalt.
Click to expand...
Click to collapse
Julianmgn said:
ok so java is the way to go, then from there learn c++ ??
Click to expand...
Click to collapse
C++ should be anyones first language. It forces you to use your head and the compiler does very litte for you.
If you don't have any care to do any other type of programming your life..or make a career out of it...sure just learn Java...
Theory works the same for all languages...but C++ forces you to be a [email protected] Very unforgiving...more forgiving than plain C...but still.
Kcarpenter said:
C++ should be anyones first language. It forces you to use your head and the compiler does very litte for you.
If you don't have any care to do any other type of programming your life..or make a career out of it...sure just learn Java...
Theory works the same for all languages...but C++ forces you to be a [email protected] Very unforgiving...more forgiving than plain C...but still.
Click to expand...
Click to collapse
thank you sir you've been most helpful and i do plan on making a career out of this...i just wanted to know what i should start with to put my foot through the door...thanks
Kcarpenter said:
C++ should be anyones first language. It forces you to use your head and the compiler does very litte for you.
If you don't have any care to do any other type of programming your life..or make a career out of it...sure just learn Java...
Theory works the same for all languages...but C++ forces you to be a [email protected] Very unforgiving...more forgiving than plain C...but still.
Click to expand...
Click to collapse
Completely agree. My first formal language was C, then C++. Do object oriented C++ first, because it will make you appreciate Java. I am a Java/J2EE dev, but my data structures class was in OO C++ and I am thankful for every day I can write Java and not have to worry about pointers, memory allocation and segmentation faults. I have done some embedded C, which is the other end of the spectrum cause you are doing everything by direct addressing of memory, which is also kinda fun.
If you want to go straight into Android development, than yes you can make the jump to Java, and the SDK does allow for both XML based UI design, and Swing-like. Just make sure you read up on garbage collection within the JRE(Make sure you understand what weak and soft referances are) and also there are some talks from Google IO in the past years that touch on some good practices.
BTW, XML is not a programming language, it is a markup language. It is most commonly used in serializing data, mostly because it too is object oriented. One alternative to XML that is becoming more popular due to the increasing amount of AJAX applications is JSON. Also, if you do any XML parsing, make sure you know the difference between a DOM based parser(JDOM) and an event-based parser(SAX), using the right one can drastically increase performance.
lineman78 said:
Completely agree. My first formal language was C, then C++. Do object oriented C++ first, because it will make you appreciate Java. I am a Java/J2EE dev, but my data structures class was in OO C++ and I am thankful for every day I can write Java and not have to worry about pointers, memory allocation and segmentation faults. I have done some embedded C, which is the other end of the spectrum cause you are doing everything by direct addressing of memory, which is also kinda fun.
If you want to go straight into Android development, than yes you can make the jump to Java, and the SDK does allow for both XML based UI design, and Swing-like. Just make sure you read up on garbage collection within the JRE(Make sure you understand what weak and soft referances are) and also there are some talks from Google IO in the past years that touch on some good practices.
BTW, XML is not a programming language, it is a markup language. It is most commonly used in serializing data, mostly because it too is object oriented. One alternative to XML that is becoming more popular due to the increasing amount of AJAX applications is JSON. Also, if you do any XML parsing, make sure you know the difference between a DOM based parser(JDOM) and an event-based parser(SAX), using the right one can drastically increase performance.
Click to expand...
Click to collapse
thank you sir's, i will then start on c++ right away lol...well tomorrow haha
yeah cuz this is my career path of choice and i now know how to get started thank u lol
If you wanted to get started in programming apps for Android then you might as well start with Java since that is what it uses and will get you going the quickest.
If programming is something you would like to pursue then I would recommend a slightly different longer route.
First and foremost is stay away from doing anything visual. You want to just program console apps. The visual GUIs come later after you have an understanding of programing and it will only confuse you this early on.
For a complete newbie I would recommend playing around with some form of BASIC. You don't really need to but I feel it helps to start understand the ideas of programming.
From there I would highly recommend regular old C. C code will actually work in C++ but I recommend C so that you stay away from some of the stuff in C++. Mainly the Object Oriented parts of C++.
First you need to learn about data types, variables, arrays, loops, and functions.
After that then I would recommend jumping into C++ for a little bit to program some classes. Just to understand classes a little bit. Then I think move over to Java to start to fully understand object oriented programing and learn more about problem solving, algorithms, recursion.
And then after that... well, by that point you probably will know where you should be headed but it will probably involve going back to c/c++ for some more advanced programing, optimization, a better understanding of how everything works down to the compiler and OS level interprocess communications.
centran said:
If you wanted to get started in programming apps for Android then you might as well start with Java since that is what it uses and will get you going the quickest.
If programming is something you would like to pursue then I would recommend a slightly different longer route.
First and foremost is stay away from doing anything visual. You want to just program console apps. The visual GUIs come later after you have an understanding of programing and it will only confuse you this early on.
For a complete newbie I would recommend playing around with some form of BASIC. You don't really need to but I feel it helps to start understand the ideas of programming.
From there I would highly recommend regular old C. C code will actually work in C++ but I recommend C so that you stay away from some of the stuff in C++. Mainly the Object Oriented parts of C++.
First you need to learn about data types, variables, arrays, loops, and functions.
After that then I would recommend jumping into C++ for a little bit to program some classes. Just to understand classes a little bit. Then I think move over to Java to start to fully understand object oriented programing and learn more about problem solving, algorithms, recursion.
And then after that... well, by that point you probably will know where you should be headed but it will probably involve going back to c/c++ for some more advanced programing, optimization, a better understanding of how everything works down to the compiler and OS level interprocess communications.
Click to expand...
Click to collapse
that makes sense...thank you sir very helpful but do u think it would be ok if i just jump into C then C++
Julianmgn said:
thank you sir's, i will then start on c++ right away lol...well tomorrow haha
yeah cuz this is my career path of choice and i now know how to get started thank u lol
Click to expand...
Click to collapse
Don't bother trying to figure out any of the C++ graphics languages, just do some programs with command line interfaces. I would also suggest that once you figure out the basics that you concentrate on object oriented C++ as it will make for an easier transition to Java, but you should also learn the difference in pass by reference and pass by value, which also involves learning about pointers. Also, learn make early on as it will make compilation easier. The Java equivalent to make is Ant when you get there.
This seems to be an okay book to get you started.
I wouldnt suggest working on all data structures, concentrate on some of the more common ones like linked lists and b-trees. In Java, a lot of these are already implemented, but it is good to know how they work. If you want a real challenge try and do a skip list. It is very difficult, but if implemented correctly you should be able to take a file filled with millions of data points of randomized data, read it in and index it for instantaneous search in under a minute.
Julianmgn said:
that makes sense...thank you sir very helpful but do u think it would be ok if i just jump into C then C++
Click to expand...
Click to collapse
That should be fine. Stick to C to learn the basic stuff and then you can then learn some of the object oriented stuff in C++ like classes. That will help you when you move over to Java. You can then start to learn the more complicated stuff.
Like lineman78 said, Java implements some complicated data structures like stacks and linked lists and a bunch of others. Do not use those! When you are making the leap from C++ to Java you are doing so to learn to code those things for yourself.
Oh, and don't let people put you off to C. If you are sticking to the very basics I feel it is a good way to start. Then after you learn a bunch of stuff you can come back to C to learn some of the harder stuff.
centran said:
That should be fine. Stick to C to learn the basic stuff and then you can then learn some of the object oriented stuff in C++ like classes. That will help you when you move over to Java. You can then start to learn the more complicated stuff.
Like lineman78 said, Java implements some complicated data structures like stacks and linked lists and a bunch of others. Do not use those! When you are making the leap from C++ to Java you are doing so to learn to code those things for yourself.
Oh, and don't let people put you off to C. If you are sticking to the very basics I feel it is a good way to start. Then after you learn a bunch of stuff you can come back to C to learn some of the harder stuff.
Click to expand...
Click to collapse
thank you and to all of u for ur help...C it is then C++ then java lol
These are my sole opinions and no one else's, take this as you will.
With programming, you shouldn't be bound to a specific language when you first begin; rather you want to learn the semantics and syntax of programming. Whether you start with C++, C, or Java shouldn't make too much of a difference, especially since all three languages are essentially all derivatives of each other.
Java is the highest level language and as such is considered to be a standard language all CS/MIS students have to take nowadays. When I was freshmen in college, I started with C++, but the very next semester -- the CS/MIS department said that C++ would stop being offered and that Java would take its place as a beginner level course.
I'm not saying C++ isn't still used to, because that's not even remotely true; however almost all Universities now teach Java as a beginner CS course for new students, mainly because it's a high level language and it allows for students to learn OOP (Object Oriented programming).
Since your end goal is to develop applications for Android, it's probably best you learn Java, since all the Android apps are built using Java and XML.
Your best resource is the Internet.
You can find University Lectures all over the web. The OpenCourseWare project has grown a lot and allows for the entire world to get an education. For FREE. If you don't know it is, you can go HERE to read more. Basically though, it's a collaboration of the top Universities (MIT, Standard, CIT, Harvard, etc) to provide there coursework and almost all classes they offer to the world. These universities record all there lectures and host them either on their sites or on Youtube. They also provide all the materials you'll need to learn alongside everyone else, as if you were in the classroom yourself. You can go at your own pace; stop, rewind, pause the video if you're stuck, and take as long as you want on the assignments. It's a great way to self-teach yourself programming; plus the Internet will most definitely give you the answer to any questions you get stuck on.
I'm currently doing the Beginner Java course that Stanford is offering (as a refresher). The professor that teaches the course is exceptional and you'll see that my sentiment is echoed in the comments section on Youtube. Stanford's way of teaching Java and especially OOP allows new students to slowly, but surely grasp the OOP concepts (as they can be a little difficult to understand at times). You should benefit from this, just make sure you follow through and do it.
Stanford Java Course
Here's a list of other helpful resouces:
Cosmolearning - Intro to CS
All of MIT's CS Lectures
Google Books -- You'll find endless amounts of books, just search the language you want to learn and have a go.
Good luck.
I was a computer science major for one semester. lol. We started with Java.
the CS/MIS department said that C++ would stop being offered and that Java would take its place as a beginner level course.
Click to expand...
Click to collapse
My university started allowing students to use Java, but still taught in Contrast++ after I finished. It is 2 different teaching styles, and I prefer low level first because it makes you think about things that when you go to a high level language like Java become trivial but useful in optimization. Granted, it is a steeper learning curve this way and I can see why someone would argue that starting with a higher level language is a better approach. But there are things a lot of people do wrong in Java because they don't understand the basics. The most common result is a memory leak or concurrent modification exceptions. Personally, my path was TI-83 programming, BASIC, C, PHP, OO C++, Perl, Java, Javascript.
-------------------------------------
Sent via the XDA Tapatalk App
my progrmmaing path was:
C -> C++ -> Java
also learned
vb,Vb.net and C#.net ,Java Script,PHP
I would recommend starting with C++ (with atleast basics )and then switch over to Java.
go to EDUmobile.org. They offer an Android development program for about 200 bucks with certification ath the end. They also offer iphone.

I want to be an Android developer when I grow up.

I want to focus on developing GUIs but I'm not sure where to start. I just read through a few pages of http://source.android.com/ to get more information and it was helpful but I'm still not sure what my skill set should be. I also went through Google's new App inventor and finished all the tutorials but it still seems like a toy.
I can: design interfaces, code javascript, implement XML (weak on C and Java but I get it), create anything using photoshop or any graphic application, color-coordinate, test and implement and write--I can write technical instructions fairly well.
So... that said, what's a typical Android designer's skill-set?
Thanks.
Patience, mellowness and a strong constitution!
The Android development platforms so far available are pretty poor if you're used to something like Visual Studio. The best option seems to be Eclipse running the Android ADT plugin. There is plenty of documentation about how to get it all up and running and it is quite easy to install and configure. The app inventor is a toy for non-developers to create simple applications and it works well for what it is but as soon as you want more complex UIs or more complex code, especially when it comes to using external libraries, you will need to get into Eclipse.
You have the right skills, in fact I would say UI and graphics design is the weakest area for many developers. It is for me. I can write beautiful functional code that does amazing things but my UIs suck unless they are simple. I always need to find someone who can help me with that. In my experience, and I have a lot of commercial code development experience, good UI design is a widely missing skill. It therefore pays well and is highly sought after. You might consider specialising in it?
Be careful going from C to Java. Java is still a pig of a language, do a little googling for "problems with Java" and be especially careful of the fact that Java passes everything by reference unless you use cloning. If you don't always write very loosely coupled methods and are good with encapsulation, this will bite you and often in very difficult to understand ways. I recommend running through each method with only this in mind before you consider the first version of the method complete.
My advice to you is to get Visual Studio Express (they're free), either VB or C#, it really doesn't matter, and become proficient with object oriented programming, proper error handling and scope of objects and variables. Do these things, and assuming that you have the right mindset to create good code, and you'll protect yourself from all the usual bugs that amateur developers introduce.
Then move back to Java. Java is a lot easier to be proficient in when moving from something like VB or C# because whilst frustrating, due to the things you'll miss, you will at least know rather than "not know what you don't know", if that makes sense.
If you are serious about doing this for a living, buy some books by Steve MacGuire.
"Writing Solid Code"
"Debugging the development process"
If every develope could do what these books teach, we would have a much more capable software world.
Good luck!
I have the same question? What do you think will be future programming? Developing web apps like Facebook or Android apps?
How is with work today?
I did banchelors from computer science, and want to try masters now, but I need to choose developing Androids apps or Webapps. I am pretty good at C#, JavaScript, XML.
There's a lot of milage in mobile apps, will be good for many years but there is no doubt that the future is web apps.
Excellent! What a great response. Source.android has a lot of information on what a developer should know but I still can't find information on Android GUI design--specifically. Any advice on this?
Thanks.
I think everyone should learn some c/c++ or other native language. Most will say im crazy for saying this but to appreciate what comes with the languages u mentioned above(which are all managed code) I think you should learn power and use behind native code.
c#, java, .net are all good places to start, i would not go with vb. If you choose to start with c/c++ you will be able to do any of the above easily. Tho others think its harder to learn...I say others bc i have always preferred c/c++ to the above.
Simonta... You rock!
Many Thanks.

Java programming metaphor

Hey guys,
I'm considering taking some classes and reading some books to begin to learn how to program in java. I was trying to think of a metaphor that would allow me to understand how complicated it is... This is the best I came up with
Right now, I feel like a two year old learning english... I can say some words, and I kind of know what they mean.
But what do I have ahead of me.
Is writing a basic program comparable to a two year old writing a 100 page book? 1000 pages?
thanks.
I wouldn't say its comparable to learning to write or speak a new language. Its learning logic, the words we use to describe the logic is really irrelevant to the program. It may enable some functions or make it so our brain can easily recognize patterns but the java language in the end is irrelevant, its the ideas of object oriented programming and logic that our far more important. Java is more of a brush in which you paint with.
It really isn't that hard, just start with the basics.
From something awesome
All I can say is it's similar to any other skills. It will be easy when you always practice.
Sent from my SGH-T959 using XDA App
Its learning logic, the words we use to describe the logic is really irrelevant to the program.
Click to expand...
Click to collapse
I'm not sure how college CS classes are now, but before we ever coded, we took logic, flowcharting, desk-checking, program flow, pseudo code, hierarchy charts and modular programming.
As I've progressed in my career, I've learned probably 7 other languages on top of the C/C++ I first learned. Learning the syntax of a language is somewhat trivial compared to what I stated above and what killer wrote.
For me, it's seeing the program in my head; where I want to go and how to get there.
Rootstonian said:
I'm not sure how college CS classes are now, but before we ever coded, we took logic, flowcharting, desk-checking, program flow, pseudo code, hierarchy charts and modular programming.
As I've progressed in my career, I've learned probably 7 other languages on top of the C/C++ I first learned. Learning the syntax of a language is somewhat trivial compared to what I stated above and what killer wrote.
For me, it's seeing the program in my head; where I want to go and how to get there.
Click to expand...
Click to collapse
I had to take program design, logic, and methodology classes before taking any programming class. Even before HTML. But it really helped. Learning programming logic and learning how a program is developed without being overwhelmed with learning the language as well was quite helpful. Once I got to programming real code, I understood logic(a lot more than I did) and terms. It allowed me to focus on just learning how the language worked. I don't recommend learning Java as your first language. But it was my first. Well, if you don't count HTML/XHTML. I don't. But if you are dedicated and looking to challenge yourself , you can pick it up. Good luck.
-Ken
Sent from my iPhone with the bigger GeeBees.

Visual Basic, C#, or Java programming?

I am currently working on my associates and I need 4-5 credits in BPC, CIS, and some others. I was wondering which classes would better suite me if I wanted to start getting into the hacking and rom building scene.
I have all ready taken a class on C++ so I have a basic starting point on how programming languages operate, but that class didn't transfer to the school I'm currently going to. So my question is, which classes would better suite me (I only need 2 in order get my degree seeing as they are 3 credit classes) to assist with becoming better developer for android?
all insight is welcome, but searching for developers insight...
Java would be best if you want to work with Andriod, as a lot of the code is java, and what isn't in java is mostly C I believe, and possibly a few other languages thrown in.
imnuts said:
Java would be best if you want to work with Andriod, as a lot of the code is java, and what isn't in java is mostly C I believe, and possibly a few other languages thrown in.
Click to expand...
Click to collapse
In the android source there should be c++ besides Java. As for kernel it's mostly C and ASM
Sent from my Incredible 2 using XDA App
FORTRAN 77
Seriously, though, you might consider adding a Linux course or two if they're available and you haven't done so already...
Has anyone seen John Connor?
Checked for linux and there was none. That was my first search. Now should I do c++ and the course that follows c++2. Or a little of both. C and Java. There is also a Java level 2
Sent from my SCH-I500 using XDA App

[Q] Are there any scripting APPs for the iPad?

i'm just starting out with coding and i was wondering if there any apps for the iPad that implement javascript? I know it's rather ironic to be coding on java with an iPad but since I am stuck in college for long periods of time, its the only convenient way for me to learn it and because i have books teaching me java, it would be awesome if i could test out the codes using an iPad.
You're confusing your terms a bit. You mentioned both Java and Javascript and although they have a similar name, the two languages share very little in common.
If you meant to ask if the iPad could run Java code, the answer would be no, not natively. I don't have an iPad to test, but this site, ideone.com, is able to compile and run many languages including Java.
If you meant to ask about Javascript, the of course you can run it in any browser including Safari. Javascript is not a compiled language like Java so it's requirements are a lot lower in terms of runtimes.
At this forum not many members own an iPad. Ask at an Apple forum.

Categories

Resources