Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 536 537 [538] 539 540 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 882754 times)

jaked122

  • Bay Watcher
  • [PREFSTRING:Lurker tendancies]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8055 on: October 04, 2015, 02:48:05 pm »

If you've never used it for like anything before it might be a bit tricky for building something from scratch though.

Honestly my advice is to find a good open source project that uses it that you like (*looks pointedly at his signature*) and help them out. Or at least choose something a tad bit simpler if you intend to build from scratch; it can quickly become a lot of work. (Though I guess if you were doing something like minesweeper it wouldn't be a big deal :P ).
Oh I recognize you from the forum then. Hi.


In any case, the code for Cataclysmdda is very clean, in comparison to a lot of projects that I've had to dig around in. For someone who's familiar with the syntax of c++ but not perhaps the practices, it's not a bad place to start.
So I don't know how many people know (or care about) this, but I've been in an IT (and therefore programming is one of the more important classes) high school for 2 years now, and right now my curriculum covers C++ (no OOP sadly), JavaScript and later on probably also PHP.

And well, sometimes my brain gets completely overwhelmed by the vastness of the IT field as a whole (even though i'm only focused on the fraction of it), yet the stuff I'm doing is relatively simple still.
(I much prefer JavaScript to C++ right now but that's beside the point)

I guess this is a glorified PTW. Depending on how anxious I might feel I'll probably post here sometimes because man oh man am I bad at programming...or more specifically, math, which from what I gather is a pretty significant part of it.


(Though I'm not the one doing the programming specifically I'm part of a free open source game project I'll probably make a thread about at some point.)



First ask yourself, "Why do I want to use OOP"?


Is the answer along the lines of "Keeping data confined to structures and members relative to them is nice", then don't. If the reason is that your project is complex and would require a lot of duplicated code without it, then that's a good reason to do it.



Of course, I've seen people argue that what c++ calls OOP is not what the concept is meant to provide. Those people aren't helpful either and will likely do one of three things; tell you to learn something with a "better" oop design like smalltalk, objective-c, or any number of pointless unused languages; tell you that java's better, because it has a root object and the point of oop originally had nothing to do with message passing; or tell you to teach yourself a scheme and implement your own object orientation. That last one is the worst, but it is actually easy to do until you want some performance.


OOP isn't something tied to language, it's a method for reducing complexity. You could do it in assembly if you really wanted to(but you probably don't), you can do it in C, and you can do it in any decent language worth learning, and quite a few that aren't.


Object orientation is nonsense if you can find a better way.


 Try functional programming, that's been newly unfucked improved in c++11 so you should be able to use it well.


Functional programming is just another way of reducing the amount of object orientation in a complex project.


Also don't worry, math isn't important in programming. It's important in a lot of things regarding it, but the reason I started to learn programming was because math was too tedious for me to care about, so I wanted machines to do it for me. Besides, if you find it difficult to learn math through equations and rules, then algorithms are an alternative starting point to learn it.

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8056 on: October 04, 2015, 02:57:36 pm »

A good understanding of math can be really helpful in programming. You could, for example, just use the formula for a fibbonaci number instead of writing a function to do this.

Also, OOP is really useful in many cases. Games especially tend to have lots of of duplicate code without it. It's not the sole good programming paradigm, but it's pretty useful.

If you want to immerse yourself in amateurs trying to OO in a shitty framework, building on a shitty codebase, come to tgstation13!
Seriously though, I'm a maintainer for that and the project has helped me massively in learning to code.
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8057 on: October 04, 2015, 03:20:02 pm »

I have heard that there has been OOP-type stuff implemented in COBOL of all things.  If I remember right.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

Mesa

  • Bay Watcher
  • Call me River.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8058 on: October 04, 2015, 03:34:32 pm »

If you've never used it for like anything before it might be a bit tricky for building something from scratch though.

Honestly my advice is to find a good open source project that uses it that you like (*looks pointedly at his signature*) and help them out. Or at least choose something a tad bit simpler if you intend to build from scratch; it can quickly become a lot of work. (Though I guess if you were doing something like minesweeper it wouldn't be a big deal :P ).
Oh I recognize you from the forum then. Hi.


In any case, the code for Cataclysmdda is very clean, in comparison to a lot of projects that I've had to dig around in. For someone who's familiar with the syntax of c++ but not perhaps the practices, it's not a bad place to start.
So I don't know how many people know (or care about) this, but I've been in an IT (and therefore programming is one of the more important classes) high school for 2 years now, and right now my curriculum covers C++ (no OOP sadly), JavaScript and later on probably also PHP.

And well, sometimes my brain gets completely overwhelmed by the vastness of the IT field as a whole (even though i'm only focused on the fraction of it), yet the stuff I'm doing is relatively simple still.
(I much prefer JavaScript to C++ right now but that's beside the point)

I guess this is a glorified PTW. Depending on how anxious I might feel I'll probably post here sometimes because man oh man am I bad at programming...or more specifically, math, which from what I gather is a pretty significant part of it.


(Though I'm not the one doing the programming specifically I'm part of a free open source game project I'll probably make a thread about at some point.)



First ask yourself, "Why do I want to use OOP"?


Is the answer along the lines of "Keeping data confined to structures and members relative to them is nice", then don't. If the reason is that your project is complex and would require a lot of duplicated code without it, then that's a good reason to do it.



Of course, I've seen people argue that what c++ calls OOP is not what the concept is meant to provide. Those people aren't helpful either and will likely do one of three things; tell you to learn something with a "better" oop design like smalltalk, objective-c, or any number of pointless unused languages; tell you that java's better, because it has a root object and the point of oop originally had nothing to do with message passing; or tell you to teach yourself a scheme and implement your own object orientation. That last one is the worst, but it is actually easy to do until you want some performance.


OOP isn't something tied to language, it's a method for reducing complexity. You could do it in assembly if you really wanted to(but you probably don't), you can do it in C, and you can do it in any decent language worth learning, and quite a few that aren't.


Object orientation is nonsense if you can find a better way.


 Try functional programming, that's been newly unfucked improved in c++11 so you should be able to use it well.


Functional programming is just another way of reducing the amount of object orientation in a complex project.


Also don't worry, math isn't important in programming. It's important in a lot of things regarding it, but the reason I started to learn programming was because math was too tedious for me to care about, so I wanted machines to do it for me. Besides, if you find it difficult to learn math through equations and rules, then algorithms are an alternative starting point to learn it.

On the subject of OOP most of my knowledge about it comes from a really amazing Polish YouTuber's tutorials (who does present the actual programming examples in C++ but the overall "theory" stuff is largely universal, like he said in one of the episodes).

Oddly enough programming did somehow help me with math (functions in particular which for a while I did not understand AT ALL, but at least now f(x) makes sense to me...although it made sense for my classmates two years ago, and I'm still generally a full year behind in the class, even though people often tell me I'm better than I give myself credit for...).

Logged

Avis-Mergulus

  • Bay Watcher
  • This adorable animal can't work.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8059 on: October 04, 2015, 10:31:06 pm »

Uh... hey. I haven't been around this thread before, because I didn't really have a reason to, I guess, but here I am. I'm almost completely useless right now, I've only got into programming a year ago (really enjoying it so far, though), and I had done absolutely nothing of that sort before that (discounting Pascal in high school, but that doesn't count for various reasons). I have a couple possibly-stupid questions to ask if somebody can spare the time.

1. Probably the dumbest one. Is it possible to like, start learning programming too late to be useful? I mean, roughly how long does it take before you have a more-or-less developed (marketable, if you will) skill at coding? Because I had classmates and friends that were already competent in like three languages at sixteen or something, and here I am just stumbling through things right now (I'm nineteen myself). I know it's sort of stupid and other people's abilities are largely irrelevant to my own progress, but it just nags at me and I can't get rid of it.

2. Can somebody recommend a good book or manual on programming in general, not any specific language? Just basic principles and guidelines that would be useful wherever. If there is such a thing, of course. I realize that's a bit broad, so just... I mean, what's a good read?

3. Right now, I'm learning Python, R, and SQL (I'm more or less a linguistics major minoring in data mining). What else would be useful or enlightening to pick up in addition to those?

I may seem a little clueless, but that's probably because I am.
Logged
“See this Payam!” cried the gods, “He deceives us! He cruelly abuses our lustful hearts!”

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8060 on: October 04, 2015, 10:44:26 pm »

1: It's never too late to start learning programming. I started when I was about 22 or so.
2: I downloaded a PDF book on C++ recommended on some microsoft site, but I don't remember the name.
3: C# is a really great language, despite what the linux zealots may tell you, and has a very thorough and detailed documentation on MSDN. Also C++ is a good low-level language.
Logged

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #8061 on: October 04, 2015, 10:57:50 pm »

competent in like three languages at sixteen or something
Heh. I started programming when I was 12/13 or so - barely understanding anything. When I took a computer science class in highschool everyone thought I was Steve Wozniak reincarnated because I already knew how to print ("Hello, World!"). I played along with it and (somehow) managed to bullshit my way through as being hypercompetent when in reality I was only half a lesson ahead.
Which is basically just a really longwinded way of saying that when a sixteen-year-old says they're competent in three languages they're probably exaggerating.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Avis-Mergulus

  • Bay Watcher
  • This adorable animal can't work.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8062 on: October 04, 2015, 11:03:52 pm »

competent in like three languages at sixteen or something
Heh. I started programming when I was 12/13 or so - barely understanding anything. When I took a computer science class in highschool everyone thought I was Steve Wozniak reincarnated because I already knew how to print ("Hello, World!"). I played along with it and (somehow) managed to bullshit my way through as being hypercompetent when in reality I was only half a lesson ahead.
Which is basically just a really longwinded way of saying that when a sixteen-year-old says they're competent in three languages they're probably exaggerating.
I suspected that. My problem is that I sort of rotate in rather tech-heavy circles, and so I know a lot of people my age who are definitely more competent than me. Eh, I'm just being jittery, probably. The feeling of being late to the party is just hard to shake.
Logged
“See this Payam!” cried the gods, “He deceives us! He cruelly abuses our lustful hearts!”

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8063 on: October 04, 2015, 11:12:15 pm »

yeah, I'm taking a couple "CS" classes right now (more about practical applications of computers than computer science, which should probably refer strictly to the math) and showed off the material helper for a presentation we had to do

my favorite question was "did you do all of that?"

About competency, though: depends on how you define that. I'd say I'm only really competent in Lua, but I have a shitload of stuff in other languages. I am fully willing to say that I'm able to code in 5 other languages, but I wouldn't say I'm competent.

I would say that number of languages known is not a sign of programming competence. Learning a new programming language is not like learning a new spoken or written language.

I wouldn't even say my competency in lua is a sign of anything; that just means that I know how to use metatables well.

I started programming when I was 18. Just checked, first script I released was in March 2013, and that was literally a copy+paste of Quietust's code with some minor adjustments made by me.
« Last Edit: October 04, 2015, 11:14:18 pm by Putnam »
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #8064 on: October 05, 2015, 03:23:30 am »

I feel that after a point, if you know any C-like language you know all of them. Mostly a matter of syntax plus each language's quirks.

I started C++, with a tutorial. Then I learned Python on my own really quickly, involving heavy usage of documentation and knowing the major syntax differences. Then JS, lua, tk, java, perl, C# more or less are easy enough to pick up and do basic competency in. It doesn't mean you're instantly a guru in those langs, but you can do stuff in them.

Lisp and haskell, on the other hand...
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Antsan

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8065 on: October 05, 2015, 05:37:13 am »

1. Probably the dumbest one. Is it possible to like, start learning programming too late to be useful? I mean, roughly how long does it take before you have a more-or-less developed (marketable, if you will) skill at coding? Because I had classmates and friends that were already competent in like three languages at sixteen or something, and here I am just stumbling through things right now (I'm nineteen myself). I know it's sort of stupid and other people's abilities are largely irrelevant to my own progress, but it just nags at me and I can't get rid of it.
You'll probably be fine.

Quote
2. Can somebody recommend a good book or manual on programming in general, not any specific language? Just basic principles and guidelines that would be useful wherever. If there is such a thing, of course. I realize that's a bit broad, so just... I mean, what's a good read?
"The Structure and Interpretation of Computer Programs": It uses Scheme as a programming language, but it is not about Scheme.
I hear "The Book of Shen" is good, but this is about the Shen language specifically while introducing you to the mathematical side of programming. I just ordered it so I cannot really tell you whether it's any good, but the author definitely knows what he's talking about.

Quote
3. Right now, I'm learning Python, R, and SQL (I'm more or less a linguistics major minoring in data mining). What else would be useful or enlightening to pick up in addition to those?
Common Lisp can teach you much about how compilation works. It's a mind-expander.
Haskell is good to pick up. It helped me writing cleaner programs and thinking about how data are transformed.
Take a look at Prolog so you don't get any ideas of how programming should be like this or that. There are very different ways to program and having a grasp on how varied these different ways are helps you coming up with unusual solutions.
You don't need to learn any of those, but I advise to take a look at the Esolangs-Wiki.
« Last Edit: October 05, 2015, 05:38:50 am by Antsan »
Logged
Taste my Paci-Fist

Malus

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8066 on: October 05, 2015, 07:53:43 am »

The problem with the tutorials that are easily found on the web (at least, with those ones that I've skimmed over so far) is that they are quite brief and not much eloquent. 'Live' examples would be much preferable for a knockhead like me. I mean, I know what a pointer in C is, so what? Some say pointers are great giving simplistic examples (like a swap function) which are useful to simply demonstarte the work pointers do, but utterly unconvincing to me in terms of why I would ever care about pointers since I see no applications of them in a field of activity that interests me. And the information that is not in active use tends to be treated carelessly and eventually gets forgotten because one has more important things to take into consideration.
As far as "live examples" go, Handmade Hero is simply the best resource I've come across. The gist of it is, a seasoned game/engine programmer codes a complete game from scratch (meaning no libraries) 100% on camera, in C++. I knew a bit of C before I started following along and haven't had any issues keeping pace. Sometimes topics are kind of rushed through, but the explanations are more than adequate (especially when you can just go and fiddle around with the source until you really understand why it works). Link to the episode guide here: https://forums.handmadehero.org/jace/guide/

The "Instantaneous Live Code Editing" that's introduced in Day 22 was something I never would've realized was possible in C/C++. Now I wonder how I ever programmed without it. Basically if you compile your main game logic as a .dll that's called by a helper executable, you can have your game running, go into the source, edit a few lines, recompile the .dll, and then see the changes immediately reflected without restarting the game executable. So useful when fiddling with physics constants and trying to get the feel of something right, or when mucking about with the rendering code and wanting to see changes reflected live. It's the kind of stuff most people resort to throwing in a scripting engine for, but you can just do it all in C. It's great. Demo: https://youtu.be/YAaqiKuSmsk?t=2843
Logged

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8067 on: October 05, 2015, 08:29:30 am »

What is handmade hero? It seems like a really cool project?
Logged

Malus

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8068 on: October 05, 2015, 08:40:25 am »

What is handmade hero? It seems like a really cool project?
Basically just a daily ~1hr Twitch stream that's archived on YouTube. The videos are free, access to the game/source code costs money (though there's not really anything stopping you from just typing the code from the videos verbatim since it's all recorded). I think the plan is to release the complete source into the public domain 2 years after the game officially launches on Steam. I probably should've linked to the main site too, so here it is: https://handmadehero.org/
Logged

Dutrius

  • Bay Watcher
  • No longer extremely unavailable!
    • View Profile
    • Arcanus Technica
Re: if self.isCoder(): post() #Programming Thread
« Reply #8069 on: October 05, 2015, 12:37:11 pm »

Hmmm...

Does any one know how to get started with LINQ and LINQ to XML?
Logged
No longer extremely unavailable!
Sig text
ArcTech: Incursus. On hold indefinitely.
Pages: 1 ... 536 537 [538] 539 540 ... 796