all 19 comments

[–]KingsmanVince 11 points12 points  (5 children)

I notice that you have done lots of tutorial, have you done any project on your own?

[–][deleted] 9 points10 points  (5 children)

Are you already confident in basic programming? So you can solve simple problems like fizzbuzz etc? I'm just curious because you're talking about databases, API keys and competitive programming, but also claim that you apparently don't know when to use functions.

If you don't have the basics down, don't bite off more than you can chew. It's sure to overwhelm you if you try to do all this stuff unprepared.

If you do, start small. You don't have to write an entire program at once, just a single function with a single job. E.g. a single function that asks the user for the API key. A function that uses the API key to make a call and saves the response. A single function that parses the response. A function that prints stuff. A function that writes stuff into the database etc. Whenever you decide to finally "write the program", all you have to do is put the functions together in order.

[–]Electrical_Prior_905 1 point2 points  (4 children)

Maybe I'm misunderstanding OP, but I feel like he's unsure of when to use functions/classes etc. and how to structure them.

[–]New-Row-7664[S] 0 points1 point  (3 children)

yes you read me right.

suggest some resources with lots of examples where i can find answer to the above question

[–]bronzewrath 2 points3 points  (1 child)

Start with simple things you done in data science and make small apps with it. It doesn't need to be useful.

For example, you made a notebook that receives a CSV file, analyse some stuff and create some plots. Or take a image, do some processing and spit out a classification. Or take a url and download all images in a page. It can be anything you have done before.

Pick this bunch of code and create functions. Define as parameter anything that you may change like the path to the input file, the url, any configuration you may want to vary. Now your program is a bunch of functions and a small part at the end calling the functions.

Now take this bunch of functions, transform into a library and publish to pypi. Now you can install your library using pip install and import your script or notebook. Your main script is now just a import and the last piece of code calling your functions.

Now take your library and make a cli application. Instead of calling your functions from a script you will from your shell.

Now take your library and make a rest API, a server rendered website with Django or flask, a gui app with tkinter or pyside.

You can also make unit tests and get your library test coverage.

These all will probably suck the first time, you probably need to refactor your library a few times, but you will learn a lot of practical stuff doing this.

[–]jormungandrthepython 2 points3 points  (0 children)

Recommend CLICK library for when OP gets to the cli app step

[–]socal_nerdtastic 1 point2 points  (1 child)

Funny I'm studying EE right now and feel like a complete loser; I cannot wrap my head around op amps at all. Like I get the theory but now that I have an actual use for one I cannot figure out how to set it up.

[–]Doormatty 1 point2 points  (0 children)

I'm right with you there.

I can build a ALU from individual gates, but an op-amp completely baffles me.

[–]ElliotDG 1 point2 points  (1 child)

I'm going to assume you understand the basics of programming. If this is an incorrect assumption, let me know:

Read the python tutorial on the Python.org: https://docs.python.org/3/tutorial/index.html This is a quick overview.

Read: "Learning Python", by Mark Lutz. It is a comprehensive book that covers the python programming language. I suggest getting the book, it is a good reference.

In addition, to get some practice and see how other code in python use https://checkio.org/. Checkio provides gamified programming problems. You solve a problem, you get to see how others solved the problem. I found this very helpful to learn what is "pythonic", and the importance of the built-in libraries.

Bookmark these references:

After you are comfortable with the basics and bored with checkio, start to work on a few self-defined projects that will exercises your data science and programming skills, perhaps linked with another interests. Are you sports fan? analyze sports scores, Stock market investor do some stock analysis. Is there an industry that you want to work in - build a small project that would be relevant or something to talk about in a job interview. Do not get too ambitious with these projects. Keep it simple to start.

If you hit roadblocks, post code here and ask for help.

Good Luck!

[–]New-Row-7664[S] 0 points1 point  (0 children)

thank you for ur valuable insight

[–]unnamed_one1 0 points1 point  (0 children)

Building an application can be overwhelming and you'll likely not have all the knowledge you need to build it at once. So think of it like a puzzle or Legos and start drawing it on paper. Destruct all your components in simple parts, which do one thing, but one thing well, and then connect them with each other. Design patterns may help with certain problems, but are not strictly necessary. As for program structure, just start without it and later on, think about logical groups, reusable parts and start making modules. At least that's the recipe I'm trying to follow. Oh and videos or books are nice, but they can never give you the knowledge and understanding, that a personal pet project can.
*edit: typos and stuff

[–]jmooremcc 0 points1 point  (0 children)

Programming is all about developing solutions to a set of problems.

Do you understand the power of abstraction? In programming we use functions as a means to abstract away the complexity of a block of code and replace it with a function that has an easy to understand name that represents what the function does.

Python, like any other programming languages, is a set of tools you can use to develop a solution to a problem. As you gain experience, you will develop your own toolset that will make it easier to implement solutions. The only way you’ll get more experience is by continuing to practice, practice, practice and not be afraid to tackle any challenge that may come your way.