8 ms·
>aren't programmers Also extremely popular with people who are programmers and need to do things. Sorry, this is a frustration of mine lately. Python is a fa
by blhack 9y ago
>aren't programmers
Also extremely popular with people who are programmers and need to do things.
Sorry, this is a frustration of mine lately. Python is a fantastic introductory language. It's also a fantastic general purpose language.
Newbies get turned off of it because it feels too easy, and they know that "real" programming is supposed to be hard.
- gregschlom 9y agoI disagree. Python is great for scripting and for small projects, but I believe strong, static typing is an essential feature for large scale projects. I wouldn't want to use Python for anything that's predicted to end up with more than a couple thousand lines of code.
- pdpi 9y agoPython 3 supports optional type annotations that you can check with something like flake8.
- frgtpsswrdlame 9y agoMost people writing VBA code for excel are only informal programmers. For example, I never took a CS course in my life but learned VBA and programming on the job. Since then I've learned python and other languages but when I'm doing a home project or something I always come back to python. It's just so easy. I was working on a macro the other day in Excel, it took me a couple hours to get it all working but I'm pretty confident that if I could've coded in python I could've banged it out in 20 minutes or less. Edit: I suppose my point got a little lost. What I mean is that I highly doubt much Excel code is a "big project." It may feel that way when you crawl through some of the hideous VBA coding I've done but much of this is due to the inexperience of the coder and the realities of VBA. Give me python + 4 or 5 libraries and I could recode anything I've ever made in VBA in 1000 lines or less.
- jnwatson 9y agoUnfortunately, there are several companies and hundreds of divisions of companies run entirely out of excel spreadsheets.
- xapata 9y agoAnd integration with Python will be an enormous help for them.
- bluedino 9y agoNext up, get rid of Access
- PlugTunin 9y agoNo one is proposing that we get rid of spreadsheets. I understand, though: you hate VBA. And by extension, Access. But Excel, with or without Python, doesn't mean it can suddenly be used as a relational database. But you knew that. So, what should replace Access?
- rmbeard 9y agoActually, a number of people are proposing this for certain applications. It is also reasonably likely to happen, at very least the spreadsheet is being challenged which will put pressure on spreadsheet vendors and most definitely cut into their marketshare. Adding Python support to Excel seems to be an attempt to resist this.
- Daishiman 9y agoGiven that there are literally thousands of huge projects using Python at massive scale and hundreds of kLOC, it's clearly not essential.
- erikj 9y ago"50 million cigarette smokers can't be wrong!"
- ribosometronome 9y agoAn appeal to popularity is not really a logical fallacy if someone is arguing that something is (effectively) unpopular.
- cm2187 9y agoDepends if you define popular by most used or most liked. Most used: everyone pays taxes. Paying taxes is popular! A more practical example is javascript. I write some javascript, not because I like it (I hate it), but because that's the only way to make things happen in a browser. Javascript is popular. Does it mean it is liked / a good language?
- deleted 9y ago[deleted]
- mpweiher 9y agoIf the statement is "there are no cigarette smokers", then "there are 50 million" is a reasonable counterpoint.
- Koshkin 9y agoCode written in a statically typed language requires less testing. How is that not essential?
- joshuamorton 9y ago
- xapata 9y agoThat's a fine personal opinion but I'll add my vote to Python being a wonderful choice for large programs.
- Lxr 9y agoInstagram would disagree with you. Seriously, Python is an absolute pleasure for managing large web projects and the lack of static typing has never been an issue for my company (spend the time writing tests instead!)
- mixedCase 9y ago>(spend the time writing tests instead!) Every sufficiently large test suite will contain an ad-hoc, informally-specified, bug-ridden, slow implementation of half of a proper type system.
- nick238 9y agoWhat's the point in testing types if the tests that check it works pass?
- sidlls 9y agoNo, the claim is that the tests that "check it works" are really testing the types (as an ad-hoc type checker) and wouldn't need to be written if a sufficiently strict static type system were used instead.
- andybak 9y agoEvery sufficiently large statically-typed application will contain an ad-hoc, informally-specified, bug-ridden, verbose implementation of half of a decent dynamic language. (I too enjoy a good pseudo-Greenspun) More seriously something I've been pondering a lot recently watching the old pendulum swing back towards an enthusiasm for explicit typing is this: * The advantages of static type systems are obvious and easy to articulate. * The disadvantages of static type systems are subtle and difficult to argue. I started my career as a professional programmer when the pendulum was moving in the other direction. Essays by Paul Graham on Lisp and Python. The marvellous PJ Eby piece quoted above and Peter Norvig's "Design Patterns are artifacts of language flaws". I just feel dynamic languages fit my brain better but maybe that's my own form of Stockholm Syndrome. Maybe I need to try a decent type system rather than the brain-damaged descendents of Java...
- caioariede 9y agoPython is strongly typed, and Python 3 annotations with tools like MyPy brings static type checks.
- scrollaway 9y agoHave you used MyPy? I'm currently looking to adopt it, but the feedback I've been getting is that it's a lot more painful to use than Typescript (which imho sets the gold standard of "optional typing").
- joshuamorton 9y agoI haven't used typescript, but I have used MyPy (Or, more accurately, pytype), and its absolutely a joy to work with. I've also used closure (the JS type system that isn't TypeScript) and I prefer pytype, fwiw. My only complaint about Pytype is that there's no `Char` type at compile time (ie `for x in "a string"` -> Iterable[Char] instead of Iterable[str] during typechecking). But alas.
- mcypher 9y agoUnfortunately, MyPy doesn't work well with libraries or third party packages and treats external objects as `ANY` type. You can work around this with stubs but it's not fun writing type annotations for third party objects / functions. typeshed exists for the standard library and various popular third party libraries[1] to solve this very problem. [1] https://github.com/python/typeshed https://github.com/python/typeshed
- CraigJPerry 9y agoI used to think that but I can't recall the last time the compiler saved me when augmenting or refactoring someone else's code - the IDE beats it to the punch every time - and static typing is not substitute for a good test suite. On the flip side, i use interfaces and dependency injection constantly in java to work around static typing. In python, i write probably ~20% the amount of code because i never use interfaces, wiring logic or convert types.
- deepnotderp 9y agoTry Cython, the benefits of both, IMO.
- yesenadam 9y agoAt last! hehe I was wondering why no-one mentioned Cython. Did I miss the part where everyone learned why it's not a good idea? For me it's the best of both C and Python worlds. Write a Python program. Compile it as a Cython program. (Already faster, with no changes.) Add C types to the speed-critical parts. (Up to many 100s of times faster than Python)
- stestagg 9y agoLast time I saw the Bank of America python codebase, it had ~6 million lines of code, was worked on by about 4,000 developers, and ran some core, performance critical functionality. Python programming is an aesthetic that needs learning. Many of the worst written, and least maintainable python codebases I've seen are by programmers/teams coming from "proper" languages and don't think they have to learn how to write idiomatic python.
- deleted 9y ago[deleted]
- athena_dev 9y agoBzzzt - not really. Quartz in BoA, and Athena in JP Morgan (both built by the same folks) essentially takes Python, connects it to a bucketload of C++ and Java that makes up the bulk of the banks services, adds on a GUI layer, a pretty crappy object storage layer (shudders at Hydra...) and a half-baked object persistence layer that was always so slow. Sure, a lot of Python scripts get written for those platforms, but the heavy lifting -- pricing, trading, order books, risk systems, market data, connectivity all ends up being C++/Java, maybe in a Python overcoat.
- PhrosTT 9y agoWait that "Quartz" monstrosity is still around?
- rogerbinns 9y agoA bit dated now, but still a great read about a Python project done by Java developers: http://dirtsimple.org/2004/12/python-is-not-java.html http://dirtsimple.org/2004/12/python-is-not-java.html "So, the sad thing is that these poor folks worked much, much harder than they needed to, in order to produce much more code than they needed to write, that then performs much more slowly than the equivalent idiomatic Python would."
- paganel 9y ago> A bit dated now, but still a great read about a Python project done by Java developers: http://dirtsimple.org/2004/12/python-is-not-java.html http://dirtsimple.org/2004/12/python-is-not-java.html I included a link to this blog-post in the "letter of intent" (don't know the exact English term) that I sent to my potential employer just before my first interview for a professional (Python) programmer job, back in 2005. I got the job. Good times.
- bobwaycott 9y agoSitting on 90K lines of Python here. It’s a breeze. Rarely see an error, and when I do, it’s from a third-party API failing to do its job properly (which is then successfully caught to avoid it causing problems). I’m interested in and use other stacks (mostly Elixir), but I don’t have any complaints about the language itself after 10 years.
- davepeck 9y ago> strong, static typing is an essential feature for large scale projects This is empirically false. There are (of course!) good reasons to consider static typing. But, in my experience, use of static typing has never been a first-order predictor of business or technology success. It's quite possible to build considerable value with, for example, a large Python 2.x code base. A fun, and tangentially related, talk: https://www.destroyallsoftware.com/talks/ideology https://www.destroyallsoftware.com/talks/ideology
- woolvalley 9y agoAll of it is possible, but specific features help in making better software cost less in time and money. For example, nullability annotations reduce nil pointer exceptions. Static typing removes the need to make certain typing unit tests, makes refactors easier to do in large code bases, makes it easier for compilers to generate faster code and so on. Think of them as compiler level linters. Anyway, python has a static gradual typing mechanism. You should try it out :D
- twic 9y agoThat reminds me of Kapital [1] - a valuation and risk analysis system written in Smalltalk at JPMorgan, begun in the early '90s and as far as i know still going; 14,000 classes, 400,000 methods, hojillions of dollars of profit, twenty years in service, zero types: http://www.esug.org/data/ESUG2004/ValueOfSmalltalk.pdf http://www.esug.org/data/ESUG2004/ValueOfSmalltalk.pdf
- Koshkin 9y ago> 14,000 classes..., zero types In my view, classes are types. (Well, maybe I'm just spoiled by C++.)
- twic 9y agoIn C++, classes do indeed define types. Templated classes define whole families of types. But in Smalltalk, classes do not define types. I understand the word "type" to mean a property of a variable which restricts the range of values it can hold, and the set of methods which can be invoked on it. Smalltalk doesn't have any way to do either of those things, so it has no types.
- crimsonalucard 9y agoPeople will tell you that instagram uses python or yelp or other big name projects use python. Certainly, type checking is not Essential to a large project the same way utensils are not essential when you eat. You can just use your hands to shove all the food into your mouth.
- themoonbus 9y agoAs an Indian, I'm not sure what I'm supposed to make of your analogy...
- xapata 9y agoPerhaps you can infer that someone who thinks eating with their hands is uncivilized will have equally ignorant opinions about computing.
- crimsonalucard 9y agoAnd what you are inferring is incorrect. I never said eating with your hands is uncivilized. You inferred it in your request for someone else to infer something.
- xapata 9y agoOh, stop backtracking. If I were you, I'd take the metaphor further and explain why eating with utensils is more hygienic. Type safety, food safety, ... You could write some flavorful prose (ha!).
- Godel_unicode 9y agoWait, was the underlying message not supposed to be "everyone should conform to my world view"?
- crimsonalucard 9y agoThat was not the underlying message. The underlying message is: I have my world view, I am offering it, you can agree, disagree or conform. The choice is yours. I would never force anyone to conform. Where in my post did I say that?
- cm2187 9y agoI agree and I would add to that that many users of these scripting tools in Office are novice, and dynamic typing makes the language non self-discoverable. Static typing lets the IDE give a lot more feedback on invalid syntax, what can be done from there, etc. So I think this is a disservice we make them.
- jeremiep 9y agoSaying dynamic languages are for novices hints more at you being one than anything else. Not everyone likes IDEs (Emacs and VIM are still by far superior to many) and not everyone wants to deal with all the extra code and boilerplate and ad-hoc data classes that comes with static typing, to name a few. Dynamic languages have faster iteration times and from experience that can yield higher quality software. They're easier to fit in the functional paradigm, better to model data transformations, and a bunch of other goodies. You can't judge something without taking into account the context in which its used. And for scripting something like Excel dynamic is clearly superior.
- cm2187 9y agoI am not saying dynamic languages are for novice. I am saying people who will be using office's scripting are more often than not programming novices (like they are with VBA). You may like plain text editor but for someone who doesn't know how to program, typing a variable then dot, and having a drop down of what is available from there, with an embedded documentation and direct IDE feedback on what is correct or incorrect syntax immediately after typing every character is super useful. RTFM isn't novice friendly.
- jeremiep 9y agoSorry I misread your first comment. Its still possible for dynamic languages to have auto-completion. There's way more information available at runtime than at compile-time. Besides, IDEs tend to have the entire world in most autocompletions, which is not useful either. There would be no IDE here, you'll probably still write code from within Excel and advanced users will use separate source files to leverage their editor of choice. The novices you mention will not want to leave Excel. A dynamic runtime with reflection is all you need to give a friendly experience. That doesn't prevent type hints, inference or autocompletion.
- jeremiep 9y agoThis is to script spreadsheets, not build the next Netflix. I would hate a typed language in there. Besides most static typing systems are ridiculously weak and introduce more headaches than they actually solve.
- spraak 9y ago> Besides most static typing systems are ridiculously weak E.g. Go (and I still love Go, but it's pretty weak...)
- froindt 9y ago>This is to script spreadsheets, not build the next Netflix With some of the spreadsheets I've seen, the next Netflix might just come out of it. Just kidding, but only a bit. I've been at factories where if VBA stopped working, I literally don't know if we could have produced product that day.
- bogomipz 9y ago>"Python is great for scripting and for small projects but ..." You mean like Dropbox, Evernote, Ansible, OpenStack etc.
- jpetersonmn 9y agoOr Google...
- jjeaff 9y agoYou would actually be hard pressed to find ANY major codebase that isn't using at least one dynamically typed language in at least some significant capacity.
- ninjakeyboard 9y agoOr at least a compiler to catch foot shooting (I used to agree 100% but elixir sort of changed my mind)
- dragonwriter 9y ago> but I believe strong, static typing is an essential feature for large scale projects Python is strongly typed and has an available static typechecker, so, even if this is true, it doesn't rule out Python for this use case.
- Walkman 9y agoYou should have a little bit more experience with Python and you would see how huge systems can be written in it with no problem. It needs a bit more discipline, but above 100k lines software written in any other language would need the same discipline also. (I'm working with 100kloc codebase right now and seen almost 300kloc. That was messy because mostly juniors wrote it :D but still bearable and profitable.)
- deleted 9y ago[deleted]
- cgb223 9y agoI bet thats why so many AI, Backends, ML, and IoT projects are written in Python because it has no long term potential
- alexchantavy 9y agoYup, it teaches algorithms very effectively with low boilerplate; personally it's my favorite way of expressing dictionaries/hashtables and other data structures. Generators and iterators are super powerful concepts that I didn't learn in college and wish I did earlier. It also allows a developer to manipulate individual bits, which is pretty amazing for security research or other cases when you want to get low level but don't want to get in the weeds with C.
- sheetjs 9y agoIt's actually surprising the Excel team isn't considering TypeScript. TS is a modern language that they control, gives them an out for eventual browser compatibility, and they've already built great tooling (better than the visual studio tooling for python)
- bpicolo 9y ago> eventual browser compatibility You'd be hardpressed to reinvent excel in a browser. Sheets is a big, advanced web app but it doesn't even come close.
- deleted 9y ago[deleted]
- ultrasounder 9y agoWow!! Sheetjs looks cool! What kinds of math libraries do you support inlieu of Scipy /numpy. I am looking to mostly do some Exploratory Data Analysis
- willtim 9y agoPython is extremely permissive and flexible, even for a dynamic language - a trait that makes it easy to learn and easy to throw something together quickly. But when building software at scale, we need restrictions. For example: static types, immutability, pure functions, total functions, algebraic laws. It is restrictions such as these that give us the power to reason about code and the ability to compose it at scale. Beginner's do not understand how one can gain power from restriction. Skilled programmers do and most would not recommend Python for large-scale general purpose programming.
- VectorLock 9y agoI know plenty of skilled programmers who would recommend Python for projects at any scale, and just as many who do it every day. No true scottsman etc.
- HumanDrivenDev 9y agoIt's also a fantastic general purpose language. Why do you find it so fantastic? What stands out for you? Python was my first real programming language, but I don't see anything very attractive about it now - save the libraries.
- VectorLock 9y agoHonestly I can't imagine having to use anything else now. I look at every other language and it seems like a giant step back, syntactically.