The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Entertainment & Hobbies > Technology & Internet
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Technology & Internet The place to go for all things tech and internet. Share a funny YouTube video or meme, discover the latest useful apps, or just get some free tech support.


Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #51    
Old February 25th, 2013, 04:36 PM
twocows's Avatar
twocows
Pretentious Intellectual Jerk
Community Supporter
 
Join Date: Mar 2009
Location: Michigan
Age: 23
Gender: Male
Nature: Lax
Quote:
Originally Posted by Brizz View Post
I'm taking an intro to programming course this semester and we're working with C++.
GET OUT WHILE YOU STILL CAN

No, but seriously, any intro to programming course that's taught in C++ is a bad intro to programming course. You've got a few decent options for teaching programming to beginners and that is not one of them. C#, Python, Java, or maybe even C are acceptable choices. Scheme is also a solid choice. C++ is not a beginner's language. Heck, it's not an expert's language, either.

Again, I'll point any newcomers to programming toward one of the best books available: http://mitpress.mit.edu/sicp/full-text/book/book.html
__________________
Doctors Without Borders: one of the few charity groups you can rely on to actually do real good in the world.

PM me if you have computer troubles. I work in IT for a living and can probably solve your problems. My rate is $expensive/hr, but I'm still cheaper than Creep Squad and, unlike them, will actually get the job done or let you know if I can't.

Quote:
The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all.
- H. L. Mencken, unsourced

Quote:
There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."
- Isaac Asimov, Column in Newsweek (21 January 1980) [source]

NEW 40K MMOFPS YESSSSS
Reply With Quote
  #52    
Old February 26th, 2013, 08:38 AM
Stash
Togepi
 
Join Date: Aug 2010
Gender: Male
Nature: Adamant
I know C/C++ from my high school days then took introductory and advanced courses in college. I know a bit of Java, Python, Pascal, and -- call me obsolete -- Fortran. I started with BASIC like most programmers and found it relatively easy and limited, but it wasn't until my last year of high school that I learned about C. I tried learning alone but I wasn't as productive as when I entered college. I also learned a bit of Assembly through C++.
Reply With Quote
  #53    
Old February 26th, 2013, 11:00 AM
Archenoth's Avatar
Archenoth
The arch foe
 
Join Date: Jan 2012
Gender: Male
Nature: Lonely
Quote:
Originally Posted by twocows View Post
Scheme is also a solid choice.
My ears perked upon the mention of Scheme. That and Clojure are awesome in all of their Lispy awesome... I never knew you knew a LISP language..! And if you haven't seen it yet, this may interest you twocows: http://www.chris-granger.com/2012/04...w-ide-concept/

I gave it a try recently, and while it is kind of annoying that it requires Leiningen for Clojure, I thought the thing was pretty cool. I have not tried its Python mode yet because I don't know Python.


Quote:
Originally Posted by twocows View Post
GET OUT WHILE YOU STILL CAN

No, but seriously, any intro to programming course that's taught in C++ is a bad intro to programming course. You've got a few decent options for teaching programming to beginners and that is not one of them. C#, Python, Java, or maybe even C are acceptable choices.
I would argue against this actually. While C++ has some oddities, it will be able to teach people about pointers as well as a more object-oriented approach than most languages that utilize memory in the same way as it. I agree that C is probably a better language to start out with, but C++ isn't that bad a language to start out with. It is also a very important language, so knowing it is definitely an asset, especially if you start writing larger programs. (It becomes easier to manage than C.)
Reply With Quote
  #54    
Old February 26th, 2013, 06:39 PM
twocows's Avatar
twocows
Pretentious Intellectual Jerk
Community Supporter
 
Join Date: Mar 2009
Location: Michigan
Age: 23
Gender: Male
Nature: Lax
Quote:
Originally Posted by Archenoth View Post
My ears perked upon the mention of Scheme. That and Clojure are awesome in all of their Lispy awesome... I never knew you knew a LISP language..! And if you haven't seen it yet, this may interest you twocows: http://www.chris-granger.com/2012/04...w-ide-concept/

I gave it a try recently, and while it is kind of annoying that it requires Leiningen for Clojure, I thought the thing was pretty cool. I have not tried its Python mode yet because I don't know Python.
Looks neat, I'll look into it.


Quote:
I would argue against this actually. While C++ has some oddities, it will be able to teach people about pointers as well as a more object-oriented approach than most languages that utilize memory in the same way as it. I agree that C is probably a better language to start out with, but C++ isn't that bad a language to start out with. It is also a very important language, so knowing it is definitely an asset, especially if you start writing larger programs. (It becomes easier to manage than C.)
The worst problem with saying you know C++ is that you might someday be expected to write C++ code, and I could think of no worse fate.

No, but seriously, I just think pretty much anything's a better option. Pointers are often tough for beginners, but I think as long as you make it clear what's going on in memory while you're teaching and make sure they're aware of the concept, students won't have too many problems once they encounter them in a language that has them.
__________________
Doctors Without Borders: one of the few charity groups you can rely on to actually do real good in the world.

PM me if you have computer troubles. I work in IT for a living and can probably solve your problems. My rate is $expensive/hr, but I'm still cheaper than Creep Squad and, unlike them, will actually get the job done or let you know if I can't.

Quote:
The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all.
- H. L. Mencken, unsourced

Quote:
There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."
- Isaac Asimov, Column in Newsweek (21 January 1980) [source]

NEW 40K MMOFPS YESSSSS
Reply With Quote
  #55    
Old February 27th, 2013, 10:55 PM
Archenoth's Avatar
Archenoth
The arch foe
 
Join Date: Jan 2012
Gender: Male
Nature: Lonely
Quote:
Originally Posted by twocows View Post
The worst problem with saying you know C++ is that you might someday be expected to write C++ code, and I could think of no worse fate.

No, but seriously, I just think pretty much anything's a better option. Pointers are often tough for beginners, but I think as long as you make it clear what's going on in memory while you're teaching and make sure they're aware of the concept, students won't have too many problems once they encounter them in a language that has them.
I may regret asking this, but why do you hate C++ so much anyway? I'm curious.

I see a lower level language that has a psuedo object-oriented paradigm, meaning it's easier to organize code in larger projects. I see improved APIs over C for things like String handling, and I see a language that you can write C code in and have it work if you rather.

It has quite a few more capabilities than C.

Granted, I personally rather C myself... But this is because it is a really small language and I can get my code to compile everywhere. I never really thought of C++ as an inferior language to it, much less as the monstrosity your posts make it out to be...

So, mind filling me in here?
Reply With Quote
  #56    
Old February 28th, 2013, 04:13 AM
Satoshi Ookami's Avatar
Satoshi Ookami
Memento Mori
Community Supporter
 
Join Date: Jul 2008
Location: Abyss of Time, Great Seal
Age: 21
Gender: Male
Nature: Calm
Because I'm studiying IT it's pretty obvious I'm coding like crazy =D
I can code in C, C++, Java, a bit of Delphi, Javascript, HTML, CSS and especially C#.
By far, my favorite is C#, the other programming (no markup) languages were just needed to advance and I don't like them...
C# has always been my favorite =)
__________________
ROM hacking FAQ - Read before asking how to play a hack. | Previous Sign 2 | Previous Sign
Reply With Quote
  #57    
Old March 1st, 2013, 04:32 PM
Team Fail's Avatar
Team Fail
A Little Bit Of Sparkle
Community Supporter
 
Join Date: May 2009
Age: 19
Gender: Male
Nature: Brave
Quote:
Originally Posted by Ash493 View Post
Because I'm studiying IT it's pretty obvious I'm coding like crazy =D
I can code in C, C++, Java, a bit of Delphi, Javascript, HTML, CSS and especially C#.
By far, my favorite is C#, the other programming (no markup) languages were just needed to advance and I don't like them...
C# has always been my favorite =)
Ever since learning C#, I've stuck with it because I can actually understand what I'm looking at. I started with VB.NET, but since learning C# and how flexible it is, I began to see how much VB.NET sucked in comparison to C#.
__________________

Pairs:
Kevin, Echidna
Follow me on Twitter! @TeamFail
Alt 1, リザードン
Miiverse
Pokémon Hackers Online
Alt 2: Jack Cayman



[04:20.39] <@GoGo> I WILL INSERT WITH PLEASURE
[04:20.45] <@GoGo> shut it Bela

[05:41.55] <Team_Fail> Blue Spider is interesting, but #MEHMasterRace
[05:42.20] <diegoisawesome> Team_Fail: Sounds like a bunch of unmotivated people that still want to try to take over the world
Reply With Quote
  #58    
Old March 1st, 2013, 09:19 PM
twocows's Avatar
twocows
Pretentious Intellectual Jerk
Community Supporter
 
Join Date: Mar 2009
Location: Michigan
Age: 23
Gender: Male
Nature: Lax
Quote:
Originally Posted by Archenoth View Post
I may regret asking this, but why do you hate C++ so much anyway? I'm curious.

I see a lower level language that has a psuedo object-oriented paradigm, meaning it's easier to organize code in larger projects. I see improved APIs over C for things like String handling, and I see a language that you can write C code in and have it work if you rather.

It has quite a few more capabilities than C.

Granted, I personally rather C myself... But this is because it is a really small language and I can get my code to compile everywhere. I never really thought of C++ as an inferior language to it, much less as the monstrosity your posts make it out to be...

So, mind filling me in here?
I get this question sometimes, and I always direct the people who ask it here. I could write an explanation myself, but there's nothing I could say that Yossi Kreinin hasn't said in more detail.

One of my biggest personal pet peeves is this. Operator overloading is far too easy to abuse and the benefits are negligible. That's not to downplay any of the other major problems with C++, but this one takes the cake for me.

Operator overloading's one of those things that sounds useful but really isn't. There are a lot of these type of things in C++ because it's a poorly thought out language. I can almost picture how C++ was made: Bjarne makes a public query "what's missing in C?" He gets about a billion responses. However, instead of filtering out the garbage and taking into careful consideration what C desperately needs and what's just nonsense that doesn't need to be there, he implements all ten thousand feature requests without looking at them twice. I'm sure it didn't quite happen that way, but that's kind of how it seems to me. There's too much garbage in C++; yes C lacked some very important functionality, but C++ is not the correct solution to that problem.

There are very few useful improvements in C++ over C, though unfortunately the ones that are there are pretty major. However, a good portion of those improvements are provided in glib, which I use most of the time if I'm doing C programming. I'm also looking into GObject at the moment, which seems useful.
__________________
Doctors Without Borders: one of the few charity groups you can rely on to actually do real good in the world.

PM me if you have computer troubles. I work in IT for a living and can probably solve your problems. My rate is $expensive/hr, but I'm still cheaper than Creep Squad and, unlike them, will actually get the job done or let you know if I can't.

Quote:
The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all.
- H. L. Mencken, unsourced

Quote:
There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."
- Isaac Asimov, Column in Newsweek (21 January 1980) [source]

NEW 40K MMOFPS YESSSSS

Last edited by twocows; March 1st, 2013 at 09:26 PM.
Reply With Quote
  #59    
Old March 2nd, 2013, 01:49 AM
Satoshi Ookami's Avatar
Satoshi Ookami
Memento Mori
Community Supporter
 
Join Date: Jul 2008
Location: Abyss of Time, Great Seal
Age: 21
Gender: Male
Nature: Calm
Quote:
Originally Posted by Team Fail View Post
Ever since learning C#, I've stuck with it because I can actually understand what I'm looking at. I started with VB.NET, but since learning C# and how flexible it is, I began to see how much VB.NET sucked in comparison to C#.
Visual Basic is one of the languages I'm interested to learn...
Of course, the first one on the list is F# :D
If I don't learn F#, I won't feel complete as programmer .D
__________________
ROM hacking FAQ - Read before asking how to play a hack. | Previous Sign 2 | Previous Sign
Reply With Quote
  #60    
Old March 2nd, 2013, 04:41 PM
Archenoth's Avatar
Archenoth
The arch foe
 
Join Date: Jan 2012
Gender: Male
Nature: Lonely
Cool... Visual Basic is fantastic for hammering out really fast graphical programs... And Intellisense can really help you out with it's completions since the language is really simple.

Quote:
Originally Posted by twocows View Post
One of my biggest personal pet peeves is this. Operator overloading is far too easy to abuse and the benefits are negligible. That's not to downplay any of the other major problems with C++, but this one takes the cake for me.

Operator overloading's one of those things that sounds useful but really isn't
The thing about that style of operator overloading is that C++ isn't the only language that has it, it's in other C-like languages as well. Java has "string" + "string" concatenation overloading for example, and the other overloads I saw mentioned are in C to begin with. (Like var++, or *pointer)

DISCLAIMER: The following is merely my opinion... One we obviously don't share.

The way I see it, provided you have good type handling or management, you can use overloaded operators in ways that are quite understandable and not horrible. It's all in how you present your code. For example, I can write C code that is non-obvious in it's operator usage too, consider the following:
Code:
int i = 10;
while(i --> 0) // While i goes to zero
  printf("%d\n", i);
Know why this works? (Try to figure it out before clicking the spoiler.)
Spoiler:
This may make more sense:

Code:
while(i-- > 0) // While i goes to zero
  printf("%d\n", i);


Another example:
Code:
result = value**count;
That is multiplying "value" to the value that a pointer called "count" is pointing to. And not dereferencing a pointer to a pointer. Sure you probably knew that, but it is more readable to do the following:
Code:
result = value * *count;
The same applies for overloaded operators. For example, in JavaScript, if you saw the following code:
Code:
string = "That " + name + " person is a cool guy";
You could very easily determine that that was string concatenation in the same way where if you saw this:
Code:
total = numGuests + numStaff;
You could reasonably assume that it is arithmetic.

Anything can be horrible if used horribly, but if you use the features you have available to your advantage, you can write good code in mostly anything with structure. You just need to write your code in a way that is intuitive.

In the end, the things that are horrible to you end up coming down to your own preferences. I can respect that though.

Last edited by Archenoth; March 2nd, 2013 at 05:27 PM. Reason: Eh, even though it is code without meaning, my pointer example code could still be considered vulgar. Also added disclaimer.
Reply With Quote
  #61    
Old March 2nd, 2013, 10:56 PM
twocows's Avatar
twocows
Pretentious Intellectual Jerk
Community Supporter
 
Join Date: Mar 2009
Location: Michigan
Age: 23
Gender: Male
Nature: Lax
Quote:
Originally Posted by Archenoth View Post
Cool... Visual Basic is fantastic for hammering out really fast graphical programs... And Intellisense can really help you out with it's completions since the language is really simple.



The thing about that style of operator overloading is that C++ isn't the only language that has it, it's in other C-like languages as well. Java has "string" + "string" concatenation overloading for example, and the other overloads I saw mentioned are in C to begin with. (Like var++, or *pointer)

DISCLAIMER: The following is merely my opinion... One we obviously don't share.

The way I see it, provided you have good type handling or management, you can use overloaded operators in ways that are quite understandable and not horrible. It's all in how you present your code. For example, I can write C code that is non-obvious in it's operator usage too, consider the following:
Code:
int i = 10;
while(i --> 0) // While i goes to zero
  printf("%d\n", i);
Know why this works? (Try to figure it out before clicking the spoiler.)
Spoiler:
This may make more sense:

Code:
while(i-- > 0) // While i goes to zero
  printf("%d\n", i);


Another example:
Code:
result = value**count;
That is multiplying "value" to the value that a pointer called "count" is pointing to. And not dereferencing a pointer to a pointer. Sure you probably knew that, but it is more readable to do the following:
Code:
result = value * *count;
The same applies for overloaded operators. For example, in JavaScript, if you saw the following code:
Code:
string = "That " + name + " person is a cool guy";
You could very easily determine that that was string concatenation in the same way where if you saw this:
Code:
total = numGuests + numStaff;
You could reasonably assume that it is arithmetic.

Anything can be horrible if used horribly, but if you use the features you have available to your advantage, you can write good code in mostly anything with structure. You just need to write your code in a way that is intuitive.

In the end, the things that are horrible to you end up coming down to your own preferences. I can respect that though.
Your examples seem more like misleading spacing than anything. The problem I have with operator overloading is that it introduces ambiguity with regards to a given operator. You have to look at the context to figure out what it does, and that's just stupid. What an operator does should be self-evident; it should mean the same thing in every context. Overloading string concatenation is fine I guess because it doesn't do this; you're still essentially "adding" two things, even if internally it's completely different. But a lot of times this isn't what happens; operators are overloaded to mean all sorts of stuff that isn't even remotely related. This is horrible. And letting the programmer do it at his leisure is even worse; at least in C you can guarantee that * is going to mean one of three things and not fifteen other things that the programmer might have defined somewhere.

Speaking of *, C is not immune from this criticism; I already hate that * is overloaded to mean three different things in C by default. * means "multiplication" in almost every mathematical or programming language in some context, so that's fine. However, it's also taken to mean "dereference" in another context. I don't like that; there should be a symbol for dereferencing unique from one already widely used. It's confusing. However, that's not even the worst part. The absolute worst part is that it's overloaded again to mean "reference (noun)." This is completely ridiculous. If you're going to overload an operator to mean "the following thing is a reference," DON'T MAKE IT THE OPPOSITE OF WHAT IT MEANS IN ANOTHER CONTEXT! Overload & if you're going to do that! & already means "reference (verb)," at least stay consistent! This is probably why so many newcomers to C are confused by pointers (it's certainly why I was thinking back): the syntax is utterly absurd. The worst part is, if operator overloading didn't exist, this problem wouldn't exist at all. You could identify at a glance what the purpose of an operator is.

For instance, let's assign a unique operator to each of those operations.
In ALL contexts:
* means multiplication
& means reference (verb)
# means dereference (verb)
@ means reference (noun)

Wow! That was so hard! These are all symbols already conveniently available and, based on a quick glance at this page, unused. Let's take a look at some arbitrary C code and see how this changes things.

Code:
int main()
{
    int a = 5;
    int b = 6;
    int c = a * b;
    int @cr;
    cr = &c;
    a = #cr;
}
That might seem kind of weird at first because you're used to different uses, but look at it closer. Everything makes sense at a glance; you don't have to look at what's surrounding the operator to figure out what it means. This makes code so much more readable. It's impossible to get confused by this unless you just don't understand the underlying concepts.

Again, though, I'm... all right with operator overloading when it's intuitive. If you wanted to change @ to an overloaded version of &, that's fine with me, since it's intuitive; & means "address" in my head, whether it's "address of" or "this is an address." Past that, though, it just gets messy. And it certainly shouldn't be in the hands of the programmer; it should be defined at the language level and not be changeable.
__________________
Doctors Without Borders: one of the few charity groups you can rely on to actually do real good in the world.

PM me if you have computer troubles. I work in IT for a living and can probably solve your problems. My rate is $expensive/hr, but I'm still cheaper than Creep Squad and, unlike them, will actually get the job done or let you know if I can't.

Quote:
The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all.
- H. L. Mencken, unsourced

Quote:
There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."
- Isaac Asimov, Column in Newsweek (21 January 1980) [source]

NEW 40K MMOFPS YESSSSS

Last edited by twocows; March 2nd, 2013 at 11:05 PM.
Reply With Quote
  #62    
Old March 3rd, 2013, 03:00 AM
Satoshi Ookami's Avatar
Satoshi Ookami
Memento Mori
Community Supporter
 
Join Date: Jul 2008
Location: Abyss of Time, Great Seal
Age: 21
Gender: Male
Nature: Calm
Quote:
Originally Posted by Archenoth View Post
The thing about that style of operator overloading is that C++ isn't the only language that has it, it's in other C-like languages as well. Java has "string" + "string" concatenation overloading for example, and the other overloads I saw mentioned are in C to begin with. (Like var++, or *pointer)
Uh... don't make me remember overloading operators... that was probably the biggest crap C++ had :D
__________________
ROM hacking FAQ - Read before asking how to play a hack. | Previous Sign 2 | Previous Sign
Reply With Quote
  #63    
Old March 3rd, 2013, 11:11 AM
Archenoth's Avatar
Archenoth
The arch foe
 
Join Date: Jan 2012
Gender: Male
Nature: Lonely
Quote:
Originally Posted by twocows View Post
Your examples seem more like misleading spacing than anything. The problem I have with operator overloading is that it introduces ambiguity with regards to a given operator. You have to look at the context to figure out what it does, and that's just stupid. What an operator does should be self-evident; it should mean the same thing in every context. Overloading string concatenation is fine I guess because it doesn't do this; you're still essentially "adding" two things, even if internally it's completely different. But a lot of times this isn't what happens; operators are overloaded to mean all sorts of stuff that isn't even remotely related. This is horrible. And letting the programmer do it at his leisure is even worse; at least in C you can guarantee that * is going to mean one of three things and not fifteen other things that the programmer might have defined somewhere.
Misleading spacing was indeed part of it. My point was that you can write code in obvious, and non-obvious ways. The same is true for code that utilizes overloaded operators.

Your code should be consistent and readable. Establish a way you use overloaded operators so that you don't really need context when looking at a given function; Make things obvious.

I won't quote your entire post, but you described your thoughts quite well and had some good points (Even if you were a bit condescending.). While I still don't share your opinion, I understand it better... So have a like.

Last edited by Archenoth; March 3rd, 2013 at 11:41 AM.
Reply With Quote
  #64    
Old March 3rd, 2013, 11:22 AM
Team Fail's Avatar
Team Fail
A Little Bit Of Sparkle
Community Supporter
 
Join Date: May 2009
Age: 19
Gender: Male
Nature: Brave
Quote:
Originally Posted by Ash493 View Post
Visual Basic is one of the languages I'm interested to learn...
Of course, the first one on the list is F# :D
If I don't learn F#, I won't feel complete as programmer .D
What's nice about the .NET languages is that you can integrate them into one another. Meaning, what you learn in Visual Basic, you can use in C#. All you have to do is add

Code:
using     System.Net;
...and you can use everything VB.NET in C#. But other than that, you wouldn't really have much use out of VB.NET. I'm not a fan of VB.NET anymore, but it does have it's uses here and there.
__________________

Pairs:
Kevin, Echidna
Follow me on Twitter! @TeamFail
Alt 1, リザードン
Miiverse
Pokémon Hackers Online
Alt 2: Jack Cayman



[04:20.39] <@GoGo> I WILL INSERT WITH PLEASURE
[04:20.45] <@GoGo> shut it Bela

[05:41.55] <Team_Fail> Blue Spider is interesting, but #MEHMasterRace
[05:42.20] <diegoisawesome> Team_Fail: Sounds like a bunch of unmotivated people that still want to try to take over the world
Reply With Quote
  #65    
Old March 3rd, 2013, 09:30 PM
twocows's Avatar
twocows
Pretentious Intellectual Jerk
Community Supporter
 
Join Date: Mar 2009
Location: Michigan
Age: 23
Gender: Male
Nature: Lax
Quote:
Originally Posted by Archenoth View Post
Misleading spacing was indeed part of it. My point was that you can write code in obvious, and non-obvious ways. The same is true for code that utilizes overloaded operators.

Your code should be consistent and readable. Establish a way you use overloaded operators so that you don't really need context when looking at a given function; Make things obvious.

I won't quote your entire post, but you described your thoughts quite well and had some good points (Even if you were a bit condescending.). While I still don't share your opinion, I understand it better... So have a like.
I was frustrated at C and C++, not you. I can see how you might have misinterpreted.

Again, though, my biggest problem with operator overloading is that they can be easily abused by newcomers without realizing it, and abused in such a way that makes it really, really hard for people who have to maintain the code later. This is a problem that only exists if you let the programmer do it. It's a lot nicer in C, where the only operator overloading occurs in the specification; the programmer can't do it. Having poorly thought-out stuff at the language level is a problem, but it's nowhere near as big of a problem as letting tens of thousands of bad programmers go nuts with a dangerous feature. At least once you're experienced with C, you'll know what's what; with C++, every new source file is potentially a new list of operators you need to memorize.

And again, yes it's possible to use it in an acceptable way. The problem isn't that there is a right and wrong way to use the feature, the problem is that abusing it causes far more problems than abusing other typical language features. For instance, take #define macros. Yes, these can be abused and in a very ugly way, but at least the relationship is still 1-to-1; you can guarantee that unhelpfulmacroname is going to expand to the same thing every time. With operator overloading, that's not the case; you can come across an operator and, unless you've memorized the author's arbitrary list of "things I overloaded," have no idea if it's going to mean this, that, or some other thing.

Basically, the biggest problem with operator overloading is that it makes a language context-sensitive. This is usually bad. Unless there's some compelling reason why it shouldn't be, everything within a language should be understandable without examining the context. And opening it up for the programmer to do that means that not only is the language context-sensitive, but each individual source file might have its own unique context-sensitive stuff, which is just outright horrifying.
__________________
Doctors Without Borders: one of the few charity groups you can rely on to actually do real good in the world.

PM me if you have computer troubles. I work in IT for a living and can probably solve your problems. My rate is $expensive/hr, but I'm still cheaper than Creep Squad and, unlike them, will actually get the job done or let you know if I can't.

Quote:
The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all.
- H. L. Mencken, unsourced

Quote:
There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."
- Isaac Asimov, Column in Newsweek (21 January 1980) [source]

NEW 40K MMOFPS YESSSSS
Reply With Quote
  #66    
Old March 4th, 2013, 08:57 AM
Archenoth's Avatar
Archenoth
The arch foe
 
Join Date: Jan 2012
Gender: Male
Nature: Lonely
Aye. No worries.

Also, I suppose that is where we differ. As an abstractions guy who likes the functional paradigm, I like context-sensitive code. While I'll admit it can be terrifying in the hands of an inexperienced programmer, if you utilize it well, you can make some stupid-powerful abstractions.

For example, I implemented an entire AJAX REST API using a single larger context-sensitive function, and a bunch of smaller functions calling it in various ways in JavaScript. I just committed it into a Github repo so you can see what I am talking about. (Hopefully this code wont give you an aneurysm, since it is by no stretch of the imagination in your style.)

(This abstraction is incomplete currently, and yes I am using jQuery as a crutch currently.)
This is the large dynamic function...

This is where all of the public smaller functions are...

Every one of those functions can be called with a callback function to call with data after the function is complete, they all provide the correct type of requests to add, edit, remove, update, and view things from the database. (With some further abstraction to combine functions to just store JavaScript objects in general if you are unsure of its status.) You can set a number of flags that modify how the function works by passing different data types, including how the function responds. You can do everything from:

Code:
users.store({"name":"Archenoth"}, function(data){
  alert(data);
});
...to add a user and echo out what it looks like in the database to:
Code:
users.store({"name":"Archenoth"}, 1);
...to update the user with the first ID with an awesome name to:
Code:
users.store(user)
...to add the user if it doesn't already exist but to update it if it does.

It all depends how you call it and that's not even scratching the surface of what it can do.

As you can see, you can squeeze out a lot of functionality by overloading things and by making context-sensitive code. The fact that I don't have to write a lot of code to get crazy amounts of functionality is something that I love.

The fact that I write like this makes me not care much about overloaded operators in languages, because I deal with similar risks all the time.

The thing about Python is that it is a very solid language. (From what I understand anyway, please correct me if I'm wrong.) There is usually one right way to do things, which makes the code into something that is relatively easy to read regardless of the author. Then there are languages like Perl (Yes, the code above is JavaScript, but it is written with Perl-like argument parsing for the request function.) that utilize the whole TIMTOWTDI ideology, which means I have the ability to make some really cool things, but also really really horrible code if I misuse it.

Last edited by Archenoth; March 4th, 2013 at 09:05 AM.
Reply With Quote
  #67    
Old March 4th, 2013, 11:34 AM
Serene Grace's Avatar
Serene Grace
ニャース
 
Join Date: Apr 2009
Location: United Kingdom
Age: 19
Gender: Male
Nature: Relaxed
The first full programming language I've learnt is C# and I was wondering where to go from here. I'm interested in learning an unmanaged language such as C++ or C but I've not decided which one to opt for so if any of you have any preferences, please let me know (and also specific reasons as to why you prefer one over the other).

Also, I'm very interested in learning either Python or Java - but not at the same time. Which one do you guys think is more fun, or at least more relevant to the current programming ideal-isms (I couldn't think of a suitable way to phrase this - basically I was trying to say which is more "current")? So that I can learn that one first.
__________________
Twitter [x], Icon Credit [x]
Reply With Quote
  #68    
Old March 4th, 2013, 12:34 PM
Archenoth's Avatar
Archenoth
The arch foe
 
Join Date: Jan 2012
Gender: Male
Nature: Lonely
I'd say go C first... The things you pick up when learning C can be translated to C++ relatively easily. Also C is a really small language. It will make you work with pointers, with memory allocation, and quite a few low-level functions. It is also really portable if you avoid using system calls.

As for between Java and Python...

http://www.tiobe.com/index.php/conte...pci/index.html

I recommend Java because Java is a lot more popular, and a lot more ubiquitous... (Your C# knowledge would come in handy when learning it too.) It has a lot more real-world usage currently (I mean job-wise.) so knowing it would be an asset if you were to become a professional developer. But you could choose Python too if you want, but I can't really speak for Python since I don't know it.
Reply With Quote
  #69    
Old March 4th, 2013, 04:39 PM
twocows's Avatar
twocows
Pretentious Intellectual Jerk
Community Supporter
 
Join Date: Mar 2009
Location: Michigan
Age: 23
Gender: Male
Nature: Lax
Quote:
Originally Posted by Archenoth View Post
Aye. No worries.

Also, I suppose that is where we differ. As an abstractions guy who likes the functional paradigm, I like context-sensitive code. While I'll admit it can be terrifying in the hands of an inexperienced programmer, if you utilize it well, you can make some stupid-powerful abstractions.

For example, I implemented an entire AJAX REST API using a single larger context-sensitive function, and a bunch of smaller functions calling it in various ways in JavaScript. I just committed it into a Github repo so you can see what I am talking about. (Hopefully this code wont give you an aneurysm, since it is by no stretch of the imagination in your style.)

(This abstraction is incomplete currently, and yes I am using jQuery as a crutch currently.)
This is the large dynamic function...

This is where all of the public smaller functions are...

Every one of those functions can be called with a callback function to call with data after the function is complete, they all provide the correct type of requests to add, edit, remove, update, and view things from the database. (With some further abstraction to combine functions to just store JavaScript objects in general if you are unsure of its status.) You can set a number of flags that modify how the function works by passing different data types, including how the function responds. You can do everything from:

Code:
users.store({"name":"Archenoth"}, function(data){
  alert(data);
});
...to add a user and echo out what it looks like in the database to:
Code:
users.store({"name":"Archenoth"}, 1);
...to update the user with the first ID with an awesome name to:
Code:
users.store(user)
...to add the user if it doesn't already exist but to update it if it does.

It all depends how you call it and that's not even scratching the surface of what it can do.

As you can see, you can squeeze out a lot of functionality by overloading things and by making context-sensitive code. The fact that I don't have to write a lot of code to get crazy amounts of functionality is something that I love.

The fact that I write like this makes me not care much about overloaded operators in languages, because I deal with similar risks all the time.

The thing about Python is that it is a very solid language. (From what I understand anyway, please correct me if I'm wrong.) There is usually one right way to do things, which makes the code into something that is relatively easy to read regardless of the author. Then there are languages like Perl (Yes, the code above is JavaScript, but it is written with Perl-like argument parsing for the request function.) that utilize the whole TIMTOWTDI ideology, which means I have the ability to make some really cool things, but also really really horrible code if I misuse it.
As long as your code's maintainable. If I have to go through a bunch of hoops to understand what you're doing, that's not good.

Quote:
Originally Posted by Archenoth View Post
I'd say go C first... The things you pick up when learning C can be translated to C++ relatively easily. Also C is a really small language. It will make you work with pointers, with memory allocation, and quite a few low-level functions. It is also really portable if you avoid using system calls.

As for between Java and Python...

http://www.tiobe.com/index.php/conte...pci/index.html

I recommend Java because Java is a lot more popular, and a lot more ubiquitous... (Your C# knowledge would come in handy when learning it too.) It has a lot more real-world usage currently (I mean job-wise.) so knowing it would be an asset if you were to become a professional developer. But you could choose Python too if you want, but I can't really speak for Python since I don't know it.
Java's a dying language. Python's more popular now. The only real remaining uses for Java are Android and companies already stuck with Java.
__________________
Doctors Without Borders: one of the few charity groups you can rely on to actually do real good in the world.

PM me if you have computer troubles. I work in IT for a living and can probably solve your problems. My rate is $expensive/hr, but I'm still cheaper than Creep Squad and, unlike them, will actually get the job done or let you know if I can't.

Quote:
The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all.
- H. L. Mencken, unsourced

Quote:
There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."
- Isaac Asimov, Column in Newsweek (21 January 1980) [source]

NEW 40K MMOFPS YESSSSS
Reply With Quote
  #70    
Old March 4th, 2013, 08:25 PM
Archenoth's Avatar
Archenoth
The arch foe
 
Join Date: Jan 2012
Gender: Male
Nature: Lonely
Quote:
Originally Posted by twocows View Post
As long as your code's maintainable. If I have to go through a bunch of hoops to understand what you're doing, that's not good.
That's the idea. Reasonably easy to read, and bugs will only show up in obvious places.

Quote:
Originally Posted by twocows View Post
Java's a dying language. Python's more popular now. The only real remaining uses for Java are Android and companies already stuck with Java.
You saw the link in my post, right? It's still the most popular language it seems according to it.
Reply With Quote
  #71    
Old March 6th, 2013, 02:44 AM
Satoshi Ookami's Avatar
Satoshi Ookami
Memento Mori
Community Supporter
 
Join Date: Jul 2008
Location: Abyss of Time, Great Seal
Age: 21
Gender: Male
Nature: Calm
Quote:
Originally Posted by twocows View Post
Java's a dying language. Python's more popular now. The only real remaining uses for Java are Android and companies already stuck with Java.
I've seen a try to port Android to C# and the IDE with which you can make Android apps in C#...
I think Java will be used only for 3-4 years before everything will be swallowed by C# =)
__________________
ROM hacking FAQ - Read before asking how to play a hack. | Previous Sign 2 | Previous Sign
Reply With Quote
  #72    
Old March 7th, 2013, 09:50 AM
Team Fail's Avatar
Team Fail
A Little Bit Of Sparkle
Community Supporter
 
Join Date: May 2009
Age: 19
Gender: Male
Nature: Brave
So today I've been working with XNA and I modified the Xbox OBJ importer example so you can use the DPad and whatnot to control the orientation of a rendered model. Check out what I did with my ripped Skyarrow Bridge model:



yes I was actually bored
__________________

Pairs:
Kevin, Echidna
Follow me on Twitter! @TeamFail
Alt 1, リザードン
Miiverse
Pokémon Hackers Online
Alt 2: Jack Cayman



[04:20.39] <@GoGo> I WILL INSERT WITH PLEASURE
[04:20.45] <@GoGo> shut it Bela

[05:41.55] <Team_Fail> Blue Spider is interesting, but #MEHMasterRace
[05:42.20] <diegoisawesome> Team_Fail: Sounds like a bunch of unmotivated people that still want to try to take over the world
Reply With Quote
  #73    
Old March 7th, 2013, 11:13 AM
Emilia's Avatar
Emilia
Relapsed
 
Join Date: Mar 2013
Age: 17
Gender: Female
Nature: Careful
I'm very excited for this coming May. I'm not the biggest fan of PHP, but I seem to have a PHP web-development job lined up! It'll be my first real programming job. I should maybe do some small practice projects before it starts, as I haven't used PHP practically since I learned it, save fiddling around with existing stuff like Wordpress and phpBB.
__________________

Emilia • 16 • Platinum • SoulSilver

the amber fuji & ambertwo club
Reply With Quote
  #74    
Old March 10th, 2013, 06:38 PM
twocows's Avatar
twocows
Pretentious Intellectual Jerk
Community Supporter
 
Join Date: Mar 2009
Location: Michigan
Age: 23
Gender: Male
Nature: Lax
Quote:
Originally Posted by Archenoth View Post
That's the idea. Reasonably easy to read, and bugs will only show up in obvious places. :)



You saw the link in my post, right? It's still the most popular language it seems according to it.
Yeah, and FORTRAN is still used a lot, too. It was popular years ago, which means it'll still be used in businesses for years to come because they're not going to spend resources porting stuff for no reason.

Quote:
Originally Posted by Emilia View Post
I'm very excited for this coming May. I'm not the biggest fan of PHP, but I seem to have a PHP web-development job lined up! It'll be my first real programming job. I should maybe do some small practice projects before it starts, as I haven't used PHP practically since I learned it, save fiddling around with existing stuff like Wordpress and phpBB.
I'm sorry. I wouldn't wish a PHP job on my worst enemy.
__________________
Doctors Without Borders: one of the few charity groups you can rely on to actually do real good in the world.

PM me if you have computer troubles. I work in IT for a living and can probably solve your problems. My rate is $expensive/hr, but I'm still cheaper than Creep Squad and, unlike them, will actually get the job done or let you know if I can't.

Quote:
The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all.
- H. L. Mencken, unsourced

Quote:
There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."
- Isaac Asimov, Column in Newsweek (21 January 1980) [source]

NEW 40K MMOFPS YESSSSS
Reply With Quote
  #75    
Old March 11th, 2013, 10:16 AM
Archenoth's Avatar
Archenoth
The arch foe
 
Join Date: Jan 2012
Gender: Male
Nature: Lonely
This video is awesome...


Quote:
Originally Posted by Emilia View Post
I'm very excited for this coming May. I'm not the biggest fan of PHP, but I seem to have a PHP web-development job lined up! It'll be my first real programming job. I should maybe do some small practice projects before it starts, as I haven't used PHP practically since I learned it, save fiddling around with existing stuff like Wordpress and phpBB.
Awesome..! And good luck. PHP is quirky, but you can really hammer things out fast with it... Also if you need to work with MySQL databases a lot: https://github.com/Archenoth/DBroker /shameless plug

Last edited by Archenoth; March 11th, 2013 at 08:29 PM.
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 02:21 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.