Jump to content

  • Log In with Google      Sign In   
  • Create Account

Can't solve problems without googling?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
18 replies to this topic

#1 Lith   Members   -  Reputation: 384

Like
7Likes
Like

Posted 11 August 2014 - 02:15 PM

To give some context, I'm 17 and I have been programming for a few years.

 

I was doing a code challenge on codewars.com, (similar to project euler), that involved converting to and from negabinary numbers (base negative 2). I had never heard of, nor even considered numbers with a negative base. But I managed to figure out some patterns in the tables the problem gave me and wrote a nice converter from negabinary to decimal. But the other way around, that was a different story. I tried for hours to figure out a way of converting decimal to negabinary but to no avail. It got reasonably late so I slept on it. The next day I tried for hours again but still couldn't figure out an algorithm. After this I googled it, found a wikipedia page with an algorithm all ready and waiting for me.

 

I had solved it, albeit with a little "research"...

 

I want to be the best programmer I can, and I think I'm on the right track by attempting these coding challenges. But I'm a little lost on what I should do when I'm faced with a situation like this. Almost all the problems I'll solve (at least early on) will have been already solved brilliantly by someone else. I'm sure If I was working, my boss wouldn't be impressed if he found out I'd spend the best part of 2 days trying to solve a problem that I could have solved in 2 minutes If I had googled it. But googling it feels like cheating, and I don't get to practice my problem solving abilities.

 

It seems like the best programmers are able to take problems that no one has solved before and develop solutions on their own.

 

I guess what I'm asking is how do I get really fucking good at problem solving? By spending massive ammounts of time thinking through problems for myself or by looking at as many past solutions as possible?


Edited by Lith, 11 August 2014 - 02:17 PM.


Sponsor:

#2 frob   Moderators   -  Reputation: 21331

Like
23Likes
Like

Posted 11 August 2014 - 03:09 PM

You do both.
 

Right now you are still young. Many people go to college and get a degree and feel like they know everything and are the worldwide expert on all topics. Those people are wrong. You really aren't all that great at it yet, no matter how good you think you are. A recent college grad starts out at the bottom rung, they are entry level, they are inexperienced. As a recent high school grad, you are even that much less knowledgeable than a college grad who has been studying the field for four years.

 

 

There are really only two ways to gain experience. Do things wrong yourself, and watch other people do things wrong. Do both.

 

You will do a lot of things wrong over your career.  You will try something and it will fail. You will start down one path and realize you could have done something much better. You will sometimes need to stick with your mistakes when you do not have time or resources to correct them. You can also learn much more by taking notes of your actions and at the of the project, or perhaps every 2-3 weeks, review what you did wrong and what you did right over the interval.

 

The other way is to learn from others. You can gain a lot of insights by reading and learning what others did to succeed and to fail. You can read about best practices. You can talk with a lot of people and discover what they are doing that is both different and similar to your actions. You can work with various groups to get a good feel of their practices, and compare what works and what doesn't.

 

 

 

As for skill, some of it is natural ability. Some people are naturally quite skilled at problem solving, others naturally struggle. Just like some people are naturally faster runners, some people are naturally more coordinated, some people are naturally stronger, some people are naturally more linguistic, some are more imaginative, some are more mechanical, and so on. Even so, most people are able to improve their skill if they apply some effort.

 

You get better at it by doing it a lot, and by investing some time in practicing and filling in gaps in your skill and experience through practice and study.


Edited by frob, 11 August 2014 - 03:10 PM.

Check out my personal indie blog at bryanwagstaff.com.

#3 djtesh   Members   -  Reputation: 265

Like
10Likes
Like

Posted 11 August 2014 - 03:12 PM

Hello!

 

This is a very interesting conversation to have! I've been programming for over 10 years. I really enjoy it and the feeling of wanting to improve persists! Here are some things I've found:

 

#1) Most regular professional jobs are results oreinted. They really do not care if you've written the best search algorithm or the most optimized string parsing routine. You can get into trouble as you are bombarded with deadlines, and tasks cannot be consistently challenging. Here, it is very common to be an OK programmer and do well with a bit of politics. To do the really good stuff, you'll have to turn to #2. If you have a burning desire to do cutting edge things, steer your career away from jobs that don't need it.

 

#2) A lot of great programming achievements were started as pet projects / hobby projects. These are the projects that someone really cared about intensely, and found the time and energy to devote to something exceptional. Never stop making stuff on your own.

 

#3) There are a few exceptionally rare companies that try to build the very best libraries themselves, and then release them to the world. For example, Twitter with Bootstrap, Google with AngularJS and their plethora of tools and Apple with their various frameworks that they provide to App developers. You can make decent money if you find yourself at one of these coveted companies. Microsoft and Facebook have really really smart people too, and there may be many companies that could have exceptional teams. Finding these hidden gems can be difficult.

 

#4) Finish stuff. Today you have so many avenues to see if people care about what you made. App Stores, GitHub just to name a few. Let people play with or use the things you make. The art of finishing is lost on many (including myself for so many years). It is hard to learn the really valuable stuff that a real life use will teach if you can't finish your projects. Start small if you have to. Find passionate teammates before attempting massive stuff.

 

#5) If you have the time, take great open source projects and make them better. The world will thank you for it. I will thank you for it!

 

If you are not a naturally great problem solver - or if you don't know, the best path is to join a place with REALLY smart people. You'll see their tricks, their way of thinking and you will learn quickly.

 

Ok I'll stop here for now. Let's see what others have to say.

 

Best Regards,

Mitesh



#4 ferrous   Members   -  Reputation: 2013

Like
8Likes
Like

Posted 11 August 2014 - 04:04 PM

When you google the answer to something, try to understand the answer.  As you get to larger and more complex problems, googling the answer will be useful, but it won't be a one line, cut-n-paste fix to solve your problem, you'll have to actually implement it, understand it, and possibly improve it.



#5 Glass_Knife   Moderators   -  Reputation: 4451

Like
6Likes
Like

Posted 11 August 2014 - 04:15 PM


It seems like the best programmers are able to take problems that no one has solved before and develop solutions on their own.

 

"How did they figure this out without any help?"

 

I will make an assumption that since you're at gamedev you are interested in making games.  So try making a new game.  Not a re-imaging of something that already exists, but a completely new idea.  If your idea is good enough (and it may take a few) you will arrive at a place where you are stuck, and there is no one on the planet that can help you.  You are doing something completely new.  Google, friends, books, nothing will help.  

 

Now solve the problem.  It is so much more difficult than you think.  You will give up, but it will haunt you.  Then one night, while falling asleep, the solution to the problem you've already cast aside will snap into your mind.

 

There really isn't a better feeling.


Edited by Glass_Knife, 11 August 2014 - 04:17 PM.

I think, therefore I am. I think? - "George Carlin"
Indie Game Programming

#6 georger.araujo   Members   -  Reputation: 817

Like
2Likes
Like

Posted 11 August 2014 - 05:00 PM

I guess what I'm asking is how do I get really fucking good at problem solving? By spending massive ammounts of time thinking through problems for myself or by looking at as many past solutions as possible?

 

@frob's right, you do both. That said, just spending time on the problem won't help if you don't have the basic tools: solid foundations and method.

 

Study math. At the very least, precalculus, basic calculus, and introductory logic.

Study programming. Get some good books and actually work through them. I can't stress this enough - solve *all* exercises. Read good code written by others. Don't be afraid to ask questions, but do your homework first.

Devise a method. Pólya's four principles are a good starting point.

 

To wrap up: clever solutions to hard problems usually take a lot of work, research, insight, and sometimes luck. Even when you can solve a problem quickly and easily, you owe it to your accumulated knowledge and experience. So, get to work.



#7 Andy Gainey   Members   -  Reputation: 2004

Like
3Likes
Like

Posted 11 August 2014 - 05:25 PM

In my experience, the majority of problems encountered while programming are pretty mundane to solve.  I don't find coding puzzles to be very representative of the types of brainwork that I've had to do for the various jobs I've held.  Occasionally I'll get a problem like that, and it's thrilling to then come up with a great solution to a hard problem, but it's a rare occurrence.

 

More often, the skill that is truly important is being able to take a vaguely defined and poorly understood problem, and get down to the heart of what you're actually trying to solve.  Then the solution is often straightforward, but the end result is precisely what was needed.  But if you fail to properly understand the problem well, you might come up with a really cool solution, or might find an impressive solution on the internet, but it doesn't really solve your actual problem very well.

 

Sometimes this process of understanding the problem occurs at the business level:  What does the customer need?  What could they use?  Other times, it occurs at a technical/architectural level:  What's the data I'm dealing with?  How best to represent it, store it, pass it around, transform it?  You make a major misunderstanding with either of these levels of consideration, and you're likely to burn a lot of time and money building a sub par piece of software.  If you nail it, however, things can go really well, and your coworkers, bosses, and customers are going to notice.



"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke

#8 DiegoSLTS   Members   -  Reputation: 1378

Like
6Likes
Like

Posted 11 August 2014 - 07:40 PM

Searching is also a skill you need, and as any skill, you need practice to be good at it.

 

You're assuming that to be good you have to do everything by yourself, but that will actually just slow you down and probably make you worse in some aspects. You don't have to just "solve problems", consider these other things:

  • You'll probably work with other people, so don't expect to use only your code. You may be working on a project where other developer already did something similar, or have built something that you can use. If you ignore all that and make it again by yourself they won't be happy, unless you have real reasons and can convince them.
  • You'll need tools, and to learn how to use those tools you'll probably look some tutorials, read a book or check the documentation for examples. That's not that different from searching on google, it's just another source to learn.

Also, like Andy Gainey said, when you work in a company is not common to solve complex mathematical problems where you need clever solutions. When I see some excercise that says "from numbers 1 to 100, print in console the ones that <really complex condition>" I always wonder if the teacher is trying to teach programming or math. Most of the times the problem becomes harder just for the math involved, and you end up learning a lot of how to express a math function and practice just a little of programming concepts. If you find yourself spending HOURS on some math theory that you don't know, just use google and learn it. You said you tried to figure out the concept by searching patterns in a table of results and it sounds like a waste of time if you want to be a person that solves problems. You're right when you say that employers won't be impressed, and I'd say they won't even like that. You shouldn't tell that on an interview ("I like to solve every problem by myself instead of searching") and you shouldn't base your skills on how many of those types of problems you solved by your own.

 

In a real problem you might be traying to use the device's camera to take a picture and then save that picture in the gallery, or you might need to send a request through a network to update a database, or you might want to swap 3D model for your main character after getting a powerup. You can't solve those problems the first time by just looking at the screen and some description of the expected result, you'll have to search and you'll have to check examples and you'll probably start things with some copy pasted skeleton.

 

Also, programming could be split in a lot of topics, you can't be "better a programming" by doing some kind of excercies over and over. How many of those challenges in codewars are big enough to use, for example, design patterns? You must practice those things too and you'll probably use them a lot more. I think those challenges are ment for people that are already good and like to solve them as a game (like puzzles on magazines), if you're a begginer and want to learn you should be doing something else (watching tutorial, going to classes, reading books, making small projects, etc).


Edited by DiegoSLTS, 11 August 2014 - 07:48 PM.


#9 LancerSolurus   Members   -  Reputation: 602

Like
5Likes
Like

Posted 11 August 2014 - 08:21 PM

I've been programming over 30 years now and didn't have the advantages you have now (started on a Vic 20). As Frob said, use both, I could have really used the extra help all those years ago, hehe, a stone age programmer I know. Any time I want to create a new feature I now google it first to see if it's been figured out by someone smarter than myself. It's not cheating, it's smart thinking and time saving on your end.


******************************************************************************************
Youtube Channel


#10 shadowisadog   Crossbones+   -  Reputation: 2524

Like
0Likes
Like

Posted 11 August 2014 - 08:56 PM

Problem solving is a skill that you will develop through experience and practice. I believe that a very important skill is the ability to break a complex problem into problems that CAN be googled. Where the developer skill comes in is recognizing where certain patterns and ideas can be applied and combined together to solve the overall problem as a whole.

 

On a day to day basis I use google, debugging techniques, software design techniques, books, man pages, and other online reference documentation in the course of doing my work.

 

Keep in mind it also takes a certain level of knowledge to understand if a given solution you find online is a good solution or not (Is it robust, is it maintainable, does it rely on undocumented features, what is the license for the solution, ect). So as others have mentioned try to understand the solutions, try to figure out how they work and improve on them.


Edited by shadowisadog, 11 August 2014 - 08:57 PM.


#11 Eck   Members   -  Reputation: 2816

Like
2Likes
Like

Posted 11 August 2014 - 09:39 PM


You will do a lot of things wrong over your career.  You will try something and it will fail. You will start down one path and realize you could have done something much better...

 

You'll probably also solve a problem one day and say to yourself, "Damn. Now THIS is some awesome code."  Then a few years later you'll look back at that work and laugh at past-Lith for being such an ignorant newbie. 

 

Like others have said before, you'll get better through practice. Since you're 17 and started programming a couple of years ago, I wouldn't worry too much about it. You're motivated to learn and are programming in your free time. Good job.

 

And one reason the solutions look easy online is because you're looking at the solution. You're not watching a video of some mathematician staring at a whiteboard for hours at a time, trying and failing a hundred different times. You get to see his nice proof on a clean sheet of paper without any scribbles or teardrop stains. :)

 

- Eck



#12 Buster2000   Members   -  Reputation: 1665

Like
2Likes
Like

Posted 12 August 2014 - 01:38 AM

There is nothing wrong with googling for a solution.  In the workplace its better to quickly find a solution to a problem that is already solved than spend a week trying to figure out something that you could have discovered in seconds.

 

You think profesional software developers "just know" the answer to everything.  Nope.

For a prime example look at John Carmack and all the stuff that has been attributed to him:

 

Did he invent the fast square root?  Nope
Did he invent BSP trees? Nope
Was he the first to use PVS? Nope

Did he invent the Doom3 shadow algorithm? Nope

Did he invent Mega Texture? Nope

 

All these things were already invented several years before he decided to use them.  How did he discover them?   Through research.

 

OK ok but somebody must have invented them in the first place well yes they did but for the most part it wasn't something they just thought of.  A lot of computing solutions come from academia where people spend years working on a very small subset of problems as part of their phD.  These then get published and forgotten about until somebody researches them and finds a use for them.
 

 

Obviously he did the research unti he fully understands the solution but, still it isn't like he just dreamed the answers up in his sleep.


Edited by Buster2000, 12 August 2014 - 01:39 AM.


#13 phantom   Moderators   -  Reputation: 7279

Like
3Likes
Like

Posted 12 August 2014 - 04:34 AM

Both.

When at work, when confronted by a problem my first thought it ALWAYS "I wonder if anyone has had this issue and solved it already..." and away to google I'll go to see if that's the case and to learn from something someone else has already solved.

The 'learn from' part is pretty key; if you find a solution, copy and paste it and don't take in why it worked then you've learnt nothing. If you take a moment or 7 to think about the solution, how it works and how to refine it to your situation then yay! experience!

And that's where the ability to solve 'new' problems comes from; experience.

Most seemingly new solutions will always have a seed in an existing solution to an existing problem which someone then thinks about some more, applies knowledge and experience gained over the years to refine the solution and create something new.

Nothing is created in a vacuum and all new ideas are feed from old ideas and as you gain more knowledge you'll find yourself doing this naturally.

Problem solving itself is nothing more than looking at something and then taking it apart so that one big problem because two smaller ones, which in turn become two smaller ones and so on. This gets easier with experience and practice as you get use to it and solve problems.

The key point is 'research' isn't a dirty word.

#14 Buckeye   Crossbones+   -  Reputation: 4926

Like
0Likes
Like

Posted 12 August 2014 - 06:42 AM

Pasteur said that chance favors the prepared mind.

 

One of the most important aspects of preparing your mind for great things is to understand that, early in your education, not only are you gaining basic knowledge, you are learning to learn. You can't acquire new knowledge without the ability to learn. A part of learning to learn is learning how to researchThat's the time-honored emphasis of post-graduate degrees.

 

So googling isn't a cheat, it's a powerful tool to prepare your mind.

 

Newton said that, if he saw further than others, it was only because he stood on the shoulders of giants.

 

If you want to achieve great things, you must prepare yourself to see what others have seen, and stand on their shoulders.


Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.


#15 Gian-Reto   Members   -  Reputation: 1049

Like
0Likes
Like

Posted 12 August 2014 - 07:21 AM

everyone googles nowadays... its just as much a basic skill now as problem solving.

 

Get good at it just as you train you programming skills or other skills. Some of the best solutions come from taking something someone else did and improving it.

 

Its what engineering was for hundreds of years! Even geniouses did it.



#16 Bregma   Crossbones+   -  Reputation: 5133

Like
1Likes
Like

Posted 12 August 2014 - 07:23 AM

A tourist had just arrived in Manhattan with tickets to a concert and didn't know his way around.  The curtain time for the show was fast approaching and the tourist was becoming increasing desperate to find the venue.

 

Finally, he approached a man walking swiftly and carrying a violin case, a sign he might have knowledge of the local entertainment industry.

 

"Excuse me," said the tourist, and the hurrying man looked up.

 

"Can you tell me how to get to Carnegie Hall?" queried the lost and desperate man.

 

The man with the violin case paused briefly and stared intensely at the tourist.  After a beat, he spat "Practice!!!" and hurried on his way.

 

To get good at something, you practise.  It's that simple.  Learning and repeating what others have done is one of the more effective ways of practising.


Stephen M. Webb
Professional Free Software Developer

#17 Karsten_   Members   -  Reputation: 1604

Like
0Likes
Like

Posted 12 August 2014 - 02:28 PM

As you program and problem solve more and more, you still wont feel you are getting any better. However the problems will seem to be getting easier.

 

As for professional programming, often time is of the essence and thus if you can "google" a solution, then professional due diligence should dictate that you do not want to be reinventing the wheel. However, what separates the good programmers from other programmers is to be able to work out quickly whether a solution from google is good and otherwise quickly discard it rather than polluting the codebase with crud (typically seen with amateur web / javascript development).

 

Writing code is pretty much data entry, it is the scalable design and elegant integration of code that comes with practice. As for the algorithms themselves, yeah, maths is often key (especially no escaping that in graphics programming). Between learning that and knowledge of low level languages like C and even assembly, you will get pretty damn good.


Edited by Karsten_, 12 August 2014 - 02:34 PM.

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


#18 Ashley_H   Members   -  Reputation: 106

Like
1Likes
Like

Posted 12 August 2014 - 03:46 PM


You will give up, but it will haunt you.  Then one night, while falling asleep, the solution to the problem you've already cast aside will snap into your mind.
 
There really isn't a better feeling.

 

It's basically this.. Or at least for me it is.

 

I'm in a similar situation, I self-taught myself programming and never went to college or university. I've barely read a programming book and have watched a few basic programming tutorials. Whenever I try to write a program I nearly always find myself googling for solutions to problems or looking at other peoples code. And that's basically how I learned to program.

 

It's taken me many years to finally build up the confidence to apply for a job as a full time programmer but I finally got there earlier this year. My day job now consist of writing web based gambling games using a bespoke Java API (Reminds me of an XNA style framework but for gambling games). But because it's bespoke though there is nowhere to turn when a problem comes up which I can't solve.

 

Instead I sit there for hours, sometimes days... Hell, sometimes even weeks staring at a notepad document where I've written down all of the information I currently have available and what information I need, trying to work out a way to turn A into B. Eventually it will click into place and you'll solve the problem, although it feels like it at the time, nothing is impossible. There have been plenty of times in the last 6 months where I've been sat at my desk, head in hands, thinking up a way to tell the project manager the game is impossible and cannot be completed.

 

Eventually when you hit that solution though, it builds your confidence and blows away any self-doubt you may have about your skill as a programmer.



#19 DekuTree64   Members   -  Reputation: 986

Like
1Likes
Like

Posted 12 August 2014 - 04:31 PM

Lots of good answers here. I especially like Glass_Knife and phantom's.

 

Another thing you can do is read just the overview of the solution, and try to work out the details yourself, but with a chicken exit if you need it.

 

Also, don't be afraid to solve the same problem more than once :) Sometimes when you have a large and complex challenge, you just have to dive head first into it and make a big mess of code. Then refactor and it looks a little better. But with your deeper understanding of the problem, you might be able to approach it from a different angle and come up with a more elegant system overall.

 

A good example for me is side scroller collision detection with slopes. It seems so simple, and often it is, depending on how many cases you want to handle. But it can get really complicated if you want to support slopes steeper than 45 degrees, sloped ceilings, not having off-by-one problems between left and right slopes, colliding the center of your rectangle with the slope but corner when standing at the edge of a solid tile, etc. I finally managed a system that does everything I want, but it's not quite the level of elegance I want to reach before writing an article series on it (because all the articles I've read don't solve it completely). So one more iteration, one of these days :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS