|
It is just a neat shorthand, and normal loops are still better in some cases.
|
|
|
|
|
In addition to what Richard said, they're useful for side-effect-less list creation for simple lists.
list = []
for x in range(20):
list.append(x * 2)
vs
list = [x * 2 for x in range(20)]
That's my understanding at least. I don't really use Python.
|
|
|
|
|
Yep - basically whenever I need to populate a list.
|
|
|
|
|
Why a list comprehension and not a typical loop? Doesn't it make it harder to maintain?
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
More concise.
Cheers,
Vikram.
|
|
|
|
|
Easier, more readable, less prone to bugs...
|
|
|
|
|
I assume everyone has played with let me google that for you. If not google it. HAHAHA
But anyway. I was looking thru the questions in the programming areas and let me just say 2 things.
1. WOW - people are stupid and want others to do their work.
2. WOW - people here on CP are amazingly patient.
I am making a suggestion that everyone should just respond with a 'let me google that for you' link.
for example a question in one forum about room size calculations. respond with this link.
LMGTFY - Let Me Google That For You[^]
This teaches them to use the Googlies the way they were meant to be used.
To err is human to really elephant it up you need a computer
|
|
|
|
|
People knock it, but as much as half of my coding is googling sometimes.
Using google well is an acquired skill.
Being able to code from example is as well.
Contrary to popular belief, you can create good code by using google to find examples. You just have to evaluate whatever it comes up with, which requires actual programming skills.
Maybe it would benefit these people to brush up on their search-fu.
Real programmers use butterflies
|
|
|
|
|
I can't agree enough on this. Anyone can go to Google, but not everyone can figure out what keywords to use, or how to filter through the good results from the krappy ones. From there, you still need to figure out how to apply what you found to your own situation. Not everyone is able to do that. Even after Google, they will still need help.
To this day, the best compliment I have ever received in my career came back when I was in my twenties, and trying to break out of the low level job market. I sat next to another applicant waiting for my interview, and got a peek at his resume. This guy had the education and the experience to outdo me 10x over, but I was the one offered the job. When I asked my new manager how I got picked over the other guy, he gave me the perfect answer. "He knows everything we need him to know, and can do everything we need him to be able to do ... now. In the future, if there are any new changes, he will be stuck. You, on the other hand, only know half of what we need. But if something is needed, you'll know how to find out." Thirty years later in my career, and I still consider that the best thing anyone has said to me professionally.
I've been the guy struggling to figure something out, without having anyone there to help me out. I didn't like it.
I've seen people struggling to figure something out. If I am able to give a clue or a hint, I'm not going to leave them hanging.
In my opinion, (please note that this statement is not directed at anyone in particular) "just Google it" or "RTFM" are answers given by people who should not have bothered to post an answer to begin with, since as answers go, they are less helpful than not answering at all.
Money makes the world go round ... but documentation moves the money.
|
|
|
|
|
willichan wrote: In my opinion, (please note that this statement is not directed at anyone in particular) "just Google it" or "RTFM" are answers given by people who should not have bothered to post an answer to begin with, since as answers go, they are less helpful than not answering at all.
I completely agree with this statement! All that that type of response does is clutter the landscape for future users with the same question.
If a Google search reveals to you a solution that is more clear than you could be to answer the question, then give a link to the article preferably with a quick synapsis. Just because your "search-fu" can find the article doesn't mean the questioner would be able to do the same.
A few years back I had googled unsuccessfully for quite some time on how to do some DB operation. I finally asked a colleague if she knew and she said she didn't but let's google it. She typed in a search phrase much like many I had made but used a couple synonyms I hadn't thought to try. The exact answer I was looking for was the 2nd or 3rd link in the results. I not only learned the answer but also gained a better understanding in searching. In this case this was a personal interaction but the same info as a post would have been just as welcome. Whereas sending me back to more incessant googling on my own would have been the epitome of frustrating.
|
|
|
|
|
If you do, be prepared for Chris to punch you[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I think it would be a bad reputation for the CP website if 50% of the answers were "use Google or Bing for a websearch" ...
And who is stupid - the persons who let others to do the work for them or those who really do that work?
|
|
|
|
|
Jo_vb.net wrote: I think it would be a bad reputation for the CP website if 50% of the answers were "use Google or Bing for a websearch" ...
I mean, why reinventing SO?
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Google is useless if there is not prior knowledge of the subject. Asking a 'human' is the best lazy way to get information without putting in the work.
I wonder if my 7 years stint as a programmer with no Internet access (only MSDN) have something to do with me using Google as a last resort (well, after that usually comes customer support or CP).
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Back when there was comprehensive documentation, not just lists of topics on websites.
Basically, you had Reference and Guide, and they were discrete.
You also had to ship your product on floppy disks! 😊
I still remember that we had multiple stacks of 5.25 in floppy disks to the ceiling after some Microsoft major prerelease programs.
|
|
|
|
|
I have never been a big fan of code project members coming to the Lounge to complain about other "stupid" members and their QA or programming questions. I think it is extremely unprofessional, to say the least.
|
|
|
|
|
Sometimes it is warranted, but very rarely IMHO.
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
That, and "answers" that barely qualify as comments.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I agree with you. Being sarcastic is just plain rude.
A reply like " I am not sure. maybe you should go to Google or Stack Overflow and see if you can find the answer there." Particularly if the person asking the question, is doing that frequently.
ed
|
|
|
|
|
you can just ignore those questions.
Or be a good person and make it a learning experience for them by helping them either pointing them to a good answer or suggesting solutions for their questions.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
If someone in meatscape asks for your help with a problem, do you then usually cut them off with "Go and fix the problem yourself - I won't help you!"?
Most times, when someone asks for help with a problem, the problem can be solved, given the right competence or knowledge. The "stupid" person asking for help doesn't possess that competence / knowledge; that is why he asks.
If you seriously think that any questions asked for lack of knowledge deserves to be rejected, then you reject to help with any solvable problem. The only "help" you are willing to give is to state that the problem is unsolvable.
Many times I have given up after hours of unsuccessful googling, asking people for help. I have so many times been met with "LMGTFY" that I have made it a habit to include in my question the terms I have tried googling. Yet, I have had people reply "You're just a silly fool - why didn't you google 'xyzzy' or 'abcde'??
Actually, one of the best ways of asking, if you don't want to be called a fool / idiot for googling the wrong terms, is to not ask for a solution, not tell what you have tried googling, but ask "What would be good google terms for obtaining information about xyzzy?"
Important notice:
I am certainly not referring to CP as a forum where you are typically cut off with a LMGTFY - most other forums are terribly much worse. If you have a real problem, people at CP are generally helpful, even in cases where googling the ideal terms would have lead to a solution.
The only requests regularly rejected at CP are of the kind 'please do my homework for me', but that comes from laziness, not that the asker is an idiot. Besides, googling won't do his homework for him. (And chances are that the asker found the BB forum through googling )
|
|
|
|
|
Perhaps allowing yourself to be insulted is just the price you pay for free help.
|
|
|
|
|
When I ask my friend, neighbors or workmates for (free) help with something, they have been positive and helpful; I have not had to pay the price of tolerating their insults.
Not yet. That may change in the future, as internet "social conventions" spread to real life.
|
|
|
|
|
I don't see that happening very often, but when you google for a problem you find someone asking your question on a forum, and guess what's the answer ? "LMGTFY", "Google it", or whatever similar.
So please never answer question like that, it just makes google searches less efficient.
|
|
|
|
|
I am doing more support than development these days and the first thing when someone asks me for help is what they have done to find an answer? Investigations, using Google for answers, etc. For programming issues, we generally allow a person a maximum of 2 hours to try on their own before asking for help, but then that person must be able to show what has been done/tried in that time. If it is a high priority issue, it may be sooner but then I hope the person really tried, else sarcasm/lmgtfy will come to the front.
|
|
|
|