Memorizing syntax/steps vs. looking things up

  • Python
  • Thread starter EngWiPy
  • Start date
In summary: Yes, it is something that is valued. However, employers are looking for more than just knowing what a specific language syntax is. They want to see how well you can think on your feet, and how you can take a challenge and break it down into smaller steps.
  • #1
EngWiPy
1,368
61
Hello,

I have a question: some syntax in programming are easy to remember, but others are not. Usually, when I am stuck at how to implement an idea, or don't remember the exact syntax of something I need to use, say in Python, I search it on the Internet, and I almost always find an answer.

For example, if I want to draw a choropleth map visualization using plotly, I copy paste an example I have, and then adjust its parameters to my values, and if I need something that isn't there already, I search it and add it.

I am asking this question because what would happen in a technical interview if I didn't know how to implement something correctly in a specific language like Python (I doubt they would ask about a choropleth map, but maybe something that is difficult to memorize)? Is memorizing the syntax and parameters is something that is valued, or employers/recruiters just look for general algorithms/pseudocoding and how the candidate is thinking to tackle a problem?

Thanks
 
Technology news on Phys.org
  • #2
S_David said:
Hello,

I have a question: some syntax in programming are easy to remember, but others are not. Usually, when I am stuck at how to implement an idea, or don't remember the exact syntax of something I need to use, say in Python, I search it on the Internet, and I almost always find an answer.

For example, if I want to draw a choropleth map visualization using plotly, I copy paste an example I have, and then adjust its parameters to my values, and if I need something that isn't there already, I search it and add it.

I am asking this question because what would happen in a technical interview if I didn't know how to implement something correctly in a specific language like Python (I doubt they would ask about a choropleth map, but maybe something that is difficult to memorize)? Is memorizing the syntax and parameters is something that is valued, or employers/recruiters just look for general algorithms/pseudocoding and how the candidate is thinking to tackle a problem?

Thanks

I agree with you, that not knowing the precise syntax for something is not a big deal. A couple of minutes of Googling, and you have your answer. On the other hand, your interviewer may very well judge you based on whether you know certain things. So even though it might seem pointless, it probably is worthwhile to learn the syntax for at least the common constructs. Especially if you're being hired to program in a specific language.

It's not a total loss if you don't remember something, though. Just make up a reasonable syntax and explain that you can't remember the syntax, but that you know how to answer the challenge conceptually. That might be good enough in lots of cases. Challenges posed by interviewers are often about demonstrating how well you can organize your thoughts, and the specific language or syntax might be irrelevant. You could announce that you're going to solve the problem in "pseudocode" (basically a made-up language of your own).
 
  • Like
Likes QuantumQuest and EngWiPy
  • #3
Yes, revert to pseudo code when you’re not sure as most if not all programmers use the internet to find relevant examples, to understand what causes a particular error or the best way to approach some problem.

I also use a cookbook for the language that has many problems and how to the features of the language to solve them.

For python, there’s the Orielly Python Cookbook so in an interview you could say you’d check there for how to do some specific thing.

Usually they want to see how you approach a problem and break it down into smaller bite size steps that are obvious to anyone to implement.
 
  • Like
Likes FactChecker, QuantumQuest and EngWiPy
  • #4
S_David said:
Hello,

I have a question: some syntax in programming are easy to remember, but others are not. Usually, when I am stuck at how to implement an idea, or don't remember the exact syntax of something I need to use, say in Python, I search it on the Internet, and I almost always find an answer.

For example, if I want to draw a choropleth map visualization using plotly, I copy paste an example I have, and then adjust its parameters to my values, and if I need something that isn't there already, I search it and add it.

I am asking this question because what would happen in a technical interview if I didn't know how to implement something correctly in a specific language like Python (I doubt they would ask about a choropleth map, but maybe something that is difficult to memorize)? Is memorizing the syntax and parameters is something that is valued, or employers/recruiters just look for general algorithms/pseudocoding and how the candidate is thinking to tackle a problem?

Thanks

Syntax of a programming language is something that is gradually learned through years of utilizing the specific language and finally becomes something of a second nature. So, don't try to memorize it as you learn the language. You can learn the syntax of basic constructs as stevendaryl points out and learn more as you go.

In order for the code you find on the net and use it to be useful you have to analyze it / modify it yourself - maybe in some cases out of the context of a specific problem, so you can be sure that you learn something every time but most importantly that the whole code you've prepared as a solution to a problem won't blow off at some unsuspecting time. This is crucial for production code, so in my opinion, you must do it even for homework / hobby projects.

Now, regarding programming interviews and talking from my own experience through the years what is of utmost importance is the programming mindset i.e. how quickly and efficiently can you solve a given problem which is a pure algorithmic / data structures thing and how to efficiently implement it in the asked programming language which clearly presupposes that you have the knowledge of all the basic constructs and you are acquainted with the "philosophy" of the language. For more challenging / senior positions there is always the demand of knowing a number of programming languages sufficiently good as well as years of proved experience, complete commercial projects you have joined and job positions.
 
  • Like
Likes EngWiPy
  • #5
Rosettacode.org is a good resource for comparative programming languages and for learning odd features of your favorite language. The examples aren’t always the best but they can be interesting.
 
  • Like
Likes EngWiPy
  • #6
You are at the mercy of the interviewer regarding how much they care about your memory of syntax. A good programmer who interviews you will understand that a lot can be copied from the internet or that the programming environment will assist in the syntax. A bad programmer who interviews you may not understand that. Your best bet is probably to use pseudo code as @jedishrfu suggested and mention how you would get the exact syntax, given Google or the appropriate work environment.

I had one disastrous interview for a project. I was very clumsy in that interview and was not prepared to explain as you will be. Even though I had programmed for decades in several languages and on several operating systems, they rejected me and called my boss to ask why he had sent someone who knew no programming. I knew that I could program rings around them. I was later assigned to work with the same people -- they never mentioned the prior rejection and it worked out very well (I got a recognition award for it.).

PS. Keep in mind that there may be situations where you can not Google. In classified programs, internet connections may not be available and it may even be impossible to bring in any code examples from outside.
 
  • Like
Likes EngWiPy
  • #7
Don’t let rejection get you down, you know you can program. Sometimes you get an interviewer who doesn’t know how to interview and relies on trick questions. I had a junior programmer interview me, a senior programmer, he asked a couple of trick questions needless to say I didn’t get the job and after his stupidity I didn’t want to work there either. You could tell there was no team spirit.

At work, one student I knew who was quite sharp didn’t get hired because another student I had also taught nailed the interview question on writing a sort algorithm. She had just learned it in her programming class that week. They lost a wonderful programmer that day.

When I interview, I tend to ask questions about projects listed on their resume. From there you can learn what tools they used, what parts of the project they worked on and whether they understood the larger picture. Often you learn about things they didn’t think were important enough to add on the resume.

Bottom line bring a couple of copies of your resume ie the one you sent to the company, with you to your interview and make sure to review it beforehand. Interviewers use it as a starting point for questions to ask. You can in turn ask questions about what they do, the work environment and anything needed that will help you decide if this is the place you would want to work.
 
Last edited:
  • Like
Likes EngWiPy and FactChecker
  • #8
Thanks all.

I got one phone interview, and and the person who interviewed me asked me questions like: why us? and if you could change one thing in you, what would that be? I didn't know how to answer these questions, and didn't get to the technical interview.

I am learning Python in the context of data science. I want to switch careers (from EE/Wireless Communication). I have no commercial projects or practical experience in the new field. I am trying to do some personal projects to publish online and put on my resume.

Do you recommend using Github or Kaggle? I have one basic exploratory data analysis file of some data I compiled I want to publish as a starter.

If you have any advice for me regarding the transition, it will be highly appreciated.

Thanks
 
  • #9
To the why us question? They were checking if you knew what the company did or if someone at the company recommended you apply to them. A review of their website would give you some info.

You could be bold and flip the question back to the interviewer like why did you apply to the company? His or her answer could be useful in the future. There may even be more common answers online.

To the one thing to change question, they expect you to identify some flaw in your character. An honest answer is needed but not a flaw in your character instead say something shows a strength humbly. Again there are probably good answers online.

In any event, if they stopped you here then this company doesn’t need people and they just lost a good candidate. You have experience and you deserve some respect during the interview.

Have you ever seen the comedy movie The Internship with Vince Vaughn and Owen Wilson? it’s funny how they bambuzzle folks to get to Google. Don’t be those guys though.
 
  • Like
Likes EngWiPy
  • #10
While I 100% agree that process is more important that syntax, there are some syntax things that you should know for interviews. It can be a red flag if for instance you don't know the syntax for a for loop, as this is a very commonly used construct. However I don't think anyone will ding you if you miss a semicolon in whiteboard code.
 
  • Like
Likes jedishrfu, FactChecker and EngWiPy
  • #12
I've been on both sides of the interviewing process.

Interviewers are usually a mix between managers, executives, and engineers. The managers and executives rarely know any coding themselves, so will not ask about specifics. They are more interested in your credibility and work history. The engineers are in the same place as you when it comes to syntax. Most of us have written in many different languages, and most of us even get hired for one language, then spend most of the day in another. When you're asked to do a programming test or something, the algorithms that you use is more important than the code. Pseudocode is fine unless otherwise specified. I'd always rather hire someone who solved the problem in the most efficient way rather than the one who wrote the best code.

I'd be surprised if you get asked a lot of programming questions, as I've always preferred logic puzzles or simple thinking tests. I always ask candidates a particular question about how to transfer a note to a general in an indestructible box with locks and keys so that no carrier can ever open the box them-self (basically, how does SSL work.) I also tend to throw out a pair of two digit numbers and ask them to multiply in their head and explain their thoughts. I'm curious do they try to do the multiplication right to left (brute force), or if they break it up into easier multipliers and add (divide and conquer.)

If the guy you're talking to is an engineer and you don't know an exact syntax, say so. They'll recognize if you try to bullshit and call you out on it, but will completely understand if you say you'll have to look up specifics but give the gist. I've been programming PHP for literally close to a decade, I look up the exact order for the strpos, substr, str_repeat every time I use them.
 
  • Like
Likes donpacino, jedishrfu and EngWiPy
  • #13
Programming languages are becoming less important with time. More is done with frameworks now. You still write glue logic and special functions, though. And middleware like SharePoint takes programming mindset and skills, even though you mostly aren’t writing code. Finally, work process, such as quality techniques and design methodologies, are critical. After you’ve learned a couple of languages, you can pick up others.

No, an interviewer may not understand these points, but that’s where the trade is going.
 
  • Like
Likes EngWiPy and FactChecker
  • #14
It's not necessarily true that once you learn one language it's easy to pick up others. Some examples are:

easy: c | c++ | java | javascript | python

hard: c | prolog | lisp | forth | elm | ...

Languages based on C (procedural) are generally easier to understand and pickup but languages with different programming paradigms are not.

But this is getting a bit off-track.
 
  • Like
Likes QuantumQuest and FactChecker
  • #15
canalligators said:
Programming languages are becoming less important with time. More is done with frameworks now. You still write glue logic and special functions, though. And middleware like SharePoint takes programming mindset and skills, even though you mostly aren’t writing code. Finally, work process, such as quality techniques and design methodologies, are critical. After you’ve learned a couple of languages, you can pick up others.
A programmer should be aware of the trends and ready to adapt. But in a job interview, he should not imply that he can only program that way because they may not be using the most recent techniques. Keep a few of thing in mind:
1) There is a lot of legacy code out there.
2) It's not wise to be on the "bleeding edge of technology".
3) New techniques are often (usually?) oversold.
4) Being adaptable is often more important to an employer than knowing the most advanced techniques.
 
Last edited:
  • Like
Likes QuantumQuest
  • #16
FactChecker said:
A programmer should be aware of the trends and ready to adapt. But in a job interview, he should not imply that he can only program that way because they may not be using the most recent techniques. Keep a few of thing in mind:
1) There is a lot of legacy code out there.
2) It's not wise to be on the "bleeding edge of technology".
3) New techniques are often (usually?) oversold.
4) Being adaptable is often more important to an employer than knowing the most advanced techniques.
This is very true. I sell myself as an expert C++ programmer. I honestly don't really know use of the latest C++11 tricks. And even though I have PHP 7 on my dev machine, I write PHP 5 because that's what's on the live servers. Most companies adopt new technologies slowly, so it's better to be proficient with foundational stuff and simply demonstrate the ability to learn the new stuff.
 
  • Like
Likes QuantumQuest and FactChecker
  • #17
canalligators said:
Programming languages are becoming less important with time. More is done with frameworks now.

While the second sentence is absolutely true it does not imply the first.

First off, programming / development frameworks are constructed using programming languages and operate / are utilized using programming languages. If you don't know the required per case programming language(s) and you're just trying to mix and match things that you don't (sufficiently) know chances are that sooner or later you'll hit a wall, not to mention that you're doomed to ask others for help in a perpetual manner, at least when developing anything serious . Second - as you may already know if you are a programmer, there is always the need to make some tuning / modification(s) to some framework and in many cases the need for creation of some framework from scratch based on another one. This is especially true in web development but the same argument holds for non-web programming too. It is true that mostly Microsoft has paved the way of creating frameworks that ask for the least of programming abilities in order to implement a software project / application and this undoubtedly has its merits towards a more "high level" process but this in no way implies that you can do everything without a good solid programming knowledge / experience. This is way more pronounced in other technologies - a good example is Java.

If you add to the above the four reasons that FactChecker gives in post #15 you'll see that good programming knowledge and experience has not got less important.

canalligators said:
After you’ve learned a couple of languages, you can pick up others.

True if the "others" belong to the same programming paradigm / philosophy - to be precise I mean that they express the same programming paradigm, as jedishrfu points out. But till you acquire the necessary knowledge of (some) programming languages expressing different programming paradigms you cannot pick up any other language just like that.
 
Last edited:
  • Like
Likes FactChecker

1. Why is it important to memorize syntax and steps?

Memorizing syntax and steps allows for faster and more efficient coding. It also helps with understanding the logic behind the code and being able to troubleshoot errors.

2. Is it necessary to memorize all syntax and steps?

No, it is not necessary to memorize every single syntax and step. It is more important to understand the fundamentals and principles of coding, and to be able to look up specific syntax or steps as needed.

3. What are the benefits of looking things up instead of memorizing?

Looking things up allows for a more accurate and up-to-date understanding of coding. It also helps to expand one's knowledge and learn new ways of solving problems.

4. How can I find the right syntax or steps to use?

There are many resources available for finding the correct syntax and steps, such as online documentation, forums, and tutorials. It is important to use reliable sources and to double check the information before implementing it in your code.

5. Is it possible to strike a balance between memorizing and looking things up?

Yes, it is possible to strike a balance between memorizing and looking things up. It is important to have a good understanding of the basics and commonly used syntax, while also being open to looking up new information and techniques when needed.

Similar threads

  • Programming and Computer Science
Replies
13
Views
2K
  • Programming and Computer Science
Replies
2
Views
202
  • Programming and Computer Science
Replies
27
Views
2K
  • Programming and Computer Science
Replies
3
Views
1K
  • Computing and Technology
Replies
16
Views
3K
  • Programming and Computer Science
Replies
19
Views
2K
  • Programming and Computer Science
Replies
1
Views
4K
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
Replies
13
Views
4K
Back
Top