It's a good repo, but remember a lot of those are "A Good Thing™".
The first snippet is a very good example:
a := "wtf_walrus"
doesn't work while:
(a := "wtf_walrus")
works.
It's a fantastic design decision.
Python took a long time before getting this operator, because it's a language that favors being readable, easy to use, and above all, to learn.
But in many other languages, the very same operator is often misused as, or confused for, the operator for equality or assignation.
We, as a community, didn't want people to wonder why there are several ways to do assignation (we have this problem with string templating already). Instead, we wanted to be sure that people could ignore the existence of ":=" for some times during their learning process.
And so the decision has been taken to make is very easy to distinguish it from "=" and "==", forcing parenthesis when necessary to make it clear this is a completely different use case. Also to hint people at using it only when necessary.
If you like scripting in Python because it's so easy to go from an idea to code, it's not random luck. It's because the language is a collections of thousands of such decisions.
Why should people only use it when necessary? Why not say “the walrus operator is the exact same as the assignment operator, but it can be used in expressions and thus is spelled a bit differently in order to better distinguish it from the equality operator. Feel free to use it in all places you’d previously use the assignment operator.”. Simple, easy to understand, easy to learn, and most importantly (though python folks might disagree, given 2 => 3), easy to adopt. (Find and replace all single equals with colon equals and you’re done).
Instead, they’ve chosen the narrative: “the walrus operator is a lot like the assignment operator, but it is able to be used in expressions, cannot be used as a statement, and it sits below the comma operator in precedence instead of above it. We understand that this is super confusing, so use it sparingly”.
One way you have two operators for people to learn, with the understanding that there is a third legacy operator that works pretty much the same as one of them. The way they chose you have three operators for people to learn, with two of them behaving pretty similarly but not interchangeably, and with subtle yet important differences.
Because we have experience with things such as easy of learning, cognitive load, writing simple to read code, making it hard to introduce bugs...
This comment show how little experience one can have with it, and yet make a quick judgment to offer to "fix" things. E.G:
> eel free to use it in all places you’d previously use the assignment operator.”. Simple, easy to understand, easy to learn, and most importantly (though python folks might disagree, given 2 => 3), easy to adopt.
Well because in many languages, people do this:
while (foo = bar):
While they mean this:
while (foo == bar):
Even experienced devs do this by mistake from time to time. It's hard for tooling to find out if you are doing something stupid or smart. Beside, you don't use tooling when you learn the language or do a quick script.
Designing a language is not a 15 days job in a rush. Usually.
I don’t think you’ve actually understood my proposal, and the snide remarks about completely unrelated languages don’t help your argument.
To reiterate, my proposal is that the walrus operator has the exact same semantics as the assignment operator, but creates an expression rather than a statement. A linter rule could then be added prohibits the assignment operator, and converts all instances of it to the walrus operator. The codebase now has only the two operators. Language reference books need only explain the two operators, and simply note that the legacy assignment operator behaves the same as the walrus operator but cannot be used in expressions. This is easy to learn.
What the language creators have done instead is add a whole new operator with all new semantics, leading to all new sources of confusion. (See TFA). This is not easy to learn.
Side note: It’s funny that you appeal to the authority of the language creators with phrases like: Python is easy because “the language is a collections of thousands of such decisions”, yet ignore the fact that the actual creator of the language was so against the addition of this operator that he saw the community’s insistence on it as reason to step down as BDFL.
> and the snide remarks about completely unrelated languages don’t help your argument.
Granted, I apologize. It was childish.
> but creates an expression rather than a statement.
Expressions are limited in Python for the same reasons. It's the same rational that got us tone done lambdas. People code with a certain style using it, which is not the style we want to promote for Python.
> A linter rule could then be added prohibits the assignment operator, and converts all instances of it to the walrus operator.
Every time you delegate something to a linter, you fail. A good language must be a good language without 3rd party tooling. Tooling should only be a bonus. This is why we have forced indentation in Python. This is why we have namespaces and don't rely on a bundler.
> What the language creators have done instead is add a whole new operator with all new semantics, leading to all new sources of confusion. (See TFA). This is not easy to learn.
You don't learn this operator when you learn Python. Just like people don't learn about list comprehensions at first, don't use yield and code without creating a decorators for years.
Python scales down: you are productive with it without all its features. It is designed to be partially learned and still be useful. Thousands of Python devs are not coders, but scientists, geographers, finance people, etc. They know very little Python and yet, can work all day with it.
Walrus is made so that it doesn't interfere with the original design. It's something separate that you get to later.
> yet ignore the fact that the actual creator of the language was so against the addition of this operator that he saw the community’s insistence on it as reason to step down as BDFL.
That's not what happened. The bad quality of the debate is what made Guido step down. We had a huge number of new comers in the later years because of Python popularity. These people didn't learn internet from the age of mailing list, IRC, etc. They addressed the topic like others talk on Twitter: lot of noise, little content. I understand that after 30 years of doing what is basically free awesome work for thousands of people, he didn't feel like being disrespected by a horde of juniors that though they knew better.
> yet ignore the fact that the actual creator of the language was so against the addition of this operator that he saw the community’s insistence on it as reason to step down as BDFL.
Regarding this part, Guido specifically addressed the toxic debate as the reason for stepping down as BDFL, and not the operator per se.
(Yes, I'm reinforcing BiteCode_dev's reply on this point)
This isn’t delegating anything to the linter, it’s saying that a linter rule would help some people enforce particular styles (only walrus), if that’s what they want. I.e. the point of a linter.
> the actual creator of the language was so against the addition of this operator that he saw the community’s insistence on it as reason to step down as BDFL.
That's backwards. The community was generally opposed to the walrus operator, and Guido stepped down because of (among other things) the community's reaction when he insisted on adding it.
I'm on Guidos side. When it's well used, it's a good thing -- problem is getting people to use it right. But the fact that many people didn't consider the use cases that were being proposed, immediately took strong and toxic positions about it, and were more interested in calling names rather than having a civilized discussion is what wore down the (then) BDFL and caused him to step down.
As a relative newcomer to Python (compared to most, but I do use it professionally every working day for a year, and some non-working days for personal stuff), I find this to be the case. At work I have to use Django, and it's almost a chore to find anything explicit or obvious in it. Its level of abstraction is "Too Damn High" as the meme goes, IMO.
It feels like saving boilerplate for the sake of it which just makes obvious, readable code into magic incantations where shit happens and you don't know why or how or where to look.
This is the danger with high level frameworks, everything is abstracted away, and with a dynamic language like python the black magic can go very deep.
If you've ever taken a look at something like Flask or Cherrypi, the difference is very apparent.
That said, I've been doing some Rails lately, after years of Django, and I'm finding the experience to be worse from a readability point of view. Metaprogramming everywhere, modifications of language constructs ... It gets very confusing very quickly. Could be simply a lack of experience of course.
In parallel, I've also been using Go and the experience could not be any different. So much easier to understand what is going on, but so much boilerplate code!
It doesn't look like it's possible to have both ease of use and explicitness...
Thanks; I've glanced at Flask and it makes a lot more sense to me, but this is a project of immense size and age, and not under my control, so I just have to live with it. Overabstraction for the sake of it seems to be Django's mantra. Then there's Django Rest Framework, and the 3-4 different filtering mechanisms.
> there should be one-- and preferably only one --obvious way to do it.
Yes, this has been one of the hardest balance to find. And believe me when I tell you the community tries very, very hard. But it's a difficult problem: making the language evolves fast enough, but keeping it solid and stable. Very difficult indeed.
> Python became a language that can be really hard to read now.
Not in my experience.
My job involve going a lot from company to company. I see a lot of code, from a lot of different people.
The way people write Python hasn't change much during the last 15 years.
In fact, I'd say because of Python 3, there is less cruft all in all.
You do have a few heavy stuff. E.G: asyncio or the type hints. But how many code out there uses that ? Very little. Mostly, the code that needs it.
The new walrus operator now makes indentation obsolete. You can write averything within one line as an array and it is hard to read. This in combination with syntactic sugar, operator overloading and unicode variables can make the language very hard to read.
e.g.
# compute pi
1000000 >> ψ( ψ(χ>>op("(x**2+y**2)**0.5<1")@rlµ<<χ)>>Σ*4>> _/_)
or this:
# 10 fibonacci numbers
[x:=[1,1]] + [x := [x[1], sum(x)] for i in range(10)]
is valid python code. (for the first see my github jamitzky/iverson).
Not that I wouldnt like it, but python3 has changed and the zen of python is not valid for some time now.
As for the unicode caracters as variables... Remember you could do that in Python 2 ?
# -*- coding: rot13 -*-
cevag "Relax"
But people don't do it. Just like they don't use "import *" everywhere, or monkey patch methods like it's going out of style the way Ruby loved it 15 years ago.
Because such capabilities are restricted (one line lambda, parenthesis for walrus, not all unicode is allowed as var names or everywhere...), introduced slowly, and the community culture is to value readability, Python stays Python.
I was against the walrus personally, for the reasons you mention. But while I do see Raymond Hettinger trolling twitter regularly with his latest crazy walrus magic, in production we see no such thing.
Not to say it never happens. It does, I've seen monstrosities in the field. Like with every tech. I mean, you can start a fire with a water hose if you try hard enough.
I think Python’s direction changed when Guido moved to Dropbox. Suddenly he was working on a million-line Python codebase, and started working to make the language more suitable for programming in the large.
I understand why people are willing to defend it or make apologies for it, but there really are some lessons to be learned from the mistakes it made, and dismissing legitimate criticism just ignores the opportunity.
I agree, there is a long list of things I would change in Python. And believe me when I say people involved in the community listen to this very carefully.
This is why we had Python 3 in the first place. Because text handling was such a cause of pain.
This is why we have type hints in the first place. Because big projects using Python felt let down.
And Python 3 and type hints are also a huge source of criticism (I was the first one to do so).
It's never ending. People will complain. People will be unhappy. Things, also, will be imperfect, as we are limited in resources and are submitted to many constraints. Not to mention taste and opinion, that are used to request changes.
But I'm not answering to dismiss valid concerns. I'm answering because as a very experienced Python dev, I now have a good grasp of what is due to culture, lack of experience, or a real deal.
E.G:
- := forcing parenthesis. Has not been a real problem in my experience, at least as of today.
I suspect it's healthier to judge a few misfeatures in a programming language than to judge all developers, or people as a whole. I'm really very optimistic about the future of humanity, but less so about the future of Python :-)
I bet neither will go down, but the human race will improve! Seriously, things are getting better - it's just that paying attention to what needs fixing is how engineers contribute to the progress.
Despite what many apparently think, this line very specifically does not say "there should be one way to do it", it is much more restrictive.
And as far as I'm concerned, the walrus operator breaks it in no way whatsoever: an assignment statement is the one obvious way to perform an assignment, and it's a syntax error to use a walrus as an assignment statement.
The many, many ways to print variables inside of a string are testament to that. I remember feeling kind of a chill when the number of methods hit three. Two is an acceptable number of methods if you are transitioning from one form to another as kind of a nod to the growing pains of a language, but at three you have hit some kind of watershed.
1. manual string concatenation
2. the old, printf-style. Still heavily used in e.g. stdlib logging module.
3. .format()
4. f-strings
5. string.Template in the stdlib
Yup, I definitely see this as one of the bigger failures in Python's design.
It's a problem, but not a failure in design. The language is old. It started with features from that times and evolved to add more modern ones. Removing the old ones would break the world. Why do you thing you can still use == and declare vars without keywords in JS ?
Even in the p3 transition, the community screamed to not remove them. Did you know we removed % for a few versiond ? We had to put it back because of all the complaints.
in practice it's 3. and 4. though. we outright ban 2. through a linter. it not only looks ugly, but is inconsistent. e.g. it has the tuple pitfall with a (language?) hack to make it work with one variable. even for logging, it's possible to use the `.format` style - although this isn't default. i've never seen `string.Template` actually used, except for niche use-cases with untrusted input, where a full-blown templating engine was overkill.
> The very same operator is often misused as, or confused for, the operator for equality or assignation.
It will still be confused, I'm afraid. It's just a little less likely that that confusion will be silently accepted by the interpreter.
> Also to hint people at using it only when necessary.
Let's be clear: the walrus operator was never, ever, necessary. It's syntactic sugar to avoid extra lines of code. The hope is that it will be convenient and obvious enough that folks will prefer it to both extra lines of code and repeated sub-expressions, but the very advice that beginners ought to "ignore the existence of := for some time" (_plus_ the intentional deviation from other languages) suggests that this is not going to be nearly as obvious or convenient as its proponents might have wished.
Did you get far past the first example? Because a lot of these seem just plain unacceptable..
How about this from the second example:
>>> a, b = "wtf!", "wtf!"
>>> a is b # All versions except 3.7.x
True
>>> a = "wtf!"; b = "wtf!"
>>> a is b # This will print True or False depending on where you're invoking it (python shell / ipython / as a script)
False
Or this from further down
>>> a = 256
>>> b = 256
>>> a is b
True
>>> a = 257
>>> b = 257
>>> a is b
False
I agree. I wonder how confusing it would be to make `is` not allowed on integers or strings. Or define it to be equivalent to `==` for those types. Using `is` in these situations is almost always a big, if for whatever reason you really need it you can do `objectid(x) == objectid(y)` which is usefully explicitly.
I thought this walrus thing looked esoteric and ridiculous. Two words which also describe Python. I think it's prime time for the scripting languages to be disrupted. Twould be nice to have one as well designed and consistent as Rust.
I agree totally with that, it's an ugly trap in python, although mitigated by the fact the language doesn't encourage this kind of paradigm so you rarely encounter it.
But more absurd than creating a global variable if you forget "var/let/const" ? More absurd than "this" being schizophrenic ? More absurd than having no namespace for 20 years ?
In my opinion, if standard tooling is able to identify the foot-gun, it’s not too terrible of a foot-gun. I don’t think standard python tooling would catch the above issues, but standard JS tooling would identify a missing variable declaration. As for the other things you mention (this, namespaces), I never said JS was perfect! Just that JS got a lot of shit for its scoping, fixed the problem, and now has sane scopes. Py has scoping with a lot of the same problems JS used to have, but for some reason didn’t fix them, and thus to this day is riddled with these foot-guns.
> I don’t think standard python tooling would catch the above issues,
Of course it does.
$ echo "
> powers_of_x = [lambda x: x^i for i in range(10)]
> [f(2) for f in powers_of_x]
> " > test.py
$ pylint test.py
...
test.py:2:27: W0640: Cell variable i defined in loop (cell-var-from-loop)
...
Pylint is the most powerful linter for Python is well integrated in VSCode or PyCharm.
When concerns are raised about JS, people are quick to answer you are not supposed to use it without modern tooling (Webpack + babel + typescript + eslint + lowdash...), although many devs still do.
Now, I use and teach a lot of JS, and I enjoy many of its modern features. I especially like the object destructuring, it's even better than Python's unpacking.
But objectively, you can get a very decent experience in Python without any kind of tooling. And yet, there is a lot of it if you want to up your game: pylint, black, mypy, jedi, pytest, poetry, etc.
Are they really foot-guns? The lambda variable reference thing has appeared more in forums comparing languages than I’ve seen it used at all in python and I’ve spent a lot of time working in large open source python projects with thousands of contributors.
Even if you got the binding right, your powers of 2 would be shot down for being unpythonic anyway due to lambdas being shunned when there are cleaner ways to write things.
powers_of_x makes no sense as a variable name for a list of functions that you have to call in order with the same number to actually get the powers of that number. I get that it’s just a contrived example, but most can be turned into someone more apparent to the reader.
def powers_of_x(x, limit=10):
for i in range(limit):
yield x^i
Less memory, no anonymous functions, more flexibility, testable...
Modules avoid the variable issue because ‘use strict’ is applied by default for them.
IMO JS as a language is in a much better place than Python currently. I end up frustrated a fair amount by arcane errors in Python due to less expressive constructs or some wtf issues like unexpected variable scoping within Python modules.
But even without that, I'm not saying they are comparable. I'm saying the same API will use explicit anonymous callbacks in JS and something else in Python (decorators, subclassing, protocols, generators...). I'm saying that the same API will use __iter__ in Python and something else in JS (type conversion, proxy object, explicit method call...).
E.G, this is a Python pattern you'll find in contextlib or in pytest fixtures:
@somekindofregistration
def foo():
print('code that runs before')
try:
yield
except Stuff:
print('Error handling')
print('code that runs after')
This uses Python iteration mechanism to run code at 3 different times in a life cycle.
Map, filter, and fold are higher order functions, functions which take functions as parameters.
You are misusing the word callback. A callback is a function passed to another thread that will maybe be invoked later as a response (like it calls you back).
In contrast, Lodash goes out of its way not to use the term "callback", presumably to avoid confusion since it's a place where many functions-that-take-a-function-argument do not call the provided function, e.g. https://lodash.com/docs/#curry
Unfortunately, this is not true. Although the equality operators are a favorite bikeshedding topic, the largest source of errors in JS code bases are type errors. Using a "non-sane" equality check, such as those with type coercion would actually mask or alleviate these source of bugs you mention.
I was thinking more of the case where the types match but objects and arrays with the same contents are considered different. I’ve watched every member of my team get stung by it again and again - and then have to create workarounds to get past it.
I don’t agree and this behavior shouldn’t be surprising. The alternative would be to walk the container and compare the value of each element, which could be horrible.
It's very explicit, practical, and you can set the scale of practicality vs performances where you want. Plus: no implicit weird type conversion, only one equality comparison operator, and no hidden rules.
I’m not sure if you’re for or against here. Walking the container is exactly what you have to do, and it is horrible. More importantly, if it’s not your library, you don’t get any choice on how the equality check is implemented.
> I agree totally with that, it's an ugly trap in python, although mitigated by the fact the language doesn't encourage this kind of paradigm so you rarely encounter it.
This. I've made this mistake exactly once in the last 7 years, but that one time almost caused a security issue.
Yegor has direct and extensive responses to each of your points, and many more. Not that he is always correct, but he never avoids the questions you raise, and is happy to engage in discussions. Since he himself ran a development shop in Ukraine for many years, he is pulling back the curtain and sharing tips to stabilize a difficult process, especially for non-technical customers. He even has his money where his mouth is, with patents and a startup implementing many of the principles he lays out in a scalable system called Zerocracy[0].
And just as a counterpoint to your $10k customer needing to choose between things, there are hundreds and hundreds of customers who lose every penny of their $10k and start over from scratch. (That is what is in the podcast episode, if you have yet to listen.) By imposing the extra process and expense at the beginning, the customer can guarantee some forward progress toward their goal instead of trusting the dev shop to deliver everything by the end in a big bang delivery.
On the "one click build process", I recall once talking with a friend of mine who worked on a fairly large Java project back when Java was first developed. There was no build system that was associated with Java and for reasons that I don't quite understand the development team were very unhappy using proven solutions like make. So they had this very fragile set of scripts for building the application. After about 2 years (!!) of development, the startup ran out of cash and they were rather desperate to ship a product. It actually worked quite well. The only problem? Nobody could build the whole thing and make a single image! The company exceeded their runway before anyone could figure out how to ship. It's stupid, but it happens. Whenever I start a project I remember this and consider that that absolute top priority of any project is to be able to ship. You should do that first. (As an aside, it's pretty weird that your first story is often to ship nothing).
I think if you have a $10K project and you know that you are going to be really, really tight on resources, you don't skimp on the build process. Rather you back up and choose tools that are proven and reliable. If you can't get your 1 click (or equivalent) build process up an running in a day for a $10K project, then you have selected tools that are much too risky. That's my 2 cents, anyway.
Another advantage of a "one click" build process is that it documents, perfectly, the product. What lives where, maps to what and how, how each element is configured, etc. That "one click" is your way into the whole project.
It depends a lot of you size and your project scale. But here are a few advices.
Do not pay by day/hour if you can avoid it.
Define small deliverables then objective tests to validate them and attach fixed price to each piece.
You don't have to come up with it out of thin air, the contractor is supposed to do that with you.
You don't have to define all of them up front neither. In fact, they will probably change during the project and the contractor will adjust the price knowing better about the project after the first few deliveries.
Do not let the definition of success be blurry. But don't set everything in stone.
Do include a clause about the code license.
If you have zero IT skill, get the help of somebody who does to do so, as well as set your expectations and filter the contractors. Sometimes it's best to hire a contractor... to hire a contractor. I know, I know.
In my book, a good contractor will:
- not sell you the moon, but will tell you what's possible, what's not given your constraints, and the relative cost of it. I regularly tell my customers to chose a better, cheaper solution than hiring me.
- help you set a priority list rather than a schedule. I'm not an oracle, I can't give you an exact delivery date for each component. But I will make sure we get them in the most valuable order.
- not give you answers right away, especially deadline and price. I can take several (sometimes billable) hours up to several days with a customer to understand the project and assess this.
- will tell you honestly "I don't know", "I will have to look it up", "It's not in my skill set, I'll need the help of X". I may tell a customer I'll need a designer, and a week to research a topic before starting to code.
- communicate clearly. Bad communication is a red flag. There are very good coders that are bad at communicating. As a contractor I don't just code, I extract your needs, wants and constraints to adjust the work regularly. This is what "agile" mean. Not tooling, scrum, or other gimmick. Regular proper communication, and adjustments.
- will not talk about good and bad, but cost/benefit ratio. You can request everything you want, the question is can I build it under your conditions.
- will talk about his preferences and specializations and advocate them when relevant. But will understand if a different technology is needed for the job. I love Python, and will advise you to use it. I don't like JS. I will code in clean proper JS for a Web UI.
- will be honest about their needs: schedules, payment, communication, ethics, channels or technology use. E.G: I don't do military/banking related contracts and refuse missions that use some languages such as Lisp, Haskell or PHP. You have the right to want them, there are other contractors that will do it for you just fine.
- not be cheap. Well, just like with lottery, you may be incredibly lucky. But I would not base my life choices on such hopes. I'm often booked for months in advance and know the market prices I can expect. I won't bother negotiating.
- will be interested in your project itself. Even when I don't work on something, I'm always happy to hear about what the project became 6 months later. I like my job.
You are not committed to anything until you sign something. So go shopping. Change your mind. We are used to talk to many customers, and only land a few jobs. That's also why we are expensive: we include that in the price tag.
I'm a student trying to get my first contracting job. I have very little experience, and and essentially no past work. I believe I'm competent enough to do some of the tasks I see on sites like Upwork, but I'm not having any luck. The jobs I'm applying for are basic things like write Google Apps script to send emails based on contents of a Google Sheet, not large projects.
I'm not going to lie about who I am and what experience I have. Do you think I have no chance getting a contract at this point?
Don't start your career as a contractor. Find a job first, even part time, if you can. Few people can get away with zero structure to shape them first.
Interesting. I've got a monthlong holiday break and want to get some work experience in it. My expectation is that no one will want to go through the effort of hiring me for that. I don't need the money right now, I'm trying to create a history of having reliably done something for money that I can point to in the future.
For example, a project I bid on was offering $200 to implement an email signature with two columns and basic styling from an image spec. Since it looked trivial and interesting I spent two hours learning a DSL for emails (MJML) and making it and then submitted a bid with screenshots of it in a few email clients.
I'm not trying to get a job creating something of significant scale or significant duration right now.
Your first few projects are essentially to build credibility. Don’t try to make money. You are trying to level up. Think of it like playing an RPG. You start with easy quests designed for newbies with no experience and eventually unlock treasure.
What can you do that takes you no time and is in demand? I figured out how to something that takes 4 hours in 15 minutes and charge flat rate for it based on the original 4 hours. There is a handful of annoying errors other techs make that I instantly fix without sharing my secrets. ;)
Context: I have first refusal rights in my territory as a field tech on another site. I bill $5000+/mo in gross receivables. It didn’t happen overnight. I started by doing a few unprofitable tasks.
Got it. Most of the projects I've seen are by people who want to bill hourly. Upwork provides some sort of "recommended" wage. How much would you discount that by? I'm afraid that if I'm too cheap even people looking for minimally skilled cheap coders won't want to hire me. Also, so far I'm zero replies for two proposals (a few hundred words each, not copy-pasted). Roughly what should I expect?
> No developer of any worth will give you turn-key offer for a non-trivial project.
Yes, I'm actually saying exactly that in:
> [a good contractor will] not give you answers right away, especially deadline and price. I can take several (sometimes billable) hours up to several days with a customer to understand the project and assess this.
How do you persuade a good contractor to take the several days to assess the project if you seem like you want to avoid paying an hourly or daily rate?
I usually spend an hour or two for free with the client, unless I feel they are not serious about it. If I assess studing the project will take more time, I give them a flat rate for it. It's my job to assess how long it will take, then use my daily rate to give the total.
I always include an escape clause in the contract in case they forgot to mention something very important that change drastically the price.
I also never quote the entire project, only the first deliverables. Then roll incrementally from that.
Most contractors around me are well paid, it's not a big deal to not be accurate at the begining. We adjust on the way.
The ideal situation is to pair each apprentice with an experienced dev, with a fixed time allocated every day to help them.
Yes, it's costly. Yes, the experienced dev needs to be ok with it.
Then you find small tasks you know people can google their way around and that you know won't lead to a disaster if they are done badly or if something break.
Then you increment.
Apprentices are very slow and very demanding at the beginning. Once they are productive though, they have the best cost/benefit ratio of your company, provided you did the first steps well.
Source: been an apprentice for 5 years, and all my classmates were.
The missing piece seems to be some way to ensure the apprentice sticks around once they become valuable. If they are immediately poached with a high salary you can't afford to pay, you get nothing for your troubles of teaching them.
Apprentices can be profitable. I was one and later had access to invoices we sent.
Ok that company did some ... creative ... billing.
But even without that I believe it's not too hard to break at least even.
Doing low-priority work, stuff at the bottom of the backlog is im my exerience totally possible fairly quickly, billable and can offset the senior time used because code reviews require more feedback and some general guidance usually.
Apprenticeships here have a fixed government set duration if you want your degree. And it's difficult to change companies. The durations are set in a way it's profitable to take apprentices. During the last year they're usually as productive as any junior dev, at a pocket change salary.
The obvious solution to this would be to charge them for the apprenticeship, financing it yourself with a loan from master to apprentice (which then immediately goes back to the master as "tuition"). If they are immediately poached at a high salary, they'll have to pay back the loan.
The traditional solution, enslavement, has a bad reputation today.
I think the sticking point is finding small tasks that are meaningful. You can generate that sort of thing for someone doing a 2 week placement, but I think it'll be tricky for much more than that given the nature of the work we have available.
Did you have any structure to your learning to ensure you covered basic topics, e.g. OO, data structures, algorithms, etc?
No my internship was more of a learn or die type of thing. But the dev in charge of me, although he sucked at teaching me, was very tolerant of my mistakes, even grave ones. He gave me important tasks, and would shield me from the heat from management when I messed up. So I learned from copying his talented but cryptic work using trials and errors.
I kept at it because, although he kept being very rude (he was so with everybody), he made sure I was part of the team from day one. When we had lunch and I had no money, he always paid for me so I could eat with everybody at the restaurant. When we had extra pay for being on call during nights and week end, he included me in the rotation, despite perfectly knowing I would just wake him up to solve the problem as soon as the phone rang.
We are still friends to this day, and I came back working with him several times after my internship.
It depends of how the company behaves. It's no different than with any other employees.
Give people the feeling they are part of something, that their day to day actions have a meaning, and enough money for their trouble, and they'll stay.
Say "we are a family" in your speeches and write "values" on the walls while you are just fitting cogs in the machine while optimizing for numbers and they will leave, or do the bare minimum they can if they need the cash.
This is not something you can fake. Not for long at least.
So it's not related to apprentices.
However, apprentices will more likely fit in your culture, accept changes, etc. Because they grow with you.
I'd say there's 2 main groups of people - those that have been there 20+ years and aren't likely to leave and those under 30 that started as grads or interns and have been there a few years. I don't consider myself particularly loyal, I just happen to like the work and team I'm on and if that stops being true I look elsewhere.
Not at all. The bit about how when you strip a bolt it becomes your whole project and how you then need to pause and think through all the options before you before proceeding I am sure saved countless hours and dollars to a lot of people. The bit about really understanding how the thing works before attempting to repair it is great. And the part about the grill assembly manual makes a lot of sense and is very real world applicable. It’s true that this book won’t teach you how to rebuild a carburetor or adjust valve clearances, but it will give you a good outlook on performing those tasks.
> The bit about how when you strip a bolt it becomes your whole project and how you then need to pause and think through all the options before you before proceeding I am sure saved countless hours and dollars to a lot of people.
The bolt here is just used as an analogy for how to address problems in life, balance importance you give to micro vs macro, the beauty and danger that scales up and down in anything, etc.
Sure, it's a smart one, actually useful if taken literally as well, because the writer is very talented.
> The bit about really understanding how the thing works before attempting to repair it is great.
Again, another analogy. The whole book is teaching you how to think. And then go beyond thinking, as an art of living.
Every page is a personal, human lesson. You can stop at the mechanical aspect of it, but it is missing why this is a fantastic writing. It's giving profound advises using a simple, down to earth, vocabulary.
I could have done so with any other gimmick. Just like star wars could have replaced light sabers with something else. It just became an iconic symbol because it's so obviously recognizable and easy to grab.
But of course, they are also good because they chose such an symbology to make it easy to refer to.
You know where you were in class, and the teachers analyzed a book and you though in your head, BS! ZAMM is an exception to that. It is, really, a conscious and deep work of teaching that goes several levels down.
Yes they are all analogies and metaphors, I don’t dispute that. My point is that even so they are very applicable to the kind of problem solving you might do when actually maintaining a motorcycle. It didn’t teach me to fix stuck bolts, I learned that later. But everything I do with any kind of construction or maintenance is in fact influenced by the philosophy of this book. By contrast, I rarely think of Star Wars or Dune or Of Mice and Men when problem solving, especially problem solving that involves tools.
The first snippet is a very good example:
doesn't work while: works.It's a fantastic design decision.
Python took a long time before getting this operator, because it's a language that favors being readable, easy to use, and above all, to learn.
But in many other languages, the very same operator is often misused as, or confused for, the operator for equality or assignation.
We, as a community, didn't want people to wonder why there are several ways to do assignation (we have this problem with string templating already). Instead, we wanted to be sure that people could ignore the existence of ":=" for some times during their learning process.
And so the decision has been taken to make is very easy to distinguish it from "=" and "==", forcing parenthesis when necessary to make it clear this is a completely different use case. Also to hint people at using it only when necessary.
If you like scripting in Python because it's so easy to go from an idea to code, it's not random luck. It's because the language is a collections of thousands of such decisions.