open All Channels
seplocked Out of Pod Experience
blankseplocked Programming in python
 
This thread is older than 90 days and has been locked due to inactivity.


 
Pages: 1 [2] 3

Author Topic

Batolemaeus
Caldari
Free-Space-Ranger
Morsus Mihi
Posted - 2011.02.18 22:47:00 - [31]
 

CCP stands for "Can't Code Python" c/d



*ducks*

Vincent Athena
Posted - 2011.02.18 22:52:00 - [32]
 

I think it does not set x to an empty list because that first line defines foo, and says that foo will be passed a list, and inside foo, call that list x.

Just a guess, never worked with Python. (All I do with my pythons is feed them rabbits). I'm actually a fortran programmer. (Why? I know it, I do engineering programming, and it may be slower to program in, but it runs FAST.)

Vaerah Vahrokha
Minmatar
Vahrokh Consulting
Posted - 2011.02.18 22:53:00 - [33]
 

Edited by: Vaerah Vahrokha on 18/02/2011 22:55:21
Quote:

LDA #$01
STA D020
LDA #$01
STA D021



A9 10
2D 0D DC
F0 FB
EE 20 DO
4C 02 C0

6510 for life!

(Yes, I actually spent some years coding directly in Hex like that Cool)

gfldex
Posted - 2011.02.18 23:00:00 - [34]
 

Originally by: Vincent Athena
I think it does not set x to an empty list because that first line defines foo, and says that foo will be passed a list, and inside foo, call that list x.


"def" does not mean 'define me that function' but 'bind those values to those parameters to the function that is defined after the next colon (and indent(s))'. If you come from functional programming that makes a lot of sense.

Wyke Mossari
Gallente
Posted - 2011.02.18 23:01:00 - [35]
 

Originally by: Cygnus Zhada

LDA #$01
STA D020
LDA #$01
STA D021


I call your 6502 and raise you 1 optimisation.

LDA #$01
STA D020
STA D021

Lykouleon
Wildly Inappropriate
Goonswarm Federation
Posted - 2011.02.18 23:01:00 - [36]
 

real men code in Pascal, c/d?

Dexter Talon
Caldari
Posted - 2011.02.18 23:03:00 - [37]
 

Edited by: Dexter Talon on 18/02/2011 23:03:43
I would choose maintainability, ease of use and better productivity over a slight performance gain any day. But seriously, don't you think that large parts of the EVE server being written in python accounts for at least some of the performance problems EVE is facing today? The whole GIL mess alone would've kept me from choosing python as the primary language for any large scale software system. I guess it went something like this: Hey guys, look, we got this neat little dynamic programming language, let's do something cool with it. And that was totally OK, when EVE was just small. But it's not that small anymore.
I mean, I just don't understand it. EVE is massive. Performance IS a problem. Why in the world would you NOT choose C++? I really don't like C++, but you gotta admit that it's the right choice when it comes to pure performance. Yes, you will lose productivity. Yes, there will (probably) be more bugs. Because, after all, "When your hammer is C++, everything begins to look like a thumb." But at some point you just run out of options. EVE has reached that point when fleet flights became as massive as they usually are nowadays.

Vincent Athena
Posted - 2011.02.18 23:13:00 - [38]
 

Edited by: Vincent Athena on 18/02/2011 23:19:09
I thought alot of EVE was C++, especially parts where speed is an issue.

Be careful about "small performance gains". Ive seen a language change result in speed increases of a factor of 10,000.

Ive even taken someone else's fortran program, changed 3 lines of code, and had it run 7 times faster.

Edit: What I mean to say is changes that may make the code a little harder to maintain can result in huge, jaw dropping performance gains.

ElJo123
Accompanied By Unicorns
Posted - 2011.02.18 23:26:00 - [39]
 

Originally by: Dexter Talon
Edited by: Dexter Talon on 18/02/2011 23:03:43
I mean, I just don't understand it. EVE is massive. Performance IS a problem. Why in the world would you NOT choose C++?


Because you'd use C if you want fast. Once you start using C++ features you're adding overhead (virtual methods? omg function tables! blech! my precious cycles!); also, insanity (hey, let's overload operators and template everything itsagoodideareally). Also, counterpoint re: "C++ means OMGFAST": OpenOffice.

ALSO C++ is a horrible, horrible language that hates every fiber of your being and in no way shape or form helps you with all that massive fun inherent in a client-server architecture. Though it does share EVE's spirit i guess.

Anyways, while real men use lisp of course I really like ruby because it's soso pretty.

Dexter Talon
Caldari
Posted - 2011.02.18 23:40:00 - [40]
 

Originally by: ElJo123
Originally by: Dexter Talon
Edited by: Dexter Talon on 18/02/2011 23:03:43
I mean, I just don't understand it. EVE is massive. Performance IS a problem. Why in the world would you NOT choose C++?


Because you'd use C if you want fast. Once you start using C++ features you're adding overhead (virtual methods? omg function tables! blech! my precious cycles!); also, insanity (hey, let's overload operators and template everything itsagoodideareally). Also, counterpoint re: "C++ means OMGFAST": OpenOffice.

ALSO C++ is a horrible, horrible language that hates every fiber of your being and in no way shape or form helps you with all that massive fun inherent in a client-server architecture. Though it does share EVE's spirit i guess.

Anyways, while real men use lisp of course I really like ruby because it's soso pretty.


Nice quoting out of context.
The performance advantage C has over C++ is negligible, esp. when comparing both to Python. Also, I wholeheartedly agree that C++ is an awful programming language, but sometimes you just have to choose between nice, easy-to-understand architecture/code and speed. And I'm really the last person to give up the first, but writing beautiful and concise code in a relatively 'slow' language doesn't help you solve fleet lag issues (well, it does to an extent, but you will hit a brick wall at some point).

Liang Nuren
Posted - 2011.02.18 23:54:00 - [41]
 

Edited by: Liang Nuren on 18/02/2011 23:53:43
Originally by: CCP Tuxford

It is easier to code in python than C++. If you think otherwise you have either never programmed in python or never coded in C++. The quality of the coders is an entirely different debate but tbh I think it's childish to belief that somehow programming in C++ mystically makes you a better programmer it all depends on what you do not the language you use.

Having said that then it's all I have to say on the subject. Aren't religious debates banned on this forum anyway Razz



+1. Algorithm matters far more than language. This is easily provable by examining the posted results and languages here

-Liang

Liang Nuren
Posted - 2011.02.18 23:56:00 - [42]
 

Originally by: Dexter Talon
writing beautiful and concise code in a relatively 'slow' language doesn't help you solve fleet lag issues (well, it does to an extent, but you will hit a brick wall at some point).


Algorithm matters far, far, far, far more than programming language. CCP has repeatedly stated that they are still in the "fix the algorithm" stage.

-Liang

F'elch
Wall Street Trading
Posted - 2011.02.19 00:00:00 - [43]
 

Rhythm is gonna get ya.

Magnus Orin
Minmatar
Wildly Inappropriate
Goonswarm Federation
Posted - 2011.02.19 00:02:00 - [44]
 

Whooooole lotta nerd up in this thread.

BellaDonna Nyghtshade
Minmatar
Native Freshfood
Posted - 2011.02.19 00:04:00 - [45]
 

ADA for the win, but I don't think entities outside the US can have access to it.............I could be wrong though, they may have opened it up by now, it has been a couple of decades since I played with it doing AI..................


PTang
Posted - 2011.02.19 00:07:00 - [46]
 

a lot of the code IS C++

it's just that pylon and C++ are like best buddies in bed.

Herzog Wolfhammer
Gallente
Sigma Special Tactics Group
Posted - 2011.02.19 00:21:00 - [47]
 

Edited by: Herzog Wolfhammer on 19/02/2011 00:24:58
Originally by: San Severina
http://www.slideshare.net/Arbow/stackless-python-in-eve


You beat me to posting that.
I remember when Python was first coming out, and it got sideswiped by Java, which turned out to be a wash, as Java turned out not to be as good as the purpose for which it was touted, and Python would actually be better than Java for what everybody was saying Java was for. Java would turn out to be better for other things though.
Having programmed Java, Perl, PHP, and Python, as well as Fortran, C/C++, and C#, IMO Python is very powerful for doing a lot of things in fewer lines. We should not fault CCP for using it, and frankly when all is said and done, everything becomes machine code when it's time to make a processor actually do anything anyway, not matter how you deliver it.
In a way, Python is like a shield buffer with two invulns running cap stable, while C/C++ is like armor tanking with active resists.

Programming in assembly language is like hull tanking - really hard and very unforgiving.


Note on the "speed" of a language and lag. It's all about the compiler or in the case of script, the interpreter. Back in the days of few good compilers, I remember having to "unroll" the loops for matrix operations to get speed but alas my texture-wrapping polys in Java could still only run at 6FPS. Since then a lot of things have changed but now you can run OpenGL in a Java applet. So Python is NOT the reason for lag, or even a client running slow. It's all in the interpreter. You will see this for Perl and PHP too as different producers will tout performance for the same given code.


Taedrin
Gallente
Kushan Industrial
Posted - 2011.02.19 01:03:00 - [48]
 

Originally by: Nypheas Azurai
lol python. do they really code any significant amount of this game in it? if so, that would explain a lot.

real men use C++, and girly men at least use lua. only magical fairies hopped up on pixie DUST use LULZ WHITESPACE IS SIGNIFICANT language


Programming in C++ is like using a chainsaw with all of the safety guards removed. Sure, it makes you look manly, but it's a really stupid idea.

Ak'athra J'ador
Amarr
Imperial Shipment
Posted - 2011.02.19 01:10:00 - [49]
 

Originally by: CCP Tuxford
Aren't religious debates banned on this forum anyway Razz


interesting, because you do indeed seem to have an opinion

Originally by: CCP Tuxford

good python code > bad c++ code


you are of course wrong, but fear not! The law states that you are entitled to one...

I could tell you a whole lot of reasons why most games these days are coded in c++, but instead let me just ask you, why do you think most of the games today, are coded in c++?
why do you think all engines speak c++?

but lets be kind to you noobs at CCP for once. You decided to role on quantity not quality and for quantity python is indeed better. You really will be able to role out crap faster. And god knows you have been doing so for a very long time...

Oh my dear Tuxford, do you even know the algorithm used to calculate the path for your autopilot?

EnslaverOfMinmatar
Amarr
Posted - 2011.02.19 01:26:00 - [50]
 

Real men said that they use C and assembly. And I believe them because in 6 years Guild Wars crashed only once and that was in the beta. Oh and that crash was fixed on the same day.

Dr BattleSmith
PAX Interstellar Services
Posted - 2011.02.19 01:37:00 - [51]
 

Originally by: CCP Tuxford
The quality of the coders is an entirely different debate but tbh I think it's childish to belief that somehow programming in C++ mystically makes you a better programmer it all depends on what you do not the language you use.


There is a time I would have said the same thing, but it's not entirely true.

I suggest to anyone who is a Coder, learn some C and/or ASM, become a Programmer.

Knowledge of C and ASM will help you immensely with your python, ruby, VB or whatever other interpreted language you use.

The difference is the knowledge it gives you about how memory actually works and makes you a much more efficient interpreted coder.

Don't rubbish it, just learn it, get better, grow.

Daedalus II
Helios Research
Posted - 2011.02.19 01:43:00 - [52]
 

I've only used C++ so I guess I shouldn't say anything about python, but I would argue this way:
A) C++ is faster than python because it's a lower level language.
B) But a proper algorithm is more important than a fast language.
C) However, in a lower level language you have more choises and better control and might therefore be able to make a more efficient algorithm than in the higher level language.
D) B and C together implies that the lower level language should be superior to the higher level language (it might not be easier to use, or less error prone, but in the end it provides for better algorithms)

And lastly from what I've heard the reason eve doesn't have multithreading is that there is some problem having to do with python and multithreading, and this if anything is a huge problem. Granted, C++ can't even use threads natively, but with for example boost it's no problem. This if anything would turn me away from python if it were true, but not being a python programmer I might have missunderstood the whole deal so I can't say anything about it for sure.

Ban Doga
Posted - 2011.02.19 01:51:00 - [53]
 

Edited by: Ban Doga on 19/02/2011 01:52:24
Originally by: Daedalus II
And lastly from what I've heard the reason eve doesn't have multithreading is that there is some problem having to do with python and multithreading, and this if anything is a huge problem. Granted, C++ can't even use threads natively, but with for example boost it's no problem. This if anything would turn me away from python if it were true, but not being a python programmer I might have missunderstood the whole deal so I can't say anything about it for sure.


You might find this very interesting http://python.mirocommunity.org/video/1479/pycon-2010-understanding-the-p

The whole things is 45 minutes, but the really shocking part is the first 5 minutes, followed by 40 minutes explanation of why it is the way it is.

Ban Doga
Posted - 2011.02.19 02:03:00 - [54]
 

Originally by: Dr BattleSmith
Originally by: CCP Tuxford
The quality of the coders is an entirely different debate but tbh I think it's childish to belief that somehow programming in C++ mystically makes you a better programmer it all depends on what you do not the language you use.


There is a time I would have said the same thing, but it's not entirely true.

I suggest to anyone who is a Coder, learn some C and/or ASM, become a Programmer.

Knowledge of C and ASM will help you immensely with your python, ruby, VB or whatever other interpreted language you use.

The difference is the knowledge it gives you about how memory actually works and makes you a much more efficient interpreted coder.

Don't rubbish it, just learn it, get better, grow.


Exactly!
Apparently it sounds really strange to some people, but knowing something can actually make you do things differently or even do different things.

So, yes of course, you don't *mystically* become a better programmer by using a certain language.
The reality is you can become better when you learn something, like properly using more than one language and that you usually cannot become better when you don't learn something.

Don't be scared to learn more than you absolutely need to know.

Mara Rinn
Posted - 2011.02.19 02:16:00 - [55]
 

Originally by: Daedalus II
A) C++ is faster than python because it's a lower level language.


If you are implementing exactly the same algorithm, C++ might be faster than Python.

Quote:
B) But a proper algorithm is more important than a fast language.


A proper algorithm requires proper thinking. Programming in C++ means you focus too much on fancy tricks, and don't spend enough time thinking.

Half of C++ programming is remembering to garbage collect. The other half is debugging memory leaks. The actual productive time when writing in C++ is the rounding error percentage.

Enriana Shlirapen
Posted - 2011.02.19 02:22:00 - [56]
 

Originally by: Mara Rinn


Half of C++ programming is remembering to garbage collect. The other half is debugging memory leaks. The actual productive time when writing in C++ is the rounding error percentage.



That is true if you're a complete ******, which this guy is. Okay to be fair, it seems like a lot of people are unable to handle this kindergarten stuff.

Rakshasa Taisab
Caldari
Sane Industries Inc.
Posted - 2011.02.19 02:24:00 - [57]
 

Originally by: ElJo123
Because you'd use C if you want fast. Once you start using C++ features you're adding overhead (virtual methods? omg function tables! blech! my precious cycles!); also, insanity (hey, let's overload operators and template everything itsagoodideareally). Also, counterpoint re: "C++ means OMGFAST": OpenOffice.

I'll be awaiting your example of C code that uses polymorphism that is faster than C++'s.

Also, C++ shares a subset of C which means they're equally fast for equal things. Except when you want to optimize e.g. vector math and many other things. A one-liner that does what requires pages of custom macro's in C for doing some vector calculation efficiently tells me I'd rather learn the intricacies of C++.

There's a reason why all the scientific programming happens in C++ rather than C...

Mara Rinn
Posted - 2011.02.19 02:37:00 - [58]
 

Originally by: Enriana Shli****n
That is true if you're a complete ******, which this guy is. Okay to be fair, it seems like a lot of people are unable to handle this kindergarten stuff.


It takes about three years of programming to get past the ******ed stage with C++. In that time you could have used Python and finished the job.

Alpheias
Euphoria Released
HYDRA RELOADED
Posted - 2011.02.19 03:02:00 - [59]
 

I am honestly frightened. Knowing that Tuxford "knows" how to program Python and is still working at CCP, with access to the source code....

EVE IS DOOMED!

mia mia
Caldari
Dawn of a new Empire
The Initiative.
Posted - 2011.02.19 03:11:00 - [60]
 

Edited by: mia mia on 19/02/2011 03:11:02
You code in whatever language makes the most sense for your particular set of requirements, restrictions, circumstances. Any other discussion is academic or for posers.


Pages: 1 [2] 3

This thread is older than 90 days and has been locked due to inactivity.


 


The new forums are live

Please adjust your bookmarks to https://forums.eveonline.com

These forums are archived and read-only