Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 381 382 [383] 384 385 ... 796

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

Arx

  • Bay Watcher
  • Iron within, iron without.
    • View Profile
    • Art!
Re: if self.isCoder(): post() #Programming Thread
« Reply #5730 on: April 25, 2014, 01:11:45 am »

PYTHON IS SUPER COOL
Now you have to explain, for the babby nublet that is me.

Dynamic size arrays, and dynamic typing. I would dearly love those in Java or C++.

Also, import skynet
Logged

I am on Discord as Arx#2415.
Hail to the mind of man! / Fire in the sky
I've been waiting for you / On this day we die.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #5731 on: April 25, 2014, 01:23:45 am »

PYTHON IS SUPER COOL
Now you have to explain, for the babby nublet that is me.

Dynamic size arrays, and dynamic typing. I would dearly love those in Java or C++.

Also, import skynet
I think you mean from __future__ import skynet
Logged

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

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5732 on: April 25, 2014, 01:38:47 am »

(that line isn't even a joke)

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5733 on: April 25, 2014, 01:59:08 am »

PYTHON IS SUPER COOL
Now you have to explain, for the babby nublet that is me.

Dynamic size arrays, and dynamic typing. I would dearly love those in Java or C++.

It's very basic to create a dynamic array type in c++, and you have operator overloading to make it work as seamless as a built-in class. Numerous libraries already exist to implement it.

If you want an idea of why they suck though, try implementing one in basic c/c++. If you want to keep sequential memory addresses, then you have to basically create a resized copy and then delete the original every time you resize it. All this overhead is just hidden from you in Python, which is slow as fuck as a result.

As for dynamic typing: great for saving time hacking together a small script, shit for actually developing large complex systems that need to run fast. And that's what C++ is really good at.
« Last Edit: April 25, 2014, 02:06:25 am by Reelya »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5734 on: April 25, 2014, 02:01:30 am »

Lua has the exact same issue with list resizing.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #5735 on: April 25, 2014, 02:13:19 am »

Dynamic size arrays, and dynamic typing. I would dearly love those in Java or C++.

It's very basic to create a dynamic array type in c++, and you have operator overloading to make it work as seamless as a built-in class. Numerous libraries already exist to implement it.

but because it's C++, the dynamic arrays aren't as easily manipulable as a Python array. Of course, you can implement the same things yourself, but it's a hassle to.
Logged

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

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5736 on: April 25, 2014, 03:00:54 am »

From what I can see, python arrays aren't really arrays at all, they're linked lists

http://www.afterhoursprogramming.com/tutorial/Python/Lists/

It doesn't make sense then to complain that built-in arrays in c++ don't have the same features. c++ arrays are direct-memory linear access. They're super-fast for that reason. There are plenty of libraries that implement lists and automatically resizing arrays.

See the c++ STL libraries for vector, list and map. Those are all dynamic array types that are already standard in c++ and can be quickly extended by the user. Also, see function templates if you want to be able to pass any type of variable to a function without needing to know what it accepts.

Also, runtime type checking is the best. Beats all else. 1, it catches errors at compile, so they don't bite you at runtime, or affect your users. 2, compiler checking types means that functions already know the types / datasize of their instructions. That means a lot less runtime type checking and errors.
« Last Edit: April 25, 2014, 03:04:06 am by Reelya »
Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #5737 on: April 25, 2014, 07:42:25 am »

PYTHON IS SUPER COOL
Now you have to explain, for the babby nublet that is me.
This should explain all there is to know about Python.
That's more helpful. What's an array?
Logged

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5738 on: April 25, 2014, 07:45:17 am »

This is unrelated to the current discussion, but I thought some of you might enjoy programming talks.
Logged

Sheb

  • Bay Watcher
  • You Are An Avatar
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5739 on: April 25, 2014, 08:11:21 am »

A friend of mine was talking to me all the time on FB saying uninteresting things, so I made a script to auto-answer stuff like "Yeah" "Totally" etc etc.

However, a bug sent him like 10000 messages. Ooops.
Logged

Quote from: Paul-Henry Spaak
Europe consists only of small countries, some of which know it and some of which don’t yet.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5740 on: April 25, 2014, 08:15:03 am »

Good, that should keep him talking for a while.
Logged

Maklak

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5741 on: April 25, 2014, 10:58:31 am »

For me the lack of Curly Braces support in Python is a deal-breaker. But then Perl is so much uglier. Maybe learning Ruby would be a good idea?
Logged
Quote from: Omnicega
Since you seem to criticize most things harsher than concentrated acid, I'll take that as a compliment.
On mining Organics
Military guide for FoE mod.
Research: Crossbow with axe and shield.
Dropbox referral

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5742 on: April 25, 2014, 11:00:50 am »

For me the lack of Curly Braces support in Python is a deal-breaker. But then Perl is so much uglier. Maybe learning Ruby would be a good idea?

Yesssss.  Ruby is basically a prettier perl anyway. 
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5743 on: April 25, 2014, 11:08:21 am »

For me the lack of Curly Braces support in Python is a deal-breaker.

Code: [Select]
from __future__ import braces
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5744 on: April 25, 2014, 11:19:35 am »

For me the lack of Curly Braces support in Python is a deal-breaker. But then Perl is so much uglier. Maybe learning Ruby would be a good idea?
Now now, don't blame Perl for your ugly Perl code; it's your own fault if you irresponsibly overuse all the shortcuts and extra features Perl has built in to make your life easier. It is entirely possible to write perfectly pretty and legible Perl code; you just need a touch more self-control than with other languages.

In other news, this is my new favourite programming language.
Logged
Pages: 1 ... 381 382 [383] 384 385 ... 796