Advertisement

Can't solve problems without googling?

Started by August 11, 2014 08:15 PM
17 comments, last by DekuTree64 10 years, 5 months ago

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?

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.

Advertisement

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

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.


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.

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

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

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.

Advertisement

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

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).

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

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.

This topic is closed to new replies.

Advertisement