How do I get ideas for daily code?

  • (2 Pages)
  • +
  • 1
  • 2

25 Replies - 2620 Views - Last Post: 24 August 2020 - 12:26 PM

#1 Jleger91   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 28
  • Joined: 19-August 20

How do I get ideas for daily code?

Posted 19 August 2020 - 02:03 PM

I'm not sure where to put this type of question but I'm a CS student so the student campus sounds like a good place to post. After all students meet up and have discussions on campus all the time.
My situation is like this: I'm just starting out programming and all I've learned is stuff from a college course on C++ and a coursera course on Python. I'm reading The Self-Taught Programmer by Cory Althoff and it says that 199/200 applicants for programming jobs don't know how to write very simple code because all they learned is the theory in school but never got much practice, and just figured that school would be good enough. This book stresses that you can't get a job doing something that you've never done before, and that a minimum of 500hrs of code is adequate to get a coding job. The suggestion is to adopt an hour of code a day. Also, agent Dale Cooper from Twin Peaks always said "work on your daily routine, let it become the tent pole of your future." With some past failures, I want to make an honest attempt at coding for at least one hour every day. But what do I code, exactly? When it comes time to code, what do I code? How will I know what kinds of programs to make? I figure a bit of looking around and studying the programming language an hour beforehand will give me some ideas, although then it's one hour of code and one hour of study a day. I'm kind of nervous that I won't be able to think of anything to code.

Is This A Good Question/Topic? 0
  • +

Replies To: How do I get ideas for daily code?

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15894
  • View blog
  • Posts: 63,609
  • Joined: 12-June 08

Re: How do I get ideas for daily code?

Posted 19 August 2020 - 02:34 PM

500 hours to get an entry job? I guess I never clocked my hours, but seems like a weirdly specific value.

Start by looking around. See a need; fill a need.

Peruse github.

Check out the forum's project lists:

Project Ideas

Martyr2 Mega Project List

Take examples from your books and expand on them.

Look at tutorials, try them out, and expand on them.

Oh, and in before Jon mentions it - Code Katas.. http://codekata.com/
Was This Post Helpful? 1
  • +
  • -

#3 Jleger91   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 28
  • Joined: 19-August 20

Re: How do I get ideas for daily code?

Posted 19 August 2020 - 03:23 PM

Thank you for the links. This should keep me busy. For the past hour I've been having fun with the daily code:
message1 = "Hello"
message2 = "World!"
number = (5*(2+6) + 9)**(1/2)
for iterator in range(10):
    if iterator is 1:
        if number is 7.0:
            print (message1, message2)



But these experiments will get old and stale if I don't keep learning and trying new things. Again, thank you for the links Modi123
Was This Post Helpful? 0
  • +
  • -

#4 DarenR   User is online

  • D.I.C Lover

Reputation: 723
  • View blog
  • Posts: 4,674
  • Joined: 12-January 10

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 06:00 AM

not really sure where 500 hours comes from--- seems a bit weird.

some people are natural coders and some people have to work at it
i have to work at it because this isnt my 1st industry as i was originally a mechanical engineer

coding is basically abstract thinking in small terms with a larger result

as for practice-- dream in code has some good ones

the only way to truly learn is to just do it-- but remember just like everything else in life you can over do it and get burned out
Was This Post Helpful? 1
  • +
  • -

#5 astonecipher   User is offline

  • Enterprise Software Architect
  • member icon

Reputation: 3169
  • View blog
  • Posts: 11,986
  • Joined: 03-December 12

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 01:05 PM

The book is stupid, the author is not a developer he is a marketing person that is using that as his brand.


Realistically it takes a year to have enough knowledge to be employable without doing nothing but coding. Read books, do courses, write out all the sample code, experiment, break things and figure out why they broke and how to fix them again in different ways.

Is coding every day a requirement? No, but any practice you get means that it is a adding to the traffic lanes in your brain for how to do it again. Your projects don't have to be worthwhile or do anything spectacular, just start something and build on it. Learn a new topic, code things with it so you know how to use it. Project Euler, Stupid websites that do things.

Also, 500 hours breaks down to 50 days if you are doing just coding for 10 hours a day, everyday. While that may be possible, like how bootcamps do this, there is also a high level of structure and they frequently move through things so quickly that you don't grasp everything needed. So this 500 hour thing is further bullshit.
Was This Post Helpful? 0
  • +
  • -

#6 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 12037
  • View blog
  • Posts: 20,399
  • Joined: 19-March 11

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 01:33 PM

There are a lot of sites that will give you prompts for small "challenge"-type problems.
A few of the ones I'm familiar with:

adventofcode.com -- annual Christmas-themed challenge, but the last five years or so of problems are available, should keep you busy for a while
rosalind.org -- mostly about bio-informatics, useful if you want to also learn some stuff about a practical thing
projecteuler.net -- very mathy, these get pretty tricky pretty quick unless you have a solid math background, or are willing to acquire one
codewars.com -- good prep for technical interviews

These are all language-indenpendent and progressive in nature, so if you find one that tickles you, stick with it and grow. If you get stuck, move on and try another for a while.

Once you've done some of that, think about implementing some things that might be a little more persistent. Simple games (David Ahl's "BASIC Games" is a great source of ideas) are a good place to start.
Was This Post Helpful? 1
  • +
  • -

#7 Jleger91   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 28
  • Joined: 19-August 20

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 03:53 PM

Wow, thank you guys for the advice and suggestions for coding prompts. Some of you guys have been here for quite a while so when you say that the book is not credible, well I'll believe what you say. I was all for the Self-Taught Programmer book though because it said things strongly and made a lot of sense and was exactly what I wanted to hear - that it could prepare me for becoming a programmer if I am willing to work hard. How much of the book is fact/fiction? Surely there's some truth or good advice in there. Otherwise, what are some good programming books? I also got Code Complete by Steve McConnell and Programming Principles and Practice using C by Bjarne Stroustrup. I'm still a beginner so it's like a big complicated maze with little devils disguised as angels pointing into pitfalls. What I need is guidance. I'm willing to put in an honest hard-working effort, even if it's small like just an hour a day.
Was This Post Helpful? 0
  • +
  • -

#8 astonecipher   User is offline

  • Enterprise Software Architect
  • member icon

Reputation: 3169
  • View blog
  • Posts: 11,986
  • Joined: 03-December 12

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 03:58 PM

What is your primary focus? That will largely guide what you need to look at. Code Complete is great, pragmatic programmer, adaptive code.
Was This Post Helpful? 1
  • +
  • -

#9 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 12037
  • View blog
  • Posts: 20,399
  • Joined: 19-March 11

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 04:33 PM

The main thing is the every day, particularly at the beginning. It's like learning an instrument: at the start, whatever you learn on Monday starts fading away by Tuesday and is mostly gone by Wednesday, so you have to keep refreshing it. After a while, you can slack off a little, but doing it every day is key at the start.

It's hard to say what books will be useful for you since we don't know where you're at, but I think any book is good if it encourages you to put your ass in a chair and write some code, or even to type in some example code and try to poke at it and understand how it works.

Code Complete is a great book, and worth reading, but there are lots of great books. The question is, what do you need to know next?

I recommend a 70% approach to most books - read it fast and absorb 70% of the content, and file away ideas for future exploration. Don't get hung up on trying to get all of the details - if they're important you'll come across them again. Read lots, soak up the best you can, and keep moving. Maintain a list of your ignorance and keep it up to date. Let that guide your reading.

Be voracious, but be smart about it.
Was This Post Helpful? 1
  • +
  • -

#10 Jleger91   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 28
  • Joined: 19-August 20

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 04:49 PM

Is there any way to edit posts?

@Jon I used adventofcode and attempted the first problem where I had to calculate fuel_sum from a provided list of input masses and I did it and got the right answer :D I planned it all out on paper first and ran into a few problems but nothing too hard to solve. The most difficult part for me was with getting input from a text file into an array, so I manually created an array with each of those hundred elements in it which was a it of a pain in the butt that could've been easier if I read the elements from text file. With the array handy I used a for loop to do math to each mass and add to fuel_sum. These most trouble here was an array index error which was solved using a for loop in range(100) rather than a for loop in range of array. Then all I had to do was print out fuel_sum and I submitted the output and got the answer correct :D

Luckily this program wasn't anything I couldn't handle even with my minimal programming experience. I'm usually scared that it's going to be something really wild that I don't know how to do.
Was This Post Helpful? 0
  • +
  • -

#11 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 12037
  • View blog
  • Posts: 20,399
  • Joined: 19-March 11

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 05:01 PM

View PostJleger91, on 20 August 2020 - 06:49 PM, said:

I'm usually scared that it's going to be something really wild that I don't know how to do.


That's the best. That's when you learn stuff.
But never fear, the advent problems do get harder and you will end up in wild stuff that you don't know how to do soon enough.


Quote

Is there any way to edit posts?


In time, yes.
Was This Post Helpful? 0
  • +
  • -

#12 Jleger91   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 28
  • Joined: 19-August 20

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 05:08 PM

Where I'm at is I took a programming class on C++ and know basics of strings, arrays, loops, pseudocode, flowcharts, and functions, and some theory behind pointers. I also took a programming course in Python and are currently using Python-Thonny IDE on my laptop. I know how to plan out and write a print to console text-based adventure game with multiple stages from introduction to conclusion where the player has a list of commands with which to interact with the room and has to explore the room to escape. I also played around with coding some simple 2D games a decade ago using a GDK in C++ including Pong and a sidescroller level. Furthermore I've toyed around with some SCD code from 1998 Resident Evil 2 and rewrote the scripts in some rooms, making a disco dance floor where zombies play specified dancing animations and laser effects are simulated by turning on/off groups of 2D camera masks which took a lot of planning. I've also studied RE2 entity hexadecimal code for their animations and wrote a converter in C++ which changed the values of input from a text file so that RE2 entities could move like RE1 entities. All in all, I think I'd be on the level of a lowly trickster who is showing off all the cool things he can do but in reality knows so very little, and all his friends say "wow, that's so cool" and "that's amazing! how did you do that?!"
Was This Post Helpful? 0
  • +
  • -

#13 Jleger91   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 28
  • Joined: 19-August 20

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 06:33 PM

Holy crap! I completed part 2 of the adventofcode day 1 problem which required more planning and more tedious abstract thinking. I'm excited to share my code:

import math

mass = [81893, 122450, 81968, 135462, 127082, 94016, 100999, 88954, 111500, 89232, 149706, 70377, 114053,
        116799, 57368, 117222, 134050, 58097, 113145, 67710, 115082, 109484, 76183, 87768, 85164, 141183,
        120410, 85101, 139190, 120483, 89111, 122940, 103010, 127018, 85178, 73893, 145037, 115786, 149613,
        122956, 96325, 123513, 126850, 124733, 116615, 131598, 94544, 94431, 97681, 86617, 56739, 104904,
        129964, 80862, 92125, 127108, 110565, 131296, 88192, 81824, 134198, 87363, 122455, 123441, 60907,
        95023, 113940, 98328, 79989, 146133, 122356, 70932, 106379, 125641, 124905, 89699, 129133, 112173,
        127629, 135485, 140068, 95229, 141276, 109807, 69951, 100792, 62683, 145565, 149063, 99523, 88881,
        64337, 145012, 142380, 60028, 131565, 53041, 88489, 81712, 132728]
req_array = []
fuel_sum = 0
fuel_empty = False

for i in range(100):
    fuel_req = mass[i] #reset fuel requirements to next fuel module
    
    while (fuel_empty is False): #calculate fuel requirements
        fuel_req = math.floor(fuel_req/3) - 2
    
        if fuel_req < 0:
            req_array.append(0)
            fuel_empty = True #Finish with module if fuel is empty
        else:
            req_array.append(fuel_req)

    fuel_sum += sum(req_array)  # add sum of requirement array to total fuel_sum
    req_array.clear() # clear requirement array for old module
    
    fuel_empty = False #Get next fuel module

print(fuel_sum)



I feel like Rocky Balboa after a boxing match with Apollo Creed.
Was This Post Helpful? 1
  • +
  • -

#14 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 12037
  • View blog
  • Posts: 20,399
  • Joined: 19-March 11

Re: How do I get ideas for daily code?

Posted 20 August 2020 - 07:09 PM

Nice! Solving a problem is always a great feeling. The nice thing is, there's plenty more where that came from :)

If you enjoy this guy's problems, the advent of code sets go back to 2015, and each year starts off with relatively easy problems and scales up. So if you find yourself getting stuck, you can always jump back to https://adventofcode.com/2018/day/1 and work your way up that series, and so on back in time. The more problems you solve, the easier they get, so you should be able to make some real progress that way before you need to stop and do some research. (the harder problems are not harder because you're not smart enough to solve them, they're harder because they require techniques that you haven't learned yet - the cure for that is research)
Was This Post Helpful? 1
  • +
  • -

#15 Jleger91   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 28
  • Joined: 19-August 20

Re: How do I get ideas for daily code?

Posted 21 August 2020 - 12:21 PM

@jon
I see, so I have my work cut out for me. I have here problems to practice on, which is what I was asking for :D
If I have trouble because some problems require knowledge that I don't yet have, that encourages me to do research to learn.
It's worth noting that both research and learning new things are integral to programmers both in growing, and in the continued being as technology is always changing.

Should I ever be scared that technology is always changing since I'm just beginning? Won't I never be able to catch up? I know that I can't start worrying about what I haven't already done because what matters is always the next step that I choose to take. Say I'm 28yrs old now and are just getting started taking programming seriously and there are 7yr olds that dream of code, it's not worth feeling inadequate or not good enough comparing myself to others. Life isn't fair and that's just how it goes. Some people have the perfect upbringing and misfortune strikes anyway and tears their life apart. If I want life to start treating me fairly, I'll be waiting for quite some time. What matters is only the next step that I take, and always to keep taking the next step. I believe that programming is where my future should be and I want to see who I become as a result, and I fully intend to pursue this dream. Besides, Samuel L Jackson didn't become famous until he was 46. Fear of my age and of what younger people can do shouldn't impact how I feel about my future.

If I have trouble with these practice problems, I can always research and learn and grow and overcome the problem afterwards - almost like gaining experience and leveling up in an RPG to defeat a boss that's bigger and more powerful. But difficult problems are not impossible for me to solve, just because they seem scary at first.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2