lainchan / λ
(untitled)
Anamika · 2017-11-10 21:22
Is python still worth learning for web development? I've seen across different image boards anons saying that it's 'on it's way out' and that it has become increasingly difficult to get a job with python. Am I better off learning node.js?
Boris Grishenko · 2017-11-10 22:50
Py is good for deep learning now
Random · 2017-11-10 23:41
is this a "i'm learning programming and i don't know which language to start with" post? if so, it doesn't really matter. ultimately you should learn both python and javascript (and c, c++, java, php, golang, perl, ....). my point is you're not going to be hired if you only know one language.
if you already know how to program and are just asking if python is worth the day or two it takes to get up to speed with it, then my answer is yes, it is worth it. it'll basically be expected knowledge for most tech jobs out there. even if the actual product you're working on isn't written in python, there's a good chance all of the internal scripts and tools will be in python (or perl or ruby or all three if you're extra lucky like me).
Lady 3Jane.. · 2017-11-11 00:11
>>4883
my last job, our company's language of choice was python 3.6. my job now, our language of choice is python 3.6.
Python has libaries for most things, so you can use it for most things. web dev, deep learning, midi and RF why not.
it's not 'on its way out' and it's not difficult to get a job with at all. where did you even read that? dont listen to js developers with aposematic hair colors.
My boss doesn't care that I know C, Haskell, Clisp, and when I try to express one of these might be a better fit for something, he scoffs. I'd assume because he'd a dotard, but it also could be because Python is the only language out there that accommodates turnover rates at companies.
Roy Batty · 2017-11-11 00:19
>>4885
>>4886
I should of mentioned in the original post that I want to do freelancing or work remotely for a company, with this in mind is node.js a better choice than python or vice versa?
Judge Fang · 2017-11-11 05:04
python is not going away anytime soon, especially for webdev. We'll still see demand for django devs 10 years from now
Mitnick · 2017-11-11 10:33
>>4886
>it also could be because Python is the only language out there that accommodates turnover rates at companies.
I suspect that too. Maybe they can get things done 10x faster with 10% of the bugs by using Haskell but if it is perceived as difficult to hire Haskell devs then no one will do it.
Python is not popular because it is a good language. It is popular because it's popular.
lietzu · 2017-11-14 17:01
>>4896
>It is popular because it's popular
This exactly. It's honestly kind of frustrating how overused python is recently. It's a very neat language, but I just can't see it as a tool to do everything.
The only reason it is used for everything is because people maintain very good libraries and frameworks that make it capable of doing everything. The only reason these tools are widespread and well maintained is because it's a popular language. It's a vicious cycle that I don't think the programming world will escape for a while.
Most noggin toggling is what a big market share Python has in the big data world right now. I get frustrated with how Python with a heap of external libraries is chosen over R or Scala or really any other language that was made with data manipulation in mind. I can understand it more for the analysis, but why anyone would want to do data streaming in a dynamically typed language is beyond me.
I feel like there will always be a push by lazy developers to make one language they know the universal tool to solve all problems. Right now Python is that language.
The truth is there are advantages to coding in a language suited to solve the specific task you need it for. No library will change the syntax and core features of the language, both of which can be crafted to suit a task.
OP's post shows the problem with the current tech world's language obsession. We should focus on learning paradigms rather than languages, a syntax difference is pretty minor to overcome for any real developer.
But in summary, I'm just tired of this motherfucking snake in my motherfucking train(-ing pipline).Also lain
Agent Richard Gill · 2017-11-15 02:31
>>4896
>>4968
I think you guys are overlooking the fact that the syntax actually makes sense
With everything else like C, Java, JavaScript, PHP, whatever, the syntax is the "bad part", it's been 'designed' by emergent processes (aka its syntax is basically just crystallized cruft)
Basically it's a rapid prototyping language
but when you have a field where agility is the object (like e.g., Big Data), it becomes the language of choice
and then at that point you add in all the libraries and the fact that with a smidge of effort you can compile it to native for extra performance for a task you're doing to end up doing regularly and it starts to make sense as more than just an "accident"
tl;dr Python isn't "popular because it's popular" (PHP would fit that much better); it's popular [among developers] because it's actually been DESIGNED TO WORK WITH. I mean, for blocks of code which aren't heavily optimized, it's practically like reading English
Zero Cool · 2017-11-15 02:38
>>4885
>if you already know how to program, python is worth the day or two it takes to get up to speed
This is true
But I would actually say the other side of the coin is "yes" also
in that
If you DON'T yet know how to code, Python can be one of the fastest, gentlest ways to familiarize yourself with loops, arrays, conditional statements, functions, all that stuff. No bothering with a C compiler; full functionality at REPL, and the syntax (and Fun Quirks like JS and C have) aren't things you have to grapple with learning at the same time as you're trying to learn how to into control flow
(And then from there the skills will transfer easily enough to basically every other language)
So basically
If you're new to programming, it's one of the fastest ways to learn "to code" in a legitimate capacity
(so LEARN IT)
and if you're experienced at programming, it'll take two seconds to learn enough to add it to your resume,
where it will look quite shiny
(so LEARN IT)
Mentat · 2017-11-15 03:33
>>4984
i suppose it depends on how serious OP is. i'd always recommend starting with a "compiler" language just so that you get that out of the way early. starting with python might give you some funny ideas about how programming languages work in general.
>it's one of the fastest ways to learn "to code" in a legitimate capacity
this is true enough. i can't think of a language with a better ratio of "time spent learning" to "things you can actually accomplish".
>>4887
my sincere recommendation is to learn both. once you get one, the other will be easy enough. start with python if you want to fuarrrk around on your own projects. start with js if you want to get straight to web dev stuff. keep in mind that the majority of backend code is not in node.js. you'll probably end up needing perl/php/python/golang too. so if you don't know how to code, learning programming concepts in general should be your primary objective, not learning some particular language. try to get to the point where you can learn a new language in a day well enough to understand and modify someone else's code.
Donna Hawthorne · 2017-11-15 19:49
>>4983
>I think you guys are overlooking the fact that the syntax actually makes sense
>no elaboration
This is your opinion and a badly formed one.
Take len(x) x.len(). It is completely arbitrary inconsistency based on a single person's personal preference but your benevolent dictator has convinced you it is the One True Way™
http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm
And don't get me started on significant whitespace. It doesn't matter that multiline lambdas are impossible in Python, just so long as the code looks pretty, that's all that matters. What a joke.
>but when you have a field where agility is the object (like e.g., Big Data), it becomes the language of choice
Yeah, because dynamic typing is exactly what you want when your entire application is manipulating data. The Python + Big Data meme is down to sheer ignorance and Python being popular because it's popular.
>for blocks of code which aren't heavily optimized, it's practically like reading English
In other words Python appeals to non-porgrammers who don't know what a good programming language looks like.
>compile it to native for extra performance
No. Just no.
https://softwareengineering.stackexchange.com/questions/243269/why-isnt-there-a-python-compiler-to-native-machine-code/243274#243274
Marly Krushkhova · 2017-11-15 21:24
>>5003
>len(x) vs x.len() is a completely arbitrary inconsistency
>One True Way™ breaks down under scrutiny
That is true,
however that does not negate my point that if you're trying to teach a "for" loop,
for item in my_items:
do_thing(item) is way clearer than
for(c=0;c<sizeof(items);c=c+1)
{
do_thing(items[c]);
} The first line, what does it mean? "Oh, it's just how you start a loop in C. Just keep typing it until it either becomes habit or you learn enough programming theory to care what it means and understand it"
Now obviously, Real Programming, hiding abstractions, yada yada, as well as the more legitimate issues Python has
I wouldn't recommend stopping at Python for anyone that wanted to really sink their teeth into coding
But it's just nice to have all the crappy stuff abstracted away when you're just tryna do <thing>, whatever <thing> is. Just type what you mean; the point of using a programming language in the first place is to remove complexity when engaging it would be a waste of time
Liet Kynes · 2017-11-15 22:11
>>5009
Hell of a strawman using C as your counter example. The whole point of C is that you can visualize exactly how your code will be interpreted by the machine and you can't do that if the language hides away all the details.
Try again with a language that has similar goals and high level use cases to Python.
my_items.each do |item|
do_thing(item)
end
Here the each method is called on my_items and passed a block as an argument. Pretty simple.
for item in my_items:
do_thing(item)
Here my_items has a secret __iter__ method and a next method and it raises and exception when it's time to stop and it's all just magic so don't worry about it.
If you think Python "makes sense" you've probably never looked under the surface.
Milner · 2017-11-15 22:30
>>5009
> sizeof(items)
Really? Okay, forgetting the fact that you don't seem very experienced in languages other than python, what you're basically saying is that using iterators is better than using for loops with indices.
I don't think anyone would argue seriously against that. Iterators are definitely better than indexing using for loops. Abstracting collections is always nice. But python isn't bad because of it's iterators. There are lots of other languages that has iterators. In julia for example, you can add iterators to basically any datatype and there is a standard interface that allow you to implement "for x in data" on any datatype. Which is a much nicer implementation of iterators.
There are lots of other things wrong with python such as 1. It's slow 2. Its overreliance on OOP, which slows everything down 3. Meaningful indentation 4. fuarrrking python 2 vs 3 (and the associated retardedness of its language designer and his egotistical insistence that everyone program in his style and his style only) 5. The len(x) vs x.len() problem 6. No native array type 7. Weak to non-existant type system 8. Weak functional programming support 9. Global interpreter lock 10. C FFI is hard 11. Meaningful indentation again because I really hate it 12. Lack of interface/traits system.
In the end though, it's a good language for noobs. I use it for my deep learning stuff and it's fine to use. I would hop to another language at the drop of a hat though, but there isn't an another language with as widespread use in deep learning as python.
Nguoi La · 2017-11-16 03:26
>>5003
>The Python + Big Data meme is down to sheer ignorance and Python being popular because it's popular.
Maybe in part, but I also think python is a perfectly capable language for data science. That kind of work involves a lot of rapidly developed scripts that don't ever see the light of day outside your work environment. Like if I just wanted to pull eigenparameters out of some raw data, python would be the first language I'd reach for because I could just include some parsing libraries, write a few lines of program logic and dump the results. Doesn't matter if it's "bad code" because I'm the only one using it (and I'm probably only using it a few times). I don't know what the better alternatives would be... perl maybe? Something functional like Haskell? R? Fwiw I think >>4968 makes some good points about drawbacks in "production" big data vs "analytical" big data (maybe that was you?).
Personally, I use python to fill the middle ground between bash scripts and C. I could have picked something else, but python just happened to be the most accessible. There's definitely something to be said for how quickly you can make little utility programs in python.
Donna Hawthorne · 2017-11-16 03:46
>>5015
My personal gotos for that would be Mathematica and Julia. Well, if it's really, really heavy on parsing I might break out Haskell, but in those cases we're not in script territory anymore.
I definitely understand the rationale for Python though. Matlab/Mathematica are proprietary and behind extremely expensive licences. R is open source but definitely not general purpose. Julia didn't exist until recently.
Python is not particularily well suited for ML and big data, but it is capable of it and it was around and popular enough that a lot of people who did the ML stuff already knew it. I think the closest alternative at that time would have been Lua, which HAS seen some use in the field (Torch, and quite a few projects over at the LHC when I was there), but it is certainly more obscure. I would have preferred it over python though.
Of course, Julia is nearing 1.0 and has excellent libraries by now. So it could be a very serious challenge to Python in the following years, especially for ML and mathy stuff.
Acid Burn · 2017-11-16 04:48
>>5009
I tried to learn python first and got stuck on for loops, I didnt understand what the fuarrrk they were supposed to do.
Then I went to C and understood it immediately.
Because the ([initialization]; [test]; [increment]) is explicit and clear and makes sense.
>Oh, it's just how you start a loop in C. Just keep typing it until it either becomes habit or you learn enough programming theory to care what it means and understand it
Who the fuarrrk would explain it like that? How the fuarrrk does your programming newbie know what a for loop is or what its supposed to do? How do they know what 'iterating over' means? How they'd use it anywhere outside of the single example they were just shown? If you just tell them 'its a loop look how obvious and intuitive it is (for x in y do z)' without some prior familiarity? its computer, its gona do some exact, specific thing, if I'm a brand new beginner and you just give me a 'simple' for loop, how the hell do I know what that is when the entire thing is a vaguery based upon preexisting learned intuition?
Wheras in C, its perfectly clear and straightforward:
a while loop checks if something is true, and does whatever code is in the braces, until its no longer true.
a for loop, say,
for(i=0,i<foo;i++){
dosoykaf(args);
}
is the same as
i=0;
while(i<foo){
dosoykaf(args);
i++
}
and now I can intuitively understand 'simplified' for loops. nice.
lietzu · 2017-11-16 04:57
>>5015
I'm not saying that I have problem with python being used to write quick data manipulation scripts. My problem is how people write large bodies of code, tasks or even data pipelines, that will be worked on by many people in python.
I agree python is great for quickly prototyping and implementing scripts and other simple services. However, it is poorly suited to working on large projects with a team, largely due to dynamic typing. At least when compared to other languages that have particular advantages for your domain.
Don't think I'm saying working on a large python is impossible or even that terrible, but there's a large loss of efficiency from using a language more suited to that, and runtime errors are such a pain. Also I'm not particularly fond of the parallel programming support either, but that's harder to argue (but also very important to big data).
Milner · 2017-11-16 06:33
>>5018
>I agree python is great for quickly prototyping and implementing scripts and other simple services. However, it is poorly suited to working on large projects with a team, largely due to dynamic typing.
I dont want to start a pissing match about mylang is better than yourlang, but I think Ruby is superior to Python in the respect of designing large OO programs. Personally I hate OO and I try to avoid it as much as I can but Ruby just makes OO nice, the entire design of OO in Ruby is very Smalltalk-ish and emphasizes objects over classes. Modules in Ruby are really just non-instanciable classes (classes inherit from modules and modules inherit from the universal object). If youre the kind of person who wants a deep understanding of how the programming language you use works rather than just doing a quick read from the docs, then Ruby is really one of those languages you can sink into and you will always understand how everything works. Im not hating on Python, Python can do most of what Ruby can in a similar way. But Python was designed to be more imperative and allow you to just start scripting without thinking about overall design. Both Ruby and Python severely lack when it comes to high order functions as neither language takes well to global functions being passed around, but then I have Julia for that.
queue · 2017-11-16 07:11
>>5016
Yep I can't wait for julia to be popular in deep learning. It's incredibly well suited for ML. I do all my serious deep learning stuff with python since I need to use other people's models but julia's deep learning libraries are just really good.
Ender · 2017-11-16 09:51
>>5019
>Python can do most of what Ruby can in a similar way. But Python was designed to be more imperative and allow you to just start scripting without thinking about overall design.
I think the difference is that Python was never designed it just evolved. One day they decided they needed OO, so they bolted it onto the language using dicts. One day they said Haskell list comprehensions look cool, so they added that. It's just hacks upon hacks with a pretty syntax and an authoritarian+fanboy community with an aversion to asking questions.
>I dont want to start a pissing match about mylang is better than yourlang,
The reason I mentioned Ruby >>5010 is because that is an example of a language that actually is well designed and "makes sense". This goes back to my original point that non-programmers use Python and think it's awesome and are completely ignorant of what else exists.
>>5011
> sizeof(items)
>Really?
Just to elaborate because this is a Python thread and half the participants probably know understand what you mean. sizeof returns the length in bytes, so it will only be useful for looping if you have an array of 1byte elements (like a string). It will also only work on an array whose size is known at compile time. Doing sizeof a pointer will return the length of the pointer in bytes (i.e. 4). So yeah, this is a strong indication that >>5009 does not actually know C.
Ein · 2017-11-16 10:15
>>5016
>>5020
i've got to look into julia more. i'm working on some mathematical simulations (basically a specialized pde solver) and it seems like it would be a perfect fit.
sage for ot..
lietzu · 2017-11-17 01:34
>>5019
Hah it's not like python is my language. Don't worry, I'm just saying what it's generally good for. I don't have an opinion on whether Ruby or Python is better because I don't use either extensively.
Scala is my language for HOF (and anything else really), although I've been meaning to check out Julia for analysis for quite some time.
Unknown · 2017-11-17 07:51
>>5024
If you're doing diffeqs, you'd definitely want to look up https://github.com/JuliaDiffEq/DifferentialEquations.jl .
It's actively maintained, constantly being improved, and afaik it makes it really easy to plug in both your own solvers, your own diffeqs, and your own numeric types separately from one another.
Lukasiewicz · 2017-11-17 20:36
Im currently looking into web development and i setup a django project with React and Redux making a single page website.
WIth that im really not doing a hole lot with python than accessing the database. I couldnt care less what language the backend is really. As most of the action is going on in the front.
Unknown · 2018-01-08 22:51
>>4883
Python is an amazingly fun langue to program in compared to really anything else.
Unless you are a real "math head", who really loves trying to write overly complicated, hard to read algorithms, you'll typically prefer Python wherever you can use it.
I would say a MAJOR caveat of Python is that it can make programing "too easy" for beginners.
By that I mean, you are not really forced to learn "algorithmic thinking". You rarely have to consider time complexity, sorting or really anything because Python does it for you.
Why is that a bad thing? Well, it can actually hurt your Python code.
While Python provides tons of tools to keep from having to re-invent a sort algorithm every time you want to do pagination ... when you are making something new in Python, architecting larger design patterns, I've seen a lot of people get pretty lost pretty fast.
So, go for it with Python, especially for WebDev, but once you are proficient and can tackle most problems, go back and learn your time complexities, sorting algorithms, and learn how to do some of your Python task in C/C++/C#/Obj-C etc... it will make you appreciate Python that much more, and really learn how to use it well, and not just google stackoverflow articles when you are trying to figure something out.
let · 2018-01-09 17:53
>>6044
>quoting the OP
Cereal Killer · 2018-01-09 18:08
>>6044
" learn how to do some of your Python task in C/C++/C#/Obj-C etc... it will make you appreciate Python that much more,"
Well in comparison to those languages sure, but if one were to play around with a language like Common lisp or Haskell, one could find their once beloved list comprehension and iterators to be non-expressive as functions like map and fold have a lot of nice properties that express their intent quite clearly
"Python is an amazingly fun langue to program in compared to really anything else."
Personally I find python a pain due to the gimped recursion and lambdas. A language like Common Lisp is just as general as python but offers the ability to do this functionally (as CL has actual lists) without any weird limitations, and if there is a limitation you can implement it and make it look first class (look at CL pattern matching).
Sabo Engle · 2018-01-10 13:37
>>6044
Python's not bad, but if I want to enjoy high level constructs like those in Python, I can just use D which also has additional features that blow Python out of the water.
Trinity · 2018-01-12 20:51
I want to make a car rental provider website, so I let companies show off their options and hopefully include booking later.
does django make sense? Should I use wordpress? Any direction or ideas?
H.R. Giger · 2018-01-13 00:17
>>6126
You will very, very quickly exhaust what wordpress provides to you. Django is fine as long as you don't get sucked into the sqlalchemy bullsoykaf and use mako templates. I personally turn to ruby/sinatra/eruby templates, so I would encourage you to check it out and choose whatever you think is the best option
Cutter · 2018-01-13 05:22
>>4883
Python is the best all around language
sure django is ok but nodejs and ruby on rails is a soykaf ton better for webdev especially if you have a db on the backend
I use python all the time for small linux/unix scripts since it so fast when bourne shells just dont cut it.
Project 2501 · 2018-01-13 19:41
>>6129
Thanks for the advice!
I have learned python, so that's why Im leaning towards django. What kind of limitations does wp have for my use case? I've found 3rd party addons like edirectory which seem to bend wp to make it suitable but I can feel how hacky it is. Also, wp is unfamiliar to me, Still learning and reading around about it.