• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Programming!

Serene Grace

Pokémon Trainer
3,428
Posts
14
Years
It does not suck. Those people here who are against it couldnt or wouldnt try to understand the language. Its got its bad things as well as good, every language does but it wouldnt be used for countless games/game engines if it was such a bad language. Just look at EPIC Games and the Unreal Engine(C++ at its finest)... C++ is a great language for those who can understand it and use it properly
I wasn't actually being serious when I said C++ sucked, I was making fun of the fact that there are constant arguments online about C++ in which C fans slate its apparently rushed creation and C++ fans backlash by slating C's old fashioned practices.

Personally I think C++ is a promising language and, once I get to studying it properly tonight, I'll give my feedback into what I think about it. The main reason I'm learning it, though, is because it's an unmanaged language and I think it'll be helpful to learn a managed language before starting my degree in Computer Science (that, and I have a theory paper that has a section on Operating Systems which may contain memory management).

Also, what do you guys think of programming languages such as PHP who implemented an object oriented approach alongside their normal procedural approach - do you think languages should distinctively have one paradigm, or most programs should embrace both procedural and object oriented approaches, like PHP does?
 

Archenoth

(cozy)
467
Posts
12
Years
Indeed. I'm against people on both sides of the C vs C++ argument here because people seem to love one and think that everyone else should avoid the other like the plague. That's not true. They both have their place.

It does not suck. Those people here who are against it couldnt or wouldnt try to understand the language. Its got its bad things as well as good, every language does but it wouldnt be used for countless games/game engines if it was such a bad language. Just look at EPIC Games and the Unreal Engine(C++ at its finest)... C++ is a great language for those who can understand it and use it properly

ID software also writes beautiful code...
https://github.com/TTimo/doom3.gpl.git

Seriously, you don't even need to know C++ to understand it for the most part.

Hey look! They are writing to a save file! Oh my, they have a function to restore it below!
They are the masters of readable code. This guy did a code review of the entire codebase.

It's also crazily efficient and modular, even their older engines are like this. The Quake 3 engine, ID's older engine (Made in 2000) is still in use: The Call of Duty games use a modified version of it with physics hooks and camera effect patches to this day.

I agree. C++ does not suck. If you give it time, you may actually like the language and its features. They don't have to be a liability.
 
Last edited:

KingCharizard

C++ Developer Extraordinaire
1,229
Posts
14
Years
Also, what do you guys think of programming languages such as PHP who implemented an object oriented approach alongside their normal procedural approach - do you think languages should distinctively have one paradigm, or most programs should embrace both procedural and object oriented approaches, like PHP does?

PHP... its.. well.., its different.. But if you expect to do any web/server programming its a must have. I am using it right now to work on a personal project.
 

Archenoth

(cozy)
467
Posts
12
Years
Also, what do you guys think of programming languages such as PHP who implemented an object oriented approach alongside their normal procedural approach - do you think languages should distinctively have one paradigm, or most programs should embrace both procedural and object oriented approaches, like PHP does?

I like multi-paradigm languages, because they can be used to a great deal of effectiveness in quite a few different situations. With PHP you can write things inline for really small bits of quick code. You can write functions for simple repeatable things you may do often. Or you can create APIs and well-structured programs with the Object Oriented paradigm.

Of course, that is really open to abuse, especially when you start to mix these paradigms. To make matters worse, PHP can also support limited functional programming.

I suppose the saying "With great power comes great responsibility." applies here. You have the tools to shoot yourself in the foot, and they are powerful tools indeed. So you have to be careful.

As for your second question. I don't think that languages in general need to follow any specific rules other than to fulfill their original purpose. Strongly typed languages and single-paradigm languages are normally more difficult for beginners because they restrict what they can do, but they also have less room for abuse. Beginners will get less done, but you'll be able to understand what the heck they are doing. Loosely typed languages and/or incredibly dynamic multi-paradigm languages are easier to use and you can usually get a lot more accomplished with them in a sorter amount of time. But if you give that to a beginner, they will get more done, but you will also very likely get the world's worst headache trying to read their code.

It ends up being an experience thing, and a productivity thing.

Visual Studio is pretty nice to use, I must admit. Especially when there's Intellisense. It really helps with the capitalization, it's so nit picky on it.

Anything with semantic code autocompletion and error/warning checking is awesome I find. Eclipse IDE has really awesome error/warning checking and code completion as well. Also for things that aren't IDEs, Emacs has a pretty good semantic-mode too.
 
Last edited:

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
Visual Studio could probably help you with your problem.
Yeah, VS is like messiah for programmers :D

It does not suck. Those people here who are against it couldnt or wouldnt try to understand the language. Its got its bad things as well as good, every language does but it wouldnt be used for countless games/game engines if it was such a bad language. Just look at EPIC Games and the Unreal Engine(C++ at its finest)... C++ is a great language for those who can understand it and use it properly
Dude... Windows' are coded in C++ and we all know how stable and quick they are...
 

Serene Grace

Pokémon Trainer
3,428
Posts
14
Years
I like multi-paradigm languages, because they can be used to a great deal of effectiveness in quite a few different situations. With PHP you can write things inline for really small bits of quick code. You can write functions for simple repeatable things you may do often. Or you can create APIs and well-structured programs with the Object Oriented paradigm.

Of course, that is really open to abuse, especially when you start to mix these paradigms. To make matters worse, PHP can also support limited functional programming.

I suppose the saying "With great power comes great responsibility." applies here. You have the tools to shoot yourself in the foot, and they are powerful tools indeed. So you have to be careful.

As for your second question. I don't think that languages in general need to follow any specific rules other than to fulfill their original purpose. Strongly typed languages and single-paradigm languages are normally more difficult for beginners because they restrict what they can do, but they also have less room for abuse. Beginners will get less done, but you'll be able to understand what the heck they are doing. Loosely typed languages and/or incredibly dynamic multi-paradigm languages are easier to use and you can usually get a lot more accomplished with them in a sorter amount of time. But if you give that to a beginner, they will get more done, but you will also very likely get the world's worst headache trying to read their code.

It ends up being an experience thing, and a productivity thing.
I completely agree with the statement in bold. I know it sounds a bit backwards but I believe that a multi-paradigm language makes for bad programming practice.

When a programming language, such as Java, forces you to work in an object oriented methods rather than just giving you the option to code in either object oriented or procedural methods, it allows you to make the most of the benefits of object oriented - which is reusable code with good design. On the flip side, a procedural based language that doesn't give you the options to have any object oriented methods (which I believe C and Javascript are) are straightforward in the sense that they're for mocking up quick pieces of code (in my opinion, anyway) and anything more will confuse (or at least make it harder to make significant changes quickly) the programmer, even with good comments, six months or so down the line when they come to change the code.

I also agree with your second statement. Beginners should learn in a single-paradigm language because of they understand the scope of the language that they're using and can then achieve more in quicker time. Therefore, once they move on to multi-paradigm languages, they can start to understand the positives of using such a language and be able to squeeze the most out of those languages.

It's funny, before studying it, I always thought object oriented paradigm was so confusing and now I don't program in anything but that style. Still, I would love to learn a fully procedural language such as C but it all seems so... messy to me.

While I do know PHP, I always use it in an object oriented fashion, therefore I still technically don't know a procedural language! XD
 
27,740
Posts
14
Years
Visual Studio could probably help you with your problem.
The thing is, when I made that post, I was actually thinking about Visual Studio. It does seem nice and all, but I have just never been able to understand anything towards general computer programming >_<
 

Serene Grace

Pokémon Trainer
3,428
Posts
14
Years
The thing is, when I made that post, I was actually thinking about Visual Studio. It does seem nice and all, but I have just never been able to understand anything towards general computer programming >_<
It's a fairly simple program to use and most of it is self explanatory. If you need any help with compiling, just ask here.
 

Archenoth

(cozy)
467
Posts
12
Years
On the flip side, a procedural based language that doesn't give you the options to have any object oriented methods (which I believe C and Javascript are) are straightforward in the sense that they're for mocking up quick pieces of code (in my opinion, anyway) and anything more will confuse (or at least make it harder to make significant changes quickly) the programmer, even with good comments, six months or so down the line when they come to change the code.

Well, JavaScript is actually multi-paradigm in the same way as PHP is. Except it uses "prototype-based" object orientation, which is a bit weird for some people. It has many advantages over class-based, but it is less flexible when it comes to inheritance. (Though can serve the same purpose) If you are curious, here is what prototype-based object oriented JavaScript commonly looks like...

This code can be invoked like you would expect a class can be:

Code:
var rest = new REST("table");

Also, unrelated to the above code but, in JavaScript, you can also create objects in a functional and anonymous way (Which is all kinds of useful):

Code:
var someObj = {
  number: 5,

  printNumber: function(){
    alert(this.number);
  }
};

someObj.printNumber(); // alert(5);

It's funny, before studying it, I always thought object oriented paradigm was so confusing and now I don't program in anything but that style. Still, I would love to learn a fully procedural language such as C but it all seems so... messy to me.

While I do know PHP, I always use it in an object oriented fashion, therefore I still technically don't know a procedural language! XD

That's because procedural is messier. It's easy to handle for small projects, but working with larger programs becomes a real exercise in code management. It really demonstrates the requirement for coding conventions well I think.

Procedural is a direct predecessor of object-oriented. You start out with code, and to modularize and organize it, you split it up into functions, this is the procedural style... And from there you split those functions up into related groups, Objects, or in Java's case, Classes. This is the object-oriented style.

Without object orientation, you have to do the association and management of functions on your own. So you start naming functions with more descriptive names depending on what you want them to do AND what you want them to interact with.

Languages like Java also don't use functions, but rather methods. The difference here is that a function is executable code, whereas a method is actually an object passing the class that it was instantiated from a "message" to run some given code it has within it. Every object created from a class will all have methods that reference the exact same code, and the only thing unique to each object is actually the variables, or state within it. Just like how it works in Procedural. The only difference is that everything is managed for you and you are restricted to the code that you designated was "right" for a given amount of information.
 

twocows

The not-so-black cat of ill omen
4,307
Posts
15
Years
Actually, you can't! Stuff is frequently defined in header files but anything you define can be clobbered by another header.

Code:
#include <a.h>
#include <b.h>
is not necessarily the same thing as
Code:
#include <b.h>
#include <a.h>
The preprocessor (specifically the combination of #include and #define) is one of C's biggest weaknesses, along with string handling and general vulnerability to buffer overflows. There is a neat proposal to implement modules for C/C++ in LLVM; I hope it gains traction.I guess you've never been around companies that have fresh CS grads still believing in the wonders of Java. I have, and it's really disheartening. Better languages have been gaining ground in academia (along with some worse ones), but Java isn't going anywhere anytime soon…
Fair enough.

As for Java, it's still dying outside academia. And it's starting to die there, too. Good riddance.

It does not suck. Those people here who are against it couldnt or wouldnt try to understand the language. Its got its bad things as well as good, every language does but it wouldnt be used for countless games/game engines if it was such a bad language. Just look at EPIC Games and the Unreal Engine(C++ at its finest)... C++ is a great language for those who can understand it and use it properly
It sucks. The funny thing about you citing the Unreal engine as an example is that it's a prime example of one of the reasons C++ is awful: to write good code in C++, you have to break pretty much every convention established as "good practice" in the C++ community. The folks at Unreal wrote a good engine despite it being in C++, not because of it. Any language can be used to create something beautiful, no matter how awful. That doesn't make the language itself good. C++ actively works against you, as opposed to a language like Python, which works to help you.

If you're ever forced to program in C++ for some reason (I am so sorry), check out Qt. Apparently, they've adopted a way of doing things that actually makes sense. I believe QtCore doesn't have any GUI-stuff in it, so you can just use that library if you're doing CLI stuff.

I tried compiling some open-source binaries with C++ and I must say, it's very complicated, even for a first-timer. (inb4 compiling isnt for n00bz)

Overall, programming is the weakest computer skill for me to work with. I have tried again and again to get a general fit for programming (through languages such as VB.NET, C#, and C++ as mentioned above), but I just can't seem to get the hang of it. Perhaps I need to take some classes on programming before I try again. :\
Well, the fact that you're doing C++ is your first problem. That said, compiling is easy. Write a C source file, then gcc source.c. Done. You can do more stuff, but to start with, that should be fine.

As for learning to program, maybe you should check out SICP?

Visual Studio is pretty nice to use, I must admit. Especially when there's Intellisense. It really helps with the capitalization, it's so nit picky on it.

Yeah, VS is like messiah for programmers :D
Heavy IDEs are more trouble than they're worth. Give me Notepad++ or Gedit over that bloated crap anytime.

Dude... Windows' are coded in C++ and we all know how stable and quick they are...
To be fair, you can't blame C++ for Microsoft developers' incompetence. I'm sure it didn't help, though.
 
Last edited:
17
Posts
10
Years
  • Seen Apr 20, 2013
I know: php, javascript, html, java, as3, lingo, visualbasic, (my|ms)sql

My favorite is AS3 though I mostly work with php/javascript/css/html
 

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
Heavy IDEs are more trouble than they're worth. Give me Notepad++ or Gedit over that bloated crap anytime.
Not really fan of CLI compiling even though I use it pretty frequently but I guess there are some people who like it more than using IDEs...
Still... you cannot really compile C# without VS. Guess that explains why I'm not fan of CLIC.
 

rhettz_emboar

Did you just pee??
66
Posts
11
Years
Can anyone teach me some programs that I can make using C language?
Im still a Freshman comsci Student so I dont know much yet...
Please teach me some :)
 

codemonkey85

Software Developer
22
Posts
15
Years
In my personal experience, figure out something you like and write a program based around that.

So for instance, I always loved Pokémon, and I've been working on an open source C++ code library for hacking Pokémon save files. It's a project with some variety, and I've learned a lot about development in general because of the things I've needed to do for it.
 
Back
Top