[ / / / / / / / / / / / / / ] [ dir / mde ]

/tech/ - Technology

Winner of the 68rd Attention-Hungry Games
/d/ - Home of Headswap and Detachable Girl Threads

January 2019 - 8chan Transparency Report
Comment *
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Show oekaki applet
(replaces files and can be used instead)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 16 MB.
Max image dimensions are 15000 x 15000.
You may upload 3 per post.

File: 205f0f09a5aee35⋯.jpg (10.07 KB, 348x145, 12:5, jsvsp.jpg)


Why the hell is python becoming so popular? I keep reading about its growing trend, but all signs point at it being slow as fuck. Wouldn't javascript be a better scripting language? I mean, you can embed both into anything, so why python?



Ease of use in regards to data analysis and machine learning.

JS is more a web-building thing, not a "BIG DATA" thing.


File: 2c3771be83b1841⋯.mp4 (2.97 MB, 1280x720, 16:9, Boogie Peg Furry.mp4)

Why the hell is OP still such a faggot? I keep reading his threads and all signs point to him being a total faggot. Wouldn't OP be better off if he became a trap? I mean, you can suck cock doing both, so why choose to be a faggot?



Python is fine, but Jesus don't make a game with it.



I'm not saying it doesn't work. I'm asking why isn't a (seemingly) better scripting language like javascript preferred in all or most cases. I don't buy >>982462 that it's big data mostly.

Reading into it, people say it's simple and easy and therefore more readable and maintainable, but it's not like javascript is any harder, in my experience.


File: 1c03616581dd328⋯.jpg (42.06 KB, 800x689, 800:689, 1c03616581dd3282df67f71756….jpg)


I use both, JS is horrible to use compared to python.


File: 3af0f1ffd7305dc⋯.png (48.32 KB, 256x354, 128:177, Severance Blade of Darknes….png)


It can be done(pic related), and with pygame you can make simple 2D side-scrolling games.


Python is the best language for server-side web app development, and that is the most popular tech sector nowadays



>Why the hell is python becoming so popular?

Because it is used in many introduction to programming courses.



Because of libraries or simplicity of use?


use the format, json

ignore everything else



It has an easy syntax, doesn't do retarded things like JavaScript and it has a massive selection of libraries. Speed is not really an issue if you use libraries which have the performance-critical part written in C, so you can use it for heavy number crunching as well.

And really, what is the alternative if you want to throw a simple script together? Python is basically pseudocode you can actually run.



Good game. Had a lot of features that hadn't been in games before, and some that haven't been seen since.

Was fun too. The multiplayer didn't really work though, nothing only on lans.


it one of the main languages used for machine learning and big data analysis





sh + awk, Perl, TCL. But if you want a typed scripting language, I don't know, there's probably something out there.



Now that I think about it, why not Go? It seems like the Python killer (except for the lack of libraries).



Go isn't as friendly to the tech illiterate.



Perl 6 has data types.


Actually one of it's best features is custom data types, which makes it a good language for database programming.



>sh and awk

slow and can obliterate your system very easily, and syntax can be awkward. BUt POSIX tools are great


Python is a better perl than perl for anything except golf


tcl is slow and the syntax can be esoteric. Even jim tcl is slow.




Also, Go can actually be quite annoying



>They both can be a embedded into anything



What form of crack have you been consuming, OP?



Aside from pointing out you're intentionally misinterpreting the context of the word "embedded", here's two embedded-device embeddable implementations off the top of my head:


For esp8266, esp32, pyboard, micro:bit, probably some other embedded boards


64k bytes implementation of most of Python


File: e5691e99da12b39⋯.jpg (145.91 KB, 1024x768, 4:3, snake sweater.jpg)


>but it's not like javascript is any harder, in my experience

Well not everyone has your experiences. Python is 100% the most used language for beginner courses the world over, and when you have students that become very familiar with it for a few years it will be their natural go to for any scripting purposes. It was designed to look as clean and easy to read as possible, it can be OOP and it doesn't use pointers, so it's easy to teach. There aren't any glaring issues with it's design since most python programs are at most a couple hundred lines dealing with simple text based data manipulation any bitching about slowness or bad garbage collection are moot. It's a glove that's a perfect fit for it's intended audience.



You better not use slow as an argument when searching for an alternative to Python. Honestly, the only thing I use in the bunch I mentionned in sh + awk, and it indeed needs great knowledge to build something not too shabby.


tcc + C, unironically. Or common lisp.



Awk is waaaay faster than python.

If you write your shell scripts as "glue scripts" for running awk, they run pretty damn quickly.



First python has been around for over a decade, more on the the side of two. If you /knew/ python you'd know that the syntax lends itself to data analysis. Libuv has only been worth while recently.

Not to mention ubiquity. Python is found in probably every distro as a standard scripting platform. Node.js? Not so much.

Then look at pip/virtualenv versus npm. This is where I go, "Neck yourself."

Finally Cython. Integrating a performant computational module in Python is far easier than Node.

Syntax is another reason, with all the truthy bullshit in JS, its horrendous for scientific purposes. Python has already developed specific constructs for typed structures (check out numpy).

Finally all the infrastructure and support for computational and data analysis already exists for python. Scikit-learn, matplotlib, numpy, numba, etc. etc.

Parallelism is also alot easier with Python than with javascript without all the restrictions of webworkers or piping through different processes.

You are a massive faggot, QED.



Fuck off back to /g/



Depends on what you're used to and what background you have. But in general, yes dynamically typed languages tend to be less annoying to beginners who were taught the "a variable is like a box" stuff.



Really? I've never heard of any of that.

All the languages I've heard of as being used in embedded stuff are C, C++, Forth and the like.

P. cool what people can do these days



>lends itself to data analysis

What? All of the firms I know do their work in c. On top of that, the very idea that a language is "good" at one thing, and therefore has acceptable flaws is retarded. You either have no idea what you are talking about or you know full well and are ignoring the truth.


File: 8d7afe4918f76c0⋯.gif (528.63 KB, 827x926, 827:926, 8d7afe4918f76c075cc130b228….gif)


>On top of that, the very idea that a language is "good" at one thing, and therefore has acceptable flaws is retarded

If that were true, there would be no need for different programming languages. I sure hope you aren't trying to imply that this mythical flawless language that is a perfect fit for any use case is C.


It's easy to learn as a first programming language and has lots of useful libraries. What more do you want if popularity is the goal?



>Why the hell is python becoming so popular?

It is a very abstracted language.The language itself is easy to learn and it's easy to teach.

Try teaching Lecture 6.001 to the new generation and a lot of them won't follow (even tho it's easy as fuck).




Fuck off back to /g/


File: dc63559330b2149⋯.jpg (27.21 KB, 600x425, 24:17, perl-scripts-done.jpg)


Perl can do more and faster than python. However it's a language designed for level 99+ wizards.



It shouldn't be.


Because it's easy. It's an ugly fucking language though. The future is statically typed though.



my own reasons:

it has lots of libraries and is relatively easy to write for windows/and/or/linux

...I am writing some "impossible coding" :D on Win10 that I will eventually transfer over to a linux pc. I looked at java but the serial library in java was questionable, where the pyserial one was much more up-to-date.

I don't find python to be particularly 'easy'. just different. the idea of un-typed variables is rather odd, since in my usual languages, where you declare the variable is also what sets the variable scope. ...python makes it really easy to use the same variable name for many different instances--but I've never had any time in the past when I wanted to do that. it seems counter-productive to combating the disorganization you face with any large project


and I cannot say in all my years of cobol, c++ or java coding,,, did I ever have the need to store a function in a variable. some of the more-unique features of python I will probably never have use for

with some of these languages--they tried to simplify the architecture, and they ended up with a number of odd effects of doing that. So then they try to sell those oddball effects as "advantages that you can use". Nevermind that you probably never wanted them, and they must construct special examples in the documentation to show just how to use them.


really nigerian?



the reason is that python interfaces easily with C and most of the real "work" done in python scripts is done by a C back-end.




Any reason why python is used instead of, say, LuaJIT? Or did it just end up as a standard?


The majority of python users used to be intelligent programmers. Once the industry noticed that, demand for python developers went up. The rising demand attracted new less skilled programmers. ........



I don't even need to say anything.



Python has major support for OO.


You don't need to, but it doesn't matter, because you're a nogrammer. If you're complaining about a language based on minor syntax details, like whitespace indentation, you are too stupid to ever become a programmer





In Python, a variable is like a box. It's just a name that refers to an object and can be changed at will.



It's not "minor" you fucking cockgoblin. The trannies in charge of python are stuffing their personal style preference down everyone's throat. Heaven forbid you try writing Python in any editor besides a bloated as fuck IDE designed for that kind of shit. Why stop there, how about forcing space padding on all sides of function arguments or some ridiculous shit like that? Who is the arbiter of what kind of inane style policing is considered "minor"?




>major support for OO

read: it's not quite as bad as Perl's support, but it's still pretty shit.


>I also read that Paul Graham article

his point applied to any non-industry language. His point is basically anti-/tech/: the best of us are memelang users


endless unjustified propaganda that coincided with a general surrender on the field of battle that was observed only by its competition.

Perl: "everyone read MJD's article about how advocacy rots your brain so now we won't say why you should use Perl even though its position vs. python is enormously advantageous [some of that persisting even to this day, it's shocking how shit python is]"

Ruby: "matz is too polite to tell you why you should use Ruby even though it's 10000% the language Python is, and only suffers from less technical and social investment [even at the time, although the gap was much smaller then]


Python is just pseudo-code that actually compiles. If you're a computer scientist rather than an engineer, that's all you need.

Likewise, Python is probably the best lang to teach students compsci because it is so divorced from the irrelevant architectural realities of computers themselves. Either that or Scheme.

Javascript is fucking retarded.




anything will look popular if you place it next to javascript.



Lua: "Look at the shitshows at those other languages. Don't fucking say a word about Lua you goddamn idiots"



>and I cannot say in all my years of cobol, c++ or java coding,,, did I ever have the need to store a function in a variable.

Then you haven't tried hard enough.

[code]enum node_type {

enum node_type {



// and so on


struct node {

node_type type;

char *data;


// I don't know the exact syntax for an array of function pointers, and I

// couldn't be arsed to look it up right now

(void *) dispatch_table[] = {

[NODE_POO] = what_to_do_in_the_loo,

[NODE_LOO] = where_to_poo,


// And now we dispatch on the node type:

struct node my_node;


This is not very impressive with only two entries in the table, but if you have a large amount you can find the right function to call in constant time and using much fewer lines than if you were using a switch statement. You can also pass functions as arguments to other functions, like passing a filtering predicate to a filtering function.



I made the thread because I keep seeing articles talking about the increasing adoption of python.



The syntax of the language is easy to iteratively sling data around as well as pivot alogirithms with metaprogramming.

And I already mentioned cython for the tight loops. Remember the 80/20 rule? Still holds for alot of things.



In terms of syntax, performance, and paralellizability, Julia outclasses Python as a language for data analysis



>The trannies in charge of python are stuffing their personal style preference down everyone's throat.

Python's syntax has been pretty consistent since Guido released it in the 90s. You're such a stupid fucking faggot.



>read: it's not quite as bad as Perl's support, but it's still pretty shit.

Most builtins on types are implemented using classes, most of the language is class based, you just don't see it


Rumor has it for more than a handful of elements, gcc -o1(+) will optimise a swicth into a jump table



>Rumor has it for more than a handful of elements, gcc -o1(+) will optimise a swicth into a jump table

it's not just about performance, it's about readability. I find having a table like this much more readable than a switch statement that goes on for fifty lines full of boilerplate code. One missed "break" can ruin your whole program, and good luck finding that. Plus, you can change the entries in a table at runtime, but you cannot change a switch statement.



Oh, agreed. Jump tables are infinitely better. Was just saying, a compiler will fix a switch to be constant time



>most of [an OO] language is class based

^ typical Python 'programmer'. Only knows Python. Thinks basic shit like this is special.


>write your 'tight loops' in this other language

get toilet paper that's mostly 1-ply but it has some 2-ply spots for when shit comes up

get slick hardcover that are half-softcover because nobody cares about the back flap of the cover anyway

make sure your roof doesn't leak over your food and over your bed--the rest of the house is fine to leak on




>typical Python programmer

I barely write Python. But it has major support for OO, it's not "basic shit that's special", whoever I was replying to claimed the support for OO was shit and that's demonstrably wrong



>an OO language has basic shit that's not special, which means its support for OO isn't shit

^ typical barely-writes Python 'programmer'. Only barely-knows Python. Thinks a language having basic shit means that the language isn't shit.

what, do you also barely-know Fortran77 or something? Are you impressed by Python's OO supremacy vs. COBOL?



It's easy, there's a lot of libraries for it, you can get a job with django.


Javascript has brackets and is therefore a real programming language. Python has significant whitesapce and is therefore a worthless piece of trash meme language for hipsters and faggots. I bet they use RPN calculators too.


Both are trash and all of its users should be hung.


Python is the solution to the brogrammer problem.



Based bracketbro



I don't "barely know" Python. I barely write Python. Someone, I assume you, denied Python's support for OO was major, and that is demonstrably wrong.



>Heaven forbid you try writing Python in any editor besides a bloated as fuck IDE designed for that kind of shit.

What the fuck are you even talking about? You can write python in notepad.exe and it would run fine. You don't need an IDE to indent code.



Okay buddy, have fun keeping a constant mental note of how timed you need to press tab on the next like to appease the python gods.

Or you could just save yourself the inconvenience by using a language that doesn't blow ass.


File: 1a70ca4cdcabc27⋯.jpg (64.11 KB, 333x499, 333:499, 61693-160302-e42b5bb4b44c0….jpg)


>javascript be a better scripting language

>1+"kike" is not error

>1-"kike" is NaN

>"undefined is not callable"

It's so easy to make KoOl ApPs!!!!! Why would i want language to find errors??

>o.f(x) bind, (o.f)(x) do not.

Lua - distinct syntax for binding (o.f(x) and (o.f)(x) - no binding, o:f(x) binds, (o:f)(x) syntax error)

Python - binds of attribute access.

JS - '.()' is de-facto distinct operator, but no indication of it. Nice and clear indeed.

>no integers

Yep. Nothing says simple and easy as large integers being silently corrupted. And god-damn IEEE abominations instead of exceptions.

>no operator overload

Because x=Decimal('10'); x*=Decimal('2.123') would be too confusing.

>Functions have variable number of arguments, signature is just a hint. No checking, no default values, no by-name argument passing,

Could be worse. At least it's not $@. Except when it's 'arguments' (or how that shit is called)

>variables are set as global by default

>for-in loop iterates over object attributes, except specially marked by runtime system

>objects map only strings


>what is standard library

>libraries that become obsolete faster that soy smoothie passes through cuck's digestive tract

Reminder: nodejs is newer than python3. Year when using JS for anything other than adding useless shit to web and 'nudezz.jpeg.js' WSH worms, python was already usable for two decades.



Here are the answers

>>982524 (easy to learn compared to JS's BS)

>>982532 (easy to maintain, moar cleaner libraries)

>>982826 (ease of prototyping vs optimization)

>>982778 (the bad environment of its competitors)



>Python is easier to learn than JS

JS has two warts: 'this' and 'with'. Most people don't even know the second one is part of the language. Although JS in practice, with the DOM and framework-du-jour is a total mess, the language itself is very small and well-designed and easy to grasp. Brendan Eich > (Guido + Infinity). Read https://eloquentjavascript.net/ and you've got it. It's easy. The standards updates aren't perfection but they do manage to massively improve how the language is used and they're signposted and infrequent and your old knowledge never actually rots.

Python? Oh watch out that book is about oldversion and we're on an incompatible new version now. And why are we incompatible? Because the language is dense with rarely-connected features introduced over time by PEPs --and just fucking look at them: https://www.python.org/dev/peps/

Python being 'easy' is

1. pure propaganda

2. oh I learned Python and it was easy also it's my first/only language and I have no context whatsoever for saying other languages are harder

3. except I tried to learn C++ once and nearly committed suicide. Most languages are probably about at C++'s level

4. massive, unrelenting, shameless propaganda

5. although due to #1 and #4 there are lots of books so pick your poison, one of them has to not be shit

6. ooh but that one it's not compatible anymore



> PHP-tier type inconsistencies https://loomcom.com/blog/0097_the_wats_of_javascript.html

> Bad default libraries requiring external int64 and string operations https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/

> NPM itself is shit compared to Conda https://news.ycombinator.com/item?id=14271355

Python 3 killing Python is the best thing ever. I hate legacy BS.



>PHP-tier type inconsistencies

You mean Python-tier. It's all the same shit at Python's level. I remember people making cute little charts with Python under 'Strong, Dynamic' and Perl under 'Weak, Dynamic'. That's like the south-facing houses in a cul-de-sac in a homogenous suburb thinking that the north-facing houses in that cul-de-sac must, by their distance, hail from a completely alien and incompatible culture.


Python is a killer language. It's not even in my top 5 of languages most often used, but it's really good for plenty of things. A family member of mine is a research scientist (a nogrammer) and I recently helped him replace a spreadsheet macro with a Python script which generates plotted data and some statistical analyses. After like two weeks of working with him, he's writing his own code and barely asking me questions. The libraries available are excellent; SciPy and NumPy make Matlab look like a joke.


I'm an expert in JS and trust me, it's a hunk of shit.



>Wouldn't javascript be a better scripting language?

I regularly write JS for work (we use React.js for our frontend), it's insanely prone to bugs, I would rather write in literally anything else. Python's strong typing is a blessing from God.



Prove it then, faggot. JS's type system is just as bad as Ruby and PHP.


Another satisfied programmer.


In-browser Python subset, I hope that is the future



>JS's type system is just as bad as Ruby and PHP

and Python. That's the point. If you want a real improvement, then you have to crawl out of the scripting language developmental hole.



>Prove it then, faggot. JS's type system is just as bad as Ruby and PHP.

Bullshit, Ruby actually tells you when types don't match.



i dunno this is the first time i've read that python is a growing trend. maybe all these mentions that "python is a growing" trend are isolated to your own bubble


>the language itself is very small and well-designed and easy to grasp.

no, fuck off.



<I don't like it therefore obvious facts aren't real



File: 68b257b0499a3cc⋯.png (264.92 KB, 1718x904, 859:452, nevermind.png)


>private community

what I meant was...


Python became an acceptable scripting language when it added += operators

the propaganda just annoys me.



You are actually fucking stupid. HIT THE TAB KEY, RETARD. It's one extra button press. You're a nocoder and you will never write anything useful.



>You're a nocoder

Correct, I don't "code" because I'm not a gay estrogen swilling numale python user.


Why would I do

for(var i; i < 10; i++){

console.log("Hello, world!");


When I could do

for i in range(10):

print("Hello, world")

Why would I use

function Dog( breed ) {

this.breed = breed;

this.bark = function() {



When I could use

class Dog:

init(self, breed):

self.breed = breed



Throw in all python's libraries and you'll get my general motivation.



Get the fuck out of here and go back to Reddit you stupid faggot. Kill yourself and do us a favor.



traps are still gay though




Both of you fuck off back to /g/



>these trivial examples are short in Python

when you get a lot of python in one file, it just looks like a wall of featureless code that defies the ability of your eye to scan it comfortably.

when you get a lot of python in one project, it spreads out and uses Zebra camouflage to protect the herd against any predators trying to figure where shit even fucking happens. There's just file after file of do-nothing class definitions.


JS doesn't need semicolons except

1. when the next line begins with an array literal or similar (begin the line itself with a semicolon)

2. when the next line begins with a self-invoking function (begin the line itself with a semicolon)

all of the arguments in favor of semicolons are, if you pay attention, massively retarded. Yes, even the arguments by the You Don't Know JS guy and the I-Invented-JSON-LOL guy.



Why do that when you can use Haskell.

for_ [1..10] $ const $ putStrLn "Hello, world!"


Data Dog = Dog { breed :: Breed }

bark = putStrLn "Woof!"



>when you get a lot of python in one file, it just looks like a wall of featureless code that defies the ability of your eye to scan it comfortably.

Have you ever looked at more than 10 lines of code in your life




one hammer does not make a toolbox - even if you're used to bashing everything in with it



programming isn't so advanced that you can put anything like a proper toolbox together. We're like apes that have barely just figured out that we can pick bugs out of a nest with a bit of stick. Any kind of 'right tool for the job' mentality in programming is going to have you staring at a box full of bent screwdrivers with heads that don't fit any screws in use, ratchets that can't maintain a grip on any bolt, and hammers that you have to hold by the head because the head is the weakest part.


all the time. To find code worse than Python you have to go back to pre-structured languages.



>bark = putStrLn "Woof!"

class Barking a where
bark :: a -> IO ()
instance Barking Dog where
bark _ = putStrLn "Woof!"

>Why do that

Because compiled, statically typed language is not always good replacement for dynamic one.




Haskell doesn't need to be compiled before it is run. Your program can even hook into ghc and compile / interpret Haskell from within your own application.



You're being too kind to JavaScript in the object-oriented example. You forgot to assign `this` to a local variable such as `that`, in order to access instance members within nested scopes.




How about you stop being OOP faggots and use object literals.



t. skiddie



Not for Python's type checks


Type coercion is illogical


I want Python to bring back { ; } so I can code golf with it

Also indentation is shit since tabs vs spaces are not explicit rules



reminder that Python is general purpose, and combining that with C, Asm, Go, Haskell, Lisp and JS/Typescript you need nothing else




File: 5a66b415ddb794a⋯.gif (151.78 KB, 400x267, 400:267, 1375857314515.gif)

>python script no longer works because you used pyqt4 to make the graphical frontend and pyqt4 is deprecated and removed from your repo so when you updated it got removed

>now have to learn pyqt5 bindings to fix it



<lua's a much better language though

>LUA_INIT means it's not safe for sysadmin work since someone could forget this backdoor and make a script setuid

<luapower has a way to produce single executables from scripts though, and those executables ignore LUA_INIT

>they also have 5x the startup overhead of a bare 'luajit myfile.lua'

shit like this is why Python isn't dead yet


>Try python

>Have to use 4 spaces

Dropped it faster than a sack of hot shit.



You can use any number of spaces, or even tabs, nigger.



Nonsense, anon said he invested nine seconds into the language and gave up. Get on his level.


it is slow af, much like the pajeets, womyn, and shitskins it's designed to appeal to. was there a question OP?



Qt is to blame for this



>python libraries being removed by the python repo is the fault of QT despite QT4 still being usable.

checks out



If Qt wants to pull a library and replace it with another you can't blame them


https://www.qt.io/qt-for-python <= They want PySide2 to be standard



>Letting random organizations brick your repo

you guys are almost as bad as the idiots that run NPM where one package got deleted and fucked thousands of projects


Does anyone here use Jupyter notebooks?




what do you want to know about them?

they're basically an .org file in Emacs but with better graphics. And worse languages.




I don't know much about them, but I've dabbled in the past and quite like them.

I was skeptical before because I thought people were suggesting they replace text editors/IDEs etc...

They're more for writing documents with code that generates quick results (visual otherwise) included.



visual or* otherwise


No surprise that there are a lot of nogrammers giving their opinions on python. Pro-tip time:

-It's shit

-It's slow

-Forced spaces/tabs

-Dynamic crap all over the place

-Which means it gets more confusing the bigger it is

-Available IDEs are fuck huge


The only positive is that it is paying my bills. I guess the snake motif is kinda cool, too.



Switch to Julia. It's fast.




in Python? Where? Haven't heard of them.

I thought the trannies were all over in FP langs.



I just got it. Static languages are more masculine, which is why soycoders flock to python/js/ruby/php.



Now compare it to JS.

- less shit

- gets stuff done

- never confusing (unless you overuse OO)

If you want to be static like >>985014 I suggest Go, Kotlin, Crystal, D, Nim or (((Rust)))

Also https://github.com/mathialo/bython is a thing

and http://python-with-braces.appspot.com/ too



>- less shit

>- never confusing

decorators, list comprehensions, generators, operator overloading, metaclass bullshit, GIL

Python is stuffed with shit that doesn't make the language any better, it's not essential, it's not even the best way to do things, it's just something that someone liked once upon a time and got past Guido (which is like getting a football past a concrete bollard. You just have to not aim directly at the thing and you win.)

everything good about Python is propaganda. "There should be one-- and preferably only one --obvious way to do it." ? Ancient history.



>1-indexed arrays



File: d835df8a3a55dfd⋯.gif (354.43 KB, 500x442, 250:221, 1539059352088.gif)


A better question is why the fuck does JS still exist?



>decorators, list comprehensions, generators


You're a brainlet. Quit programming, try McWagecucking instead.



Programming brings decent money only through advanced wageslavery.



>-It's slow

this doesn't matter for many general desktop application things however.

>-Forced spaces/tabs

I used to dislike the python tabbing, but overall I think it works better than the curly braces of C and Java.

The common problem I had with the braces was accidentally deleting a closing brace, and then saving the file causes the IDE to try to re-indent the whole file correctly with what was left. So now you can no longer see where the deleted brace should go. ....You do not ever get that problem in Python tabbing, since every line has its own spacing. There is no closing bracket to accidentally delete.

I kinda wish that C and Java used 'opening' and 'closing' statements. Personally I think that would be best.

such as:

function_begin: this_function_name()

// whatever code goes in here

function_end: this_function_name()

This way you avoid the need for indents but the IDE could still tell if you were trying to (incorrectly) delete the closing line of a function.

And when you type the opening line, the IDE could automatically generate the closing line for you. So usually it really wouldn't be much more typing.

A lot of newer languages seem to try to save you from typing a few keystrokes, but their syntax of the source files isn't nearly as clear.

As the code length increases the main problem you have is code clarity, not excessive typing.

Overall it is better to write the source code to be easier for people to understand, since the computer can/will generate its own version anyway.



But then you can't go fast and loose with braces code-golfing (line count, not character count)



>I kinda wish that C and Java used 'opening' and 'closing' statements

<Let's make C and Java even more verbose than they already are





Michael Pinoy Reeves is the shit



>the syntax lends itself to data analysis

What a load of horse shit.



Lua: It may be shit, but at least it's fast shit.



>The syntax of the language is easy to iteratively sling data around as well as pivot alogirithms with metaprogramming.

Pythons syntax is wholly mediocre, any dynamic language with a REPL will let you iteratively "sling data around" and Python's metaprogramming facilities are awful.

The reason python is used so often for data analysis is because of the libraries that exist for it. It's got nothing to do with the syntax, except insofar as the syntax can be cited for the reason why non-CS stem students are taught it in introduction programming classes and consequently chose to use it when writing their own software including aforementioned libraries.



Lua: fast to run

Python: fast to prototype

PHP: fast as fuck boi


The libraries will never be on par so



>JS's type system is just as bad as [...] Python

I'm a python critic but that's just factually incorrect. JS has weak typing, python has strong typing. Both are dynamic, but weak dynamic is objectively worse than strong dynamic.



PHP cannot keep up with LuaJIT. But that's hardly relevant since you'll just about never hear both of them proposed as possible solutions for the same problem. And for that matter, you'll hardly ever hear LuaJIT and Python proposed as possible solutions for the same problem. Basically nobody uses Lua for anything other than an embedded scripting language in another application, and you'll hardly ever hear python proposed seriously as an embedded scripting language.

>The libraries will never be on par so

I never said otherwise; I agree. Python's position is entrenched, threatened only by Julia which makes a point of supporting Python's libraries as a way of cheating the system by giving itself access to Python's ecosystem.

My point is that python's syntax isn't anything special. it's not particularly composable when compared to other dynamic languages, nor is it's metaprogramming story very good.


Nim and Julia are both large improvements over Python, but I think Nim beats out Julia because of static typing.


Python is great for little scripts on the server. Only decent thing that came from Javascript is json merely because it killed SOAP web services. Otherwise Javascript needs to die in a fire. I blame Google for resurrecting Javascript back in the mid 2000s.



Wish I had heard of this guy before.



>JS has weak typing

>python has strong typing

weak/strong is pure propaganda, not a meaningful description of type systems. Neither JS nor python let you do something like "pull the seventh 8-bit int out of the array of 64-bit ints". JS mainly has a very eager-to-coerce == operator. You would not 'weaken' Python's type system if you added a loose_compare function t it and used that.

Don't debate me on the precise use of these terms. Rather, don't use these terms. No matter how 'rightly' you use them, they don't help you. They're a bad meme.

JS's type system is just as bad as Python's when when you consider the sorts of errors that they can protect you from. (In JS, this means the sorts of errors after you drop == and use === everywhere like literally everyone has) ATS, which can "pull the seventh 8-bit int out of the array of 64-bit ints", has a type system that can protect you from such errors as buffer overrun. Yes, with the type system. So such errors show up at compile-time. Regardless of how 'hot' that code-path is. Such a type system is like pair-programming with an autistic genius. Python's type system is like pair-programming with a seeing-eye dog.



Shutup retard



>like literally everyone has

Why? I can't see any measurable difference in performance on my system.



var t=1;

var p1=performance.now;
for(var i=0;i<100000;i++){
var p2=performance.now;



var p1=performance.now();
for(var i=0;i<100000000;i++){
var p2=performance.now();


And now tell me that === is a must for performance. I would recommend only using it when you actually have to.



>However it's a language designed for level 99+ wizards

And since not many people are level 99+ perl wizards, you will inevitably deal with utter trash nearly each time you come upon perl code in the wild.




your benchmark clearly shows that === does massively less work than ==. which should be really obvious from a description of what == even does.

Even though === is obviously much more performant, I don't say you should use it for that reason. You should use it because it's usually what you want. =='s for shit like, you want to check a member of an object you deserialized from JSON from a source that you suspect may not reliably be able to put 123 into an object instead of "123".



Bullshit if you run it a few times the first one varies a bit up and down and the second one too.

HAHA I just noticed my mistake:

I posted the wrong shit for test 1 here's what I actually ran(notice that the one before doesn't even execute because of the missing parentheses after performance.now):

var p1=performance.now();
for(var i=0;i<100000000;i++){
var p2=performance.now();

Each time you run it the result varies from 227 to 228.

So there is clearly no measurable difference for 100000000 cycles ON MY SYSTEM!



const n = 100000000

for (var i=0; i<n; i++) i==2?true:false

for (var i=0; i<n; i++) i===2?true:false
As used
$ for x in 1 2 3; do node blah.js; done
==: 73.442ms
===: 71.837ms
==: 71.523ms
===: 74.952ms
==: 72.809ms
===: 72.116ms
so the thing you brought up on your own, performance, doesn't matter. Pick === based on it being what you actually want most of the time.



if you assign a var in the loop instead of throwing the value away, and then also print that var afterwards, times jump to 130ms from those numbers. But there's still no detectable ==/=== difference.

wtf am I even writing JS benchmarks though

why did you do this to me?



>you deserialized from JSON from a source that you suspect may not reliably be able to put 123 into an object instead of "123".

DOESN'T happen:




>{dfsf: 34243}

Where's your problem? All browsers do that. Don't tell me it's about IE support.


That's what I said. Glad you agree.



>weak/strong is pure propaganda

Go back to halfchan



it's literally what people say when they know three languages that all have shit type systems



Nim/Go will be king, and soon Python will just be a wrapper for Nim/Go, and Nim/Go will be a wrapper for C. Fuck Rust, Ruby and Julia.


This is why Python > JS



go is googleshit.



That's just because console.log() itself takes a fuckton of time. You never want to be putting that shit in loops because it'll murder performance.



no. try it yourself. the console.log is *outside* of the benchmarked code. node is just doing some dumb optimizations that break benchmarks but never benefit real code.


File: 125147a09db9c5d⋯.png (329.97 KB, 668x664, 167:166, disgusting.png)


>Python > JS

Lua > JS > Python

Git gud

Anyone got that "object oriented" image. I can't find it anymore. I need it to make fun of OOPfags wherever I find them.


File: a10a91a603142ca⋯.jpg (116.81 KB, 1224x720, 17:10, 1459879567483.jpg)


>JS > Python


actually programming in C++ > this shit thread


File: beb218584341c56⋯.png (21.43 KB, 331x286, 331:286, c7e6c0ba62635e8364c7566d88….png)


>anon can't deny that Lua is better than Python

Found the pythonfag.


>Pure C > Impure dirty C++




Python is OOP in the same sense smalltalk is OOP



I know about it not being based on OOP but if you ask the pythonfags why python is better they answered that it's great at OOP. One could say the same thing about JS.



>python's shit OOP

>anything at all like smalltalk's OOP

you stupid motherfucker




JS coerces everywhere, not just for ==. "23" - 7 = 16, "23" + 7 = "237", "23.5" & 15 = 7. Compare perl: "23" + "7" = 30, "23" . 7 = "237", "23.5" & 15 = 7. Python tries it's best never to coerce implicitly except between int and float ofc. I admit it would be nice to have buffer overflows caught at compile time, but python, unlike js, will at least error at runtime not for underflows though lol.


Python is very similar to smalltalk. eg operations on ints are just methods:


ifs statements implictly call bool, for statements call iter, etc.

It has a much larger syntax, and it uses text files, but those are unrelated to the implementation of oop.



You can give types in Julia if you want, but it isn't needed.

e.g. instead of

function f(x)
return x^2;

you can specify

function f(x::Float64)
return x^2;




I'd prefer it to be non-optional, in the event that I'm picking up an existing codebase.




>Python tries it's best never to coerce implicitly

You do not try to 'never coerce'. You just don't implement that stupidity.



>Python is very similar to smalltalk

You mean Ruby.

[Return][Go to top][Catalog][Nerve Center][Cancer][Post a Reply]
Delete Post [ ]
[ / / / / / / / / / / / / / ] [ dir / mde ]