Author Topic: Programming Languages  (Read 3387 times)

0 Members and 1 Guest are viewing this topic.

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
References are cute, but they lead to rather difficult-to-debug problems sometimes. Most of the professional programmers I know stick to pointers. Besides, you can't do half the nifty, speedy tricks on references that you can with pointers.

That is beside the point however. The point is that if you grok C++ you can grok C.
[I am not really here. This post is entirely a figment of your imagination.]

 
To be honest, I prefer pointers to references.

There's one type of C++ code I've seen which is written very much like C (besides using classes to encapsulate some functions): Mine.

Doesn't half piss off the lecturers when I put most of my functions outside classes. Not as much as writing C++ in C does, though.
I love emulating polymorphism and virtual functions in C.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
As Stroustroup said in the gray book: anyone writing very good C code is already writing C++.
[I am not really here. This post is entirely a figment of your imagination.]

 
But although using function pointers in structs to emulate polymorphism is basically how a C++ compiler does it, the expectation is that you actually use an OO language for it...

Uni lecturers don't like seeing the implementation.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
I don't know. My uni instructor loved it. I was basically using OO methodology through the use of structs and carefully written functions, kept tightly bundled with the structs. It works out to the same thing in the end. As they man said (well, he didn't but its close enough), "Any sufficiently well written C is indistinguishable from C++."

Now, when I started using unions, I got in hella trouble.
[I am not really here. This post is entirely a figment of your imagination.]

 
Yeah, that's another thing mine hate.

My current project (not a Uni project, thankfully) makes use of unions to enhance readability.

I'm serious. Enhance readability.

It's either unions or excessive numbers of buffer access functions. I'm emulating the registers of an x86, which means having _AL, _AX and _EAX overlapping.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 
I gave my final exam today. I don't wanna hear any more OO non sense... :devil: (btw, i got a 30 in my Software Engineering exam even if i presented a project who didn't use it one bit... but that's another story)

There's only one advice i can really give you: DON'T stick to a particular language. You never know what will come trough your way.
As those who love OO (or EXtreme Programming, call it whatever you want) would say, be "flexible". That's the only important thing. And don't forget, whatever decisions you make, to motivate them. That's the difference between an Engineer and a CodeMonkey.

Just my 2 cents.


*goes out and celebrates his degree*
----------------------------------------------
GTD Swiss Pride - Orion Class
Swiss 1st Fleet, Sector 32 - Ore Belt - Sol
----------------------------------------------
"I'm an engineer!"

Eve: Since Beta Phase 2
Civilizazion Fan: Seems like forever...
SimCity Fan: SC 2000 is still the best
TT Fan: Since 1995
Switzerland: Since 1291

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
OO and XP are different things. Object Oriented programming is a methodology related to (at its most basic) data hiding. Extreme Programming (XP) is about having two sets of eyes on the code at all times, working through it with four eyes, four hands and two brains.

One is scary and the other is frightening. I'll let you choose which is which.

Quote
Originally posted by Descenterace
Yeah, that's another thing mine hate.

My current project (not a Uni project, thankfully) makes use of unions to enhance readability.

I'm serious. Enhance readability.

It's either unions or excessive numbers of buffer access functions. I'm emulating the registers of an x86, which means having _AL, _AX and _EAX overlapping.


That gives me a geeky giggle. :D
[I am not really here. This post is entirely a figment of your imagination.]

 
Quote
Originally posted by mikhael
OO and XP are different things. Object Oriented programming is a methodology related to (at its most basic) data hiding. Extreme Programming (XP) is about having two sets of eyes on the code at all times, working through it with four eyes, four hands and two brains.
 


Actually, Extreme Programming (look here: http://en.wikipedia.org/wiki/Extreme_Programming) is a particular approach to Software Engineering, and it's the next step after OO. It does not describe by any means some sort of "Superman Programmer", but just all the opposite. Read the Wikipedia entry, it's pretty reassuming.



p.s.: if you were trying to be sarcastic, well, i'm pretty tired and drunk. Be nice
:)
----------------------------------------------
GTD Swiss Pride - Orion Class
Swiss 1st Fleet, Sector 32 - Ore Belt - Sol
----------------------------------------------
"I'm an engineer!"

Eve: Since Beta Phase 2
Civilizazion Fan: Seems like forever...
SimCity Fan: SC 2000 is still the best
TT Fan: Since 1995
Switzerland: Since 1291

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
And that's a step beyond OO in what manner? OO is a way of handling data and code affecting that data. XP is about ways to write better code, independent of linguistic or semantic considerations.

You must be drunk.
[I am not really here. This post is entirely a figment of your imagination.]

 
mik's correct. XP and OO are independent.

Extreme Programming actually works quite well. We use it at work sometimes. It certainly makes the other person's code more comprehensible.

The productivity loss caused by having one keyboard between two people (effectively meaning that only one can be actually working on the code at a time) is made up for by the productivity gain caused by more people understanding more of the application.

But most of the time I still prefer being told what needs to be done and being left in peace to do it.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 

Offline aldo_14

  • Gunnery Control
  • 213
XP and OO being of the same paradigm?  What a strange idea to have....

Incidentally, somehow asked about Java developed games.  Purely by coincidence, I discovered that Chrome and it's sequel - http://www.specforcethegame.com/ - was written in Java (according to java.com).  Which is interesting; I didn't know that scale of game was feasible with java.

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
Bah. Java has come a long way since it was "too slow" for gaming. Quake III has been shown to run quite speedily under Java, just as an example. "Its Slow" isn't a valid black mark against Java anymore, and hasn't been since 2002ish.

Now, if you want a genuine blackmark, I'd look at its dumbass object model and the way it handles interfaces and its painful introspection support. One of the things I like about Python is the raw self-awareness of python code and its core mutability. Of course, like semantically signifigant whitespace, some might consider this a blackmark against python. ;)
[I am not really here. This post is entirely a figment of your imagination.]

  
The one thing Java really needs to add is support for delegates. Function pointers were a very powerful component of C/C++ (in the same manner as a big gun: it's still possible to shoot yourself in the foot, and when you do it'll make a bigger hole). Delegates were one of the nicer parts of C#. So where's Java's version?
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 

Offline aldo_14

  • Gunnery Control
  • 213
« Last Edit: September 14, 2005, 05:02:54 pm by 181 »

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
Function pointers are so groovy when building interfaces.

That said, function pointers are like the tactical nuke in the C++ arsenal. Its been said that C lets you shoot your self in the foot, C++ makes it hard to shoot yourself in the foot but when you do you take your whole leg off... well function pointers make it possible to shoot yourself in the foot and take out your neighbors. *heh*
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Quote
Originally posted by mikhael
Function pointers are so groovy when building interfaces.


;7
-C

 
I read Sun's argument a while ago, aldo, but I needed the reminder.

Inner classes are very messy. They add a lot more levels of indentation, they take up a lot of vertical space on the screen (unless you compact the braces, in which case it's harder to follow the indentation), and they're not conducive to following the flow of the code if the inner class definition is placed in the middle of the method that uses it.

Not only that, all classes in a program compile to seperate files. Even one-off internal classes. So if your application uses a lot of them you end up with vast numbers of tiny, used-once files in the project /bin directory.

Delegates are so much neater. I know what I want to do; I want syntax and semantics that reflect what I'm trying to do. Object-oriented languages are fine, but Java is obsessively object-oriented.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker