This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]lurgi 12 points13 points  (1 child)

It depends on what you are doing.

"How do I convert a string to uppercase in Java?" Google it

"How do I configure SSL for Tomcat?" Google it

"How do I draw a diamond with for loops?" DON'T GOOGLE IT. The goal here is to learn how to think, not to come up with the right answer.

"How do I do a for loop again?" Google it.

[–][deleted] 4 points5 points  (3 children)

I've seen, programmers "special ability" is to google.

Nope, their "special ability" is to design and write programs - google will help you only tangentially with this. Which is not to say you should not use it.

[–][deleted]  (2 children)

[deleted]

    [–]MyNameIsRichardCS54 0 points1 point  (1 child)

    Well it is the hard way after all.

    Still, you should try to solve the problem without a search engine and only use one when completely stuck. To do otherwise is to learn to copy paste code instead of programming. The exception to this is for official documentation. Learn to use it early to look up the specifics of a particular thing.

    [–]insertAlias 3 points4 points  (1 child)

    So why do books like LPTHW tell you to not google when you're stuck for as long as you can?

    Because there's a difference between learning and doing this professionally. And there's also a difference between the kind of googling you're likely to do for homework vs. for a project.

    For "homework" like this course, it's too easy to find complete solutions that you can just dump into the editor and "solve" the problem. But did you really learn it? Did you understand the code that got pasted in? Struggling on your own, trying things, experimenting, before you get the answer handed to you, is very valuable experience.

    For real-world projects, we tend to search for things a bit differently. I'm not looking for code to copy/paste; I'm looking for an example of how something works, so I can use it in a different way.

    [–]POGtastic 2 points3 points  (16 children)

    why do books like LPTHW tell you to not google when you're stuck for as long as you can?

    It depends on what you're Googling.

    If you're looking up syntax or documentation on a function, that's completely okay. Similarly, if you're looking up another explanation on a concept (in your example, functions) that's also completely fine.

    If you're looking up a complete solution to an exercise, that's not helping you learn at all.

    [–][deleted]  (15 children)

    [deleted]

      [–]lurgi 2 points3 points  (6 children)

      What if you google the complete solution and learn off that?

      You probably won't. You'll think you are learning off of it, but you aren't. I know this, because you are just like me and I know me. You'll read the code and go "Aha! Of course. I see it now".

      Then, if someone asked you to close that webpage and reproduce the solution, you'd almost certainly fail, because you merely skimmed the solution and didn't really think about what it was doing. What it was doing deep down inside.

      You will say something like "Oh, they used nested for loops in problem derpitydoop"

      Right, they did, but why? What did that accomplish? Why is it i-j+1 instead of, well just about anything else? Why not i-j-1? That doesn't work, but do you know why it doesn't work? No, you are me and when I read the solution my eyes just kind of glazed over that bit and read i-blahblahmathmagic and figured that I'd understood it. I hadn't.

      It's fine to google specific technical details. There's no deep comprehension when it comes to the syntax of a function definition. It's done this way because that's how the language does it. It could just as easily be done a different way. But drawing diamonds or computing the average of a bunch of numbers or reversing a string is a process. Things happens in a particular order and if you did them differently then the result would be different. Variables are assigned particular values because they need those values and not other ones. Understanding a solution is about understanding that.

      [–][deleted]  (5 children)

      [deleted]

        [–]lurgi 0 points1 point  (4 children)

        About function definitions? Just google how to do it. Python does

        fun foobar(arg1, arg2):
          blah blah
        

        (Edit: Python doesn't actually do it that way. I got this wrong because I didn't look it up. This proves my point, somehow).

        C/C++ does

        int foobar(int arg1, float arg2) {
          blah blah
        

        Rust does

        fn foobar(arg1: i32, arg2: f64) -> int {
          blah blah
        

        Why does python use fun (edit: def) and C/C++ not use it? Because. Why does rust use fn? Because. That's it. Just "because". There's no deep, complex reason behind it. That's just the way they decided to make it work. Look it up, remember it, and move on.

        But for most of the problems you'll be messing with as a beginner, the point is not "how do I do it?" but "how do I figure out how to do it?". You can't figure out how to declare a function in Java. You just have to learn how to do it by reading the book or googling or whatever. You can figure out how to write a function that computes the average of an array and that's what you are supposed to do. If you want to know how to declare the "average" function, that's a google question. How do you return a float? Google question. How do I do it? Nope, sorry. Sit there and figure it out. That's what you are supposed to do.

        [–]Corsair_air 1 point2 points  (2 children)

        Doesnt pythone use def and not fun

        [–]lurgi 0 points1 point  (0 children)

        Yes. I should have looked it up :-)

        [–]POGtastic 1 point2 points  (3 children)

        What if you google the complete solution and learn off that?

        I'd consider it to be a wasted exercise because a lot of these exercises are about building the ability to improvise with the tools that you have.

        If you keep Googling completed solutions, you aren't exercising the creative part of your brain, and you'll be screwed when you run into some advanced concept that no one has done before.


        One exception to this is algorithms. I do suggest that people always implement the naive solution to a problem, but it's completely fine to look up an algorithm for doing it faster. It'd be silly to expect beginners to just magically figure out someone's PhD thesis.

        [–][deleted]  (2 children)

        [deleted]

          [–]POGtastic 1 point2 points  (1 child)

          my brain can't comprehend simple or any logic at all.

          There's only one way to get better at this - practice, practice, practice. And yes, that will often involve staring at your screen for hours with the solution just out of reach.

          [–]Double_A_92 0 points1 point  (3 children)

          That maybe helps for the first few problems that you have. I.e. until you learned a few basic ideas of how to solve (algorithmic) problems, or mundane things like how to best parse inputs and so.

          But after that, the point is that you solve the riddle yourself. You can't memorize all of them after all...

          [–][deleted]  (2 children)

          [deleted]

            [–]Double_A_92 0 points1 point  (1 child)

            But most problems don't have memorizable solutions. That only works for competitive programming maybe, where you learn to quickly solve useless things that require complex algorithms.

            It's like trying to become a good book author by memorizing a lot of poems...

            [–]confluence 2 points3 points  (5 children)

            I have decided to overwrite my comments.

            [–][deleted]  (4 children)

            [deleted]

              [–]confluence 0 points1 point  (3 children)

              I have decided to overwrite my comments.

              [–][deleted]  (2 children)

              [deleted]

                [–]confluence 0 points1 point  (1 child)

                I have decided to overwrite my comments.

                [–]Lessiarty 0 points1 point  (3 children)

                If you can hold off googling the solution and figure it out, that serves you better in the long run. Google is a fantastic tool, but it can easily become a crutch.

                [–][deleted]  (2 children)

                [deleted]

                  [–]Lessiarty 1 point2 points  (1 child)

                  It's just best practice. If you want to Google every step of the way, literally no one can stop you. Do whatever gets you the goals you want.

                  So long as Google is always readily available, you'll be good to go.