Computer programming thread

This is the polite off topic forum. If you’re looking to talk smack and spew nonsense, keep moving along.

Moderators: mgil, chromoly

Post Reply
User avatar
mgil
Shitpostmaster General
Posts: 8483
Joined: Wed Sep 13, 2017 5:46 pm
Location: FlabLab©®
Age: 49

Re: Computer programming thread

#621

Post by mgil » Tue Jan 21, 2020 7:57 am

Java will likely persist for quite a while, but newer languages are so much easier to implement. Go/Golang looks very much like C++ as well, which is a huge benefit.

JonA
Registered User
Posts: 2138
Joined: Fri Sep 29, 2017 7:00 am
Age: 48

Re: Computer programming thread

#622

Post by JonA » Tue Jan 21, 2020 8:01 am

mgil wrote: Tue Jan 21, 2020 7:32 am Java is being slowly forgotten (and JavaScript =/= Java),
I'm not sure I'd agree with that. Java (and its ecosystem) is still the predominant platform for many corporate backend systems. But that's about as far from "game programming" as you can get. :lol:

User avatar
mgil
Shitpostmaster General
Posts: 8483
Joined: Wed Sep 13, 2017 5:46 pm
Location: FlabLab©®
Age: 49

Re: Computer programming thread

#623

Post by mgil » Tue Jan 21, 2020 8:12 am

JonA wrote: Tue Jan 21, 2020 8:01 am
mgil wrote: Tue Jan 21, 2020 7:32 am Java is being slowly forgotten (and JavaScript =/= Java),
I'm not sure I'd agree with that. Java (and its ecosystem) is still the predominant platform for many corporate backend systems. But that's about as far from "game programming" as you can get. :lol:
I'm just thinking that as those slowly migrate to JavaScript and web based code, that Java will fade...

User avatar
rjharris
Registered User
Posts: 835
Joined: Thu Sep 21, 2017 5:23 am
Location: Champaign, IL
Age: 39
Contact:

Re: Computer programming thread

#624

Post by rjharris » Tue Jan 21, 2020 8:21 am

i'm late in this thread, but if you're aiming to do C++ in a relatively short time, I would emphatically not start with C. one is technically a superset of the other, but they're different enough philosophically that i would just learn C++ first.

that said, i really think python is really the way to go. ime, resources for python are much more beginner friendly. spend like a year learning python, get really good w/ thinking about code, and some intro algorithms, some basic oop, and then you can go on to learn nuts and bolts of how to to things in C++ etc.

JonA
Registered User
Posts: 2138
Joined: Fri Sep 29, 2017 7:00 am
Age: 48

Re: Computer programming thread

#625

Post by JonA » Tue Jan 21, 2020 8:30 am

mgil wrote: Tue Jan 21, 2020 8:12 am
JonA wrote: Tue Jan 21, 2020 8:01 am
mgil wrote: Tue Jan 21, 2020 7:32 am Java is being slowly forgotten (and JavaScript =/= Java),
I'm not sure I'd agree with that. Java (and its ecosystem) is still the predominant platform for many corporate backend systems. But that's about as far from "game programming" as you can get. :lol:
I'm just thinking that as those slowly migrate to JavaScript and web based code, that Java will fade...
Yes, but much of the backend resources that those web pages and JavaScript is working with are developed with Java.

Also, mobile development is also predominantly Java/Android. (Which _is_ related to game development)

kingsamj
Registered User
Posts: 101
Joined: Fri Jan 03, 2020 11:46 am
Age: 36

Re: Computer programming thread

#626

Post by kingsamj » Tue Jan 21, 2020 11:05 am

JohnHelton wrote: Fri Jan 17, 2020 11:13 am Maybe this has been covered (long thread, fairly technical), but I will just ask the question.

My son (15) wants to program video games (surprise). He will be taking AP computer science next year, but I know that won't get him very far towards his goal. He thinks he wants to start learning to program by starting with C++. I use to program in the '90s, so I have some experience. However, things have changed a bunch in the last 20 years. Any advice on where he should start? I was thinking Java would be a good place to start, but there are so many options now. I plan to learn (relearn) alongside him (as just one more hobby for myself). Given the short attention span of a teenage, I feel like whatever he learns should feel productive for him sooner rather than later. I don't want him to get bogged down and lose interest.

Any advice is appreciated.
I'm a game programmer by profession (on big AAA console games, going on ten years now). My thoughts: the early programming stuff is going to be boring as fuuuuck. When he starts self teaching C++ or whatever other language it's gonna feel like it's a million miles from what he wants to be doing. That's fine, he has to learn the fundamentals and he just has to bear with it for a while. If he wants something more immediately gratifying he can dabble with Unity (which uses C#). Unity has a bunch of beginner tutorials so he can probably get something simple up and running in a few weeks. In fact, it'd probably be an edifying process to set a goal to eg make a space ship that can fly around in Unity.

As for what language to start with, IMO it doesn't matter a ton. C# is applicable to unity, which is a big plus for someone interested in games. C++ is particularly difficult, but it is what the overwhelming majority of 60 dollar PS4/xbox1 games are made with. Python is good for writing quick console programs and learning high level language concepts. It won't hurt if he dabbles in a bunch of languages!

User avatar
JohnHelton
Registered User
Posts: 4443
Joined: Wed Apr 11, 2018 12:17 pm
Location: Bozeman, MT
Age: 51
Contact:

Re: Computer programming thread

#627

Post by JohnHelton » Tue Jan 21, 2020 11:12 am

Thanks for the info, @kingsamj. I'm passing all this input on to him.

User avatar
Mattjd
Registered User
Posts: 860
Joined: Mon Sep 18, 2017 8:52 pm
Age: 31

Re: Computer programming thread

#628

Post by Mattjd » Wed Jan 22, 2020 5:31 am

mgil wrote: Tue Jan 21, 2020 7:57 am Java will likely persist for quite a while, but newer languages are so much easier to implement. Go/Golang looks very much like C++ as well, which is a huge benefit.
The new big hype is a language called Rust which is safer than C++ because it forces you to code in a way such that memory faults can't happen (or happen less). I've never used it because apparently its supposed to protect against iterating a pointer out of an array, and stuff like that.

convergentsum
Registered User
Posts: 826
Joined: Thu Mar 01, 2018 3:44 am
Age: 43

Re: Computer programming thread

#629

Post by convergentsum » Wed Jan 22, 2020 5:42 am

rjharris wrote: Tue Jan 21, 2020 8:21 am i'm late in this thread, but if you're aiming to do C++ in a relatively short time, I would emphatically not start with C. one is technically a superset of the other, but they're different enough philosophically that i would just learn C++ first.

that said, i really think python is really the way to go. ime, resources for python are much more beginner friendly. spend like a year learning python, get really good w/ thinking about code, and some intro algorithms, some basic oop, and then you can go on to learn nuts and bolts of how to to things in C++ etc.
I agree that C++ is properly hard, so much so that it would be an insane choice for a first programming language. Where I disagree slightly is that I don't dislike C as a first programming language. It's simple, close to the hardware (or an abstraction of 1980's hardware), it gets you used to thinking about the computer without several layers of abstract computer science getting in the way. But that recommendation must come tempered with a rather large health warning about how dissimilar C++ is to C, despite superficial similarities.
Python is a good recommendation too. I think I'd rather come to python from C than vice versa, though.

User avatar
Mattjd
Registered User
Posts: 860
Joined: Mon Sep 18, 2017 8:52 pm
Age: 31

Re: Computer programming thread

#630

Post by Mattjd » Wed Jan 22, 2020 5:48 am

mgil wrote: Tue Jan 21, 2020 7:32 am
hsilman wrote: Tue Jan 21, 2020 4:45 am C++ has been the industry standard for the former AFAIK, and Unreal Engine is also C++. Unity is C#.
Yeah, C++ is pretty well dug in.

Java is being slowly forgotten (and JavaScript =/= Java), Python is good but will likely fight competition from Julia and other modern high-level languages as those develop. And Julia relies on C/C++.
Doing linear algebra type stuff in python can be ugly. The notation is fairly whack.

Do love me some Matlab, but its so god damn cumbersome when you have to do anything big, way too many variables to keep track of. Matlab has OOP now, or has for a while but its still very procedural in nature. If that makes sense? I've got friends who work at Mathworks and they claim to do that on purpose. If you learn the vectorization tricks, which now work with their string types, and how to use the anonymous functions with the @fun type functions then you can do some very dense, productive code. The strength in Matlab though isnt the language, its all the god damn toolboxes, and Simulink. Being able to model filters/controllers and then generate C/C++/HDL to your target platform is fucking sweet. One of my friends took a reinforcement learning class. They modeled a quadcopter in Simulink and trained a reinforcement learning algorithm with that model. They got a basic ass autonomous drone running with that algorithm, running it on an Nvidia Jetson.

Python is king for data science though. Dealing with huge amounts of tabular data with Pandas module is the fucking bee's knees. I had just learned this recently but apparently its all based on this math called Relational Algebra. Same stuff used for developing SQL and dataframes in R. Python also provides a plotting module called Bokeh. Its like matplotlib but on crack. Provides interactive plots that are on par with those provided in Matlab.

I haven't used Julia, but I have read quite a few algorithms that speak highly of it but compare it to the Matlab of many years ago, still immature in some areas.

User avatar
rjharris
Registered User
Posts: 835
Joined: Thu Sep 21, 2017 5:23 am
Location: Champaign, IL
Age: 39
Contact:

Re: Computer programming thread

#631

Post by rjharris » Wed Jan 22, 2020 9:31 am

convergentsum wrote: Wed Jan 22, 2020 5:42 am Where I disagree slightly is that I don't dislike C as a first programming language. It's simple, close to the hardware (or an abstraction of 1980's hardware), it gets you used to thinking about the computer without several layers of abstract computer science getting in the way. But that recommendation must come tempered with a rather large health warning about how dissimilar C++ is to C, despite superficial similarities.
Python is a good recommendation too. I think I'd rather come to python from C than vice versa, though.
I think we actually agree. I was more commenting on the path to C++ via C that was implicitly suggested earlier ITT than on the suitability of C as a first language. That said, I like python better as a first language.

User avatar
Mattjd
Registered User
Posts: 860
Joined: Mon Sep 18, 2017 8:52 pm
Age: 31

Re: Computer programming thread

#632

Post by Mattjd » Wed Jan 22, 2020 9:50 am

rjharris wrote: Wed Jan 22, 2020 9:31 am
convergentsum wrote: Wed Jan 22, 2020 5:42 am Where I disagree slightly is that I don't dislike C as a first programming language. It's simple, close to the hardware (or an abstraction of 1980's hardware), it gets you used to thinking about the computer without several layers of abstract computer science getting in the way. But that recommendation must come tempered with a rather large health warning about how dissimilar C++ is to C, despite superficial similarities.
Python is a good recommendation too. I think I'd rather come to python from C than vice versa, though.
I think we actually agree. I was more commenting on the path to C++ via C that was implicitly suggested earlier ITT than on the suitability of C as a first language. That said, I like python better as a first language.
Who implied to do that?

Other than python being easier to use, its also the easiest to get something cool going, which can be a great motivator.

User avatar
Root
Grillmaster
Posts: 1997
Joined: Fri Sep 15, 2017 8:28 am
Location: Western Upper Lower
Age: 44

Re: Computer programming thread

#633

Post by Root » Fri Jan 24, 2020 1:22 pm

Mattjd wrote: Wed Jan 22, 2020 5:31 am
mgil wrote: Tue Jan 21, 2020 7:57 am Java will likely persist for quite a while, but newer languages are so much easier to implement. Go/Golang looks very much like C++ as well, which is a huge benefit.
The new big hype is a language called Rust which is safer than C++ because it forces you to code in a way such that memory faults can't happen (or happen less). I've never used it because apparently its supposed to protect against iterating a pointer out of an array, and stuff like that.
I'm diving into Rust currently. Seems pretty awesome, but I'm just getting started...

User avatar
Mattjd
Registered User
Posts: 860
Joined: Mon Sep 18, 2017 8:52 pm
Age: 31

Re: Computer programming thread

#634

Post by Mattjd » Sat Jan 25, 2020 9:13 am

Root wrote: Fri Jan 24, 2020 1:22 pm
Mattjd wrote: Wed Jan 22, 2020 5:31 am
mgil wrote: Tue Jan 21, 2020 7:57 am Java will likely persist for quite a while, but newer languages are so much easier to implement. Go/Golang looks very much like C++ as well, which is a huge benefit.
The new big hype is a language called Rust which is safer than C++ because it forces you to code in a way such that memory faults can't happen (or happen less). I've never used it because but apparently its supposed to protect against iterating a pointer out of an array, and stuff like that.
I'm diving into Rust currently. Seems pretty awesome, but I'm just getting started...
I know a guy from school, fwiw I consider him pretty intelligent, and he wont stfu about it. He likes programming stm32s with it. From what I read, the biggest pita is just getting used to the compiler smacking your hand all the time and changing your thought process on things that you would normally do in C++.

User avatar
Root
Grillmaster
Posts: 1997
Joined: Fri Sep 15, 2017 8:28 am
Location: Western Upper Lower
Age: 44

Re: Computer programming thread

#635

Post by Root » Sat Jan 25, 2020 1:01 pm

Mattjd wrote: Sat Jan 25, 2020 9:13 am
Root wrote: Fri Jan 24, 2020 1:22 pm
Mattjd wrote: Wed Jan 22, 2020 5:31 am
mgil wrote: Tue Jan 21, 2020 7:57 am Java will likely persist for quite a while, but newer languages are so much easier to implement. Go/Golang looks very much like C++ as well, which is a huge benefit.
The new big hype is a language called Rust which is safer than C++ because it forces you to code in a way such that memory faults can't happen (or happen less). I've never used it because but apparently its supposed to protect against iterating a pointer out of an array, and stuff like that.
I'm diving into Rust currently. Seems pretty awesome, but I'm just getting started...
He likes programming stm32s with it.
I may need to talk to your friend.

User avatar
JohnHelton
Registered User
Posts: 4443
Joined: Wed Apr 11, 2018 12:17 pm
Location: Bozeman, MT
Age: 51
Contact:

Re: Computer programming thread

#636

Post by JohnHelton » Mon Jan 27, 2020 5:15 pm

When you are teaching yourself to program (again), and you are a lifting nerd. This is python.

Code: Select all

one_rep_max = input("Enter your 1RM: ")
num_of_reps = input("Enter the desired rep count: ")
hnfm = input("Enter target HNFM: ")

one_rep_max = float(one_rep_max)
num_of_reps = int(num_of_reps)
hnfm = int(hnfm)

PLATE_SIZE = 2.5
# Determining number of reps, assuming RIR = num_of_reps + 1
# Using a formula derived from Wendler's 1RM formula
weight_on_bar = one_rep_max * 30 / (num_of_reps * 2 + 31)
weight_on_bar = PLATE_SIZE * round(weight_on_bar / PLATE_SIZE, 0)

# Determining number of sets given HNFM
percent_intensity = weight_on_bar / one_rep_max
hnfm_per_rep = 1 / (1 - percent_intensity) ** 2
num_of_sets = int(round(hnfm / hnfm_per_rep / num_of_reps, 0))
actual_hnfm = int(hnfm_per_rep * num_of_reps * num_of_sets)

print(f"You should lift {weight_on_bar} for {num_of_sets} sets")
print(f"of {num_of_reps} reps.")
print(f"The actual HNFM will be {actual_hnfm}.")

User avatar
hsilman
✓ Registered User
Posts: 2842
Joined: Fri Sep 15, 2017 8:31 am
Age: 39

Re: Computer programming thread

#637

Post by hsilman » Tue Jan 28, 2020 4:34 pm

Classes started this week.

Advanced algorithms, no idea because it's probably the worst professor I've ever had in my 13+ years of post secondary education. Dude was like Bill Burr as a teacher, rambling angry tangents. No idea what the class is going to be like yet.

Intro to Theoretical CS. Seems like it's going to be very difficult but very rewarding. Professor seems like a very good teacher.

User avatar
Mattjd
Registered User
Posts: 860
Joined: Mon Sep 18, 2017 8:52 pm
Age: 31

Re: Computer programming thread

#638

Post by Mattjd » Wed Jan 29, 2020 4:52 am

hsilman wrote: Tue Jan 28, 2020 4:34 pm Classes started this week.

Advanced algorithms, no idea because it's probably the worst professor I've ever had in my 13+ years of post secondary education. Dude was like Bill Burr as a teacher, rambling angry tangents. No idea what the class is going to be like yet.

Intro to Theoretical CS. Seems like it's going to be very difficult but very rewarding. Professor seems like a very good teacher.
I am taking a Digital Image Processing course and RF Electronics. RF starts today. Have had two lectures of DIP so far. DIP is completely project based, 1 lecture and 1 lab every week. Midterm is an image we will have to enhance/restore and then final is a project on topic of choice.

DIP is Matlab based and is basically us re implementing built in functions from the Image Processing Toolbox. Seems like a cake walk so far, but I know a lot of Matlab vectorization trickery.

JonA
Registered User
Posts: 2138
Joined: Fri Sep 29, 2017 7:00 am
Age: 48

Re: Computer programming thread

#639

Post by JonA » Wed Jan 29, 2020 7:00 am

hsilman wrote: Tue Jan 28, 2020 4:34 pm Advanced algorithms, no idea because it's probably the worst professor I've ever had in my 13+ years of post secondary education. Dude was like Bill Burr as a teacher, rambling angry tangents. No idea what the class is going to be like yet.

For learning, yeah. But the entertainment value has to be worth the admission.

User avatar
hsilman
✓ Registered User
Posts: 2842
Joined: Fri Sep 15, 2017 8:31 am
Age: 39

Re: Computer programming thread

#640

Post by hsilman » Wed Mar 16, 2022 2:26 pm

JonA wrote: Wed Jan 29, 2020 7:00 am
hsilman wrote: Tue Jan 28, 2020 4:34 pm Advanced algorithms, no idea because it's probably the worst professor I've ever had in my 13+ years of post secondary education. Dude was like Bill Burr as a teacher, rambling angry tangents. No idea what the class is going to be like yet.

For learning, yeah. But the entertainment value has to be worth the admission.
That class sucked and I learned nothing. But he's an easy grader so I ended up taking another one(or two?) with him. Theoretical was very rewarding.

I passed my comprehensive exam, and I'm in my last class now(Networking). I'm assuming I'll pass this class, and I'll have my master's. Just had my first job interview.

Where's everyone else at? I think we all still post here!

Post Reply