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
JonA
Registered User
Posts: 2138
Joined: Fri Sep 29, 2017 7:00 am
Age: 48

Re: Computer programming thread

#601

Post by JonA » Tue Sep 17, 2019 2:09 pm

DoctorWho wrote: Tue Sep 17, 2019 1:23 pm Here is another question: has coding been automated much? For example, why can't I feed my flowchart into the transmorgifier 3000 and get finished code?
Coding is layers upon layers of automation, in the traditional sense. Interpreters/compilers/DSLs/higher level languages, algebraic data types, type level programming, code generation, test generation, code analysis, performance analysis. It goes on and on.

But nobody wants to program with flowcharts because they are unwieldy, not very expressive, difficult to use collaboratively and difficult to version.

But there's plenty of code for generating flow charts. :P

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

Re: Computer programming thread

#602

Post by Root » Tue Sep 17, 2019 6:13 pm

JonA wrote: Tue Sep 17, 2019 2:09 pm
DoctorWho wrote: Tue Sep 17, 2019 1:23 pm Here is another question: has coding been automated much? For example, why can't I feed my flowchart into the transmorgifier 3000 and get finished code?
Coding is layers upon layers of automation, in the traditional sense. Interpreters/compilers/DSLs/higher level languages, algebraic data types, type level programming, code generation, test generation, code analysis, performance analysis. It goes on and on.

But nobody wants to program with flowcharts because they are unwieldy, not very expressive, difficult to use collaboratively and difficult to version.

But there's plenty of code for generating flow charts. :P
Anybody here use hierarchical Statecharts? So wonderfully wieldly compared to flowcharts.

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

Re: Computer programming thread

#603

Post by JonA » Wed Sep 18, 2019 8:33 am

Root wrote: Tue Sep 17, 2019 6:13 pm Anybody here use hierarchical Statecharts? So wonderfully wieldly compared to flowcharts.
Can't say that I've officially used them, but they look pretty much like every whiteboard session I've been involved in.

User avatar
OrderInChaos
Registered User
Posts: 584
Joined: Sun Apr 22, 2018 12:36 pm

Re: Computer programming thread

#604

Post by OrderInChaos » Thu Oct 31, 2019 5:43 pm

Is Corey Althoff's book any good? I've dabbled with "Automate the Boring Stuff" and never really committed to it but overall didn't mind the writing style and was able to learn a little in the first few chapters before Regular Expressions... appreciate any recommendations (or references to old posts?) at that level of pure n00bness!

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

Re: Computer programming thread

#605

Post by convergentsum » Fri Nov 01, 2019 2:44 am

After struggling over a series of meetings to explain an algorithm using hand waves and drawing pictures, i finally resorted to just writing a couple of loops. It's often the clearest, least ambiguous way.

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

Re: Computer programming thread

#606

Post by hsilman » Wed Dec 11, 2019 5:27 pm

Final Exam in Analysis of Algorithms on Monday. I think I'm going to pass, possibly with a B+ but I'll gladly take a B-

Registered for next semester. Taking the advanced algorithms course and the graduate foundation course in Theoretic Computer Science, whatever that means.

User avatar
OrderInChaos
Registered User
Posts: 584
Joined: Sun Apr 22, 2018 12:36 pm

Re: Computer programming thread

#607

Post by OrderInChaos » Wed Dec 11, 2019 7:01 pm

The Helsinki course is legit, thanks for the rec Harry! Also, I'm sitting in this thread humbled and peering deep into my navel about how far behind the curve I am :lol: Good luck on the final!

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

Re: Computer programming thread

#608

Post by Root » Thu Dec 12, 2019 7:08 am

convergentsum wrote: Fri Nov 01, 2019 2:44 am After struggling over a series of meetings to explain an algorithm using hand waves and drawing pictures, i finally resorted to just writing a couple of loops. It's often the clearest, least ambiguous way.


"After several hours, Joe finally gave up on logic and reason, and simply told the cabinet that he could talk to plants and that they wanted water"

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

Re: Computer programming thread

#609

Post by Mattjd » Thu Dec 12, 2019 9:37 am

Found a major bug at work where someone was iterating over an vector in Matlab, and using the values to index. Too bad sometimes that vector of values can contain zero and Matlab is 1 based index. Additionally, their fix was to add a try catch and just Nan the values when the error occurred.

Simplest fix ever. Index based on the indices of that vector rather than the vector itself.

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

Re: Computer programming thread

#610

Post by Root » Thu Dec 12, 2019 10:08 am

Mattjd wrote: Thu Dec 12, 2019 9:37 am Found a major bug at work where someone was iterating over an vector in Matlab, and using the values to index. Too bad sometimes that vector of values can contain zero and Matlab is 1 based index. Additionally, their fix was to add a try catch and just Nan the values when the error occurred.
If the vector is supposed to contain indices, and the vector contains an invalid index, then the bug is in the code that put it there.
Mattjd wrote: Thu Dec 12, 2019 9:37 am Simplest fix ever. Index based on the indices of that vector rather than the vector itself.
Then why have a vector?

denashes
Registered User
Posts: 163
Joined: Wed Dec 27, 2017 10:29 am
Location: Northern VA
Age: 37

Re: Computer programming thread

#611

Post by denashes » Thu Dec 12, 2019 10:15 am

Yeah, if it's an issue of 0-based versus 1-based indexing, wouldn't you just add a one to the vector before using it to index?

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

Re: Computer programming thread

#612

Post by Mattjd » Thu Dec 12, 2019 2:14 pm

Root wrote: Thu Dec 12, 2019 10:08 am
Mattjd wrote: Thu Dec 12, 2019 9:37 am Found a major bug at work where someone was iterating over an vector in Matlab, and using the values to index. Too bad sometimes that vector of values can contain zero and Matlab is 1 based index. Additionally, their fix was to add a try catch and just Nan the values when the error occurred.
If the vector is supposed to contain indices, and the vector contains an invalid index, then the bug is in the code that put it there.
Mattjd wrote: Thu Dec 12, 2019 9:37 am Simplest fix ever. Index based on the indices of that vector rather than the vector itself.
Then why have a vector?
The OG vector doesn't contain indices. It contains monte carlo numbers. The problem is some simulations start at a monte carlo of 0 rather than 1.

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

Re: Computer programming thread

#613

Post by hsilman » Mon Dec 16, 2019 5:36 pm

OrderInChaos wrote: Wed Dec 11, 2019 7:01 pm The Helsinki course is legit, thanks for the rec Harry! Also, I'm sitting in this thread humbled and peering deep into my navel about how far behind the curve I am :lol: Good luck on the final!
Glad to hear it and thanks! I think it went fine. Not perfect, but I'd be gobsmacked if I don't come out just fine with a B or A- or something.

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

#614

Post by JohnHelton » 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.

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

Re: Computer programming thread

#615

Post by hsilman » Fri Jan 17, 2020 1:29 pm

If he wants to start with C++, then I think that's where he should start. It's more important that he's happy with the language selection, then what language it is. The knowledge is pretty easily transferable to Java or Python if he wants to go in that direction, and it's not terrible as far as languages go.

Also, lots of big game studios use C++ for the underlying engine for their games, so that's nice.

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

Re: Computer programming thread

#616

Post by Mattjd » Tue Jan 21, 2020 4:14 am

Not a programmer.


My limited experience, C++ is hard, and there is too much in the language. C is really fucking hard, and it takes like 5 layers of abstraction to do something useful, and I still have trouble with function pointers even though I've been programming micros recreationally for 2 years now.

I think it was Root or Cwd who suggested Python to me a while ago. I've been using that a lot at work. Its far easier to do anything in it than in any other language Ive used (c, c++, matlab, vba (lol)). I've also learned a good bit of functional and object oriented programming from it.

Also this has a shit ton of fun little exercises for a bunch of different languages.


Make sure you differentiate between "taking an existing game engine and making a game" and "developing for a new video game engine". The developers use a shit ton of math from what Ive seen. Like take a gander at shaders and their applications like Pixel Shaders who are used for specular highlight. Thats what I would imagine some developer for the Unreal engine would do. Where as someone at a game studio would take that engine and use it to make video games. I don't know what language is used for either.

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

Re: Computer programming thread

#617

Post by hsilman » 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#.

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

Re: Computer programming thread

#618

Post by mgil » 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++.

@JohnHelton, I'm guessing he's used some of the really simple code stuff like MIT's scratch?

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

#619

Post by JohnHelton » Tue Jan 21, 2020 7:48 am

@mgil, thanks for the feedback. Didn't know the industry was moving away from Java. Good to know. Based on @hsilman's suggestion, I got him this book to get started.

https://www.amazon.com/Beginning-C-Thro ... 407&sr=8-2

I worked through about 90 pages of it yesterday. Pretty straight forward. He has done some simple programming before, so I don't think he will have a problem with it. This is a kid that taught himself multiplication as a 4-year old. When I programmed in the '90s, I think I wrote about half my code in C++. I'm more interested in learning Python myself, but I figured I would go ahead and refresh myself on C++ first so that I could be useful to him.

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

Re: Computer programming thread

#620

Post by JonA » Tue Jan 21, 2020 7:56 am

I'd vote for Python as well.

Very little of game development is actually in the core engine anymore. They all expose higher level interfaces via scripting languages, which is where the vast majority of "development" of the game is actually happening.

Post Reply