I'm so lost I don't even know what I'm programming

I can't keep up with my side programming projects. They become to big for brainlet me and disintegrate into nothing after I leave it alone for months with no idea how to progress because it has become to big for me to maintain.

How are you guys able to maintain your large 5000+ lines of code on your side-project. It just seems wayyyyyy to hard.

>be me, write a lot of code for my side project for the day
>next day I log on to the computer to check out my source code
>realize I don't even remember I wrote this mammoth-lode of text and I am completely lost
and don't know where to begin

Because of this I end up writing retarded short snippets like this: pastebin.com/LzrMSZUP
where I don't even know what I am doing


How do you guys deal with this? How do you deal with writing walltexts of code that becomes to long for you to muddle through and deal with?

Other urls found in this thread:

en.wikipedia.org/wiki/Flowchart
en.wikipedia.org/wiki/Nassi–Shneiderman_diagram
youtube.com/watch?v=WghNRW4wFR4
ventrellathing.wordpress.com/2013/06/18/the-case-for-slow-programming/
en.wikipedia.org/wiki/Skeleton_(computer_programming)
twitter.com/SFWRedditImages

do you keep a log?
I always write down what I've accomplished so I can refer to it later. Also have a todo file with what I want to do next.

I don't keep a log, but I do keep a short set of notes that I never change so that I know what my end goal is.

You probably are writing it all in a single file like a mongoloid.

Make classes in separate files retard. Organize your code.

Realistically, you should only be working on one part at one time and the other things should just werk.

If you have to change everything just to implement one new thing, you're doing it wrong.

I used to spread things out in different files but it was STILL pretty hard to keep everything in mind. I started shitting everything into one file only recently to try a different way to see if it helps me gather everything in my mind easier

single file projects are okay when its like.... no more than 500 loc.

In python, i write functions in one file and the actual data in another file in which i just import the module i made earlier. Literal cable maintenance m8

So much this.

your snippet has literally zero comments. always document
you shouldnt have "walltexts"
ideally your functions shouldnt be longer than 100 lines
your project should be made up of mostly independent modular components so that you are only working on one thing at time

but I put all the data in data.py for example
and
import data
(in the same folder)
and
import data.py
doesn't work

my current working document is 7500 characters wide because data lists

I too used to document shit in past projects, but then all of a sudden documentation was all over the place just like the code and confused me even more

>data.py
it isn't supposed to work that way, the file extension is meant to be cut out

>If you have to change everything just to implement one new thing, you're doing it wrong

O BOI This happens all the time. I've tried so many ways to keep everything seperate and modular but each time I try to implement new stuff, I've to fiddle the asshole of every source file around.

Could be that pythons path to modules is different than the dir you are using.

Also no extensions

also try "from Data import * "

>add core feature to programming language
>need to change parser, statical analysis, code emitter, debugger, vm
>Realistically, you should only be working on one part at one time and the other things should just werk.

What annoys me the most in todays "programming" is that most just start and think as long as they keep a log it's fine but that's bullshit.

To produce anything of quality a planing stage is neccessary. You wouldn build a car or house without planning because you're clear that shit wont fit or just break. Why do retards assume it's different for programming?

If you did it right, you'll end up with mainly two things after the planning stage:

A flow chart en.wikipedia.org/wiki/Flowchart for a simplistic overview how the software is intendet to work.

and

Nassi–Shneiderman diagram(s) on how exactly it should be in detail.
en.wikipedia.org/wiki/Nassi–Shneiderman_diagram

With those programming will not only be easy as fuck but you'll also be able to find where you are and what is left to do at any stage of the project, no matter how many other project you got and how much time you have in between.

By just starting programming you're not only make your life unnessessarry difficult you're simply stupid and people should call you stupid wherever you go. Actually you should be beat up for being so damn stupid and prevented from touching computers.

you should use a kanban board user.
list all your goal feature.
focus on 1 or 2 feature.
after you have done that move it onto "done" and focus on the next feature.
i believe you can finish your shit user

Always write succint commits
Make small commits
End the day with a clean working tree (no modified files)
Check git log the next day

If its a bigger projwct you need aome project management tools. A WBS is good though a todo list is just as good.

This.

Until you know what data you're dealing with any how data flows through the major components of the system, you're just literally building ad-hoc protocols which will end up sucking big time.

Write some comments and pseudo-code.
Before I write a function/class, I build it with just comments. Like instead of talking to a compiler, I am talking to a human, telling them step by step what to do.

>load file
>check if its valid PDF
>if not, error 1
>parse the PDF into XML
>check if the company name is where expected
>if not, error 2
>check if positions 1 and 2 are valid names
>if not, error 3
>check if positions 5 and 6 are valid money sums
>if not, error 4
>check if positions 8 and 9 are valid dates
>if not, error 5
>delete the PDF file
>return the information gathered

And then I start writing code. That way I am never lost, and I have the overall design ready before I start writing.

what is OPs project even about?

you can put all python stuff in one single file; your editor/ IDE should show you the structure of your classes

dont worry, at least you're not this

>you're just literally building ad-hoc protocols which will end up sucking big time.
POSIX in a nutshell.

I don't even know. I wanted to make an AI neural network kind thing and just shat a bunch of code out.

I-is it g-good?

I feel you, bro. Last year I wrote a text editor in ANSI C. After fixing a bug my minibuffer implementation broke. Tried to fix this on a different machine only to learn that the forward search function segfaults on my laptop but not on my main rig. Looking at the code for an hour didn't help. Shit's too complex and I don't even know what I'm doing.

/blog

Keep a spec or something like a dictionary of concepts. Like
"Index - class responsible for keeping track of channels and their associated scheduled tasks

Registrar - class responsible for registering and removing channels by doing requests to Index".

...

How did you do afterwards? Did you re-write the entire thing in GNU C?

What is OP's IQ?

Give me an example of keeping data and code separate. It's pretty much impossible since classes in almost all projects have some static variables in them and some default values in the constructor

limited

You have LOTS of learning to do. Self-teaching won't do for serious projects.

statics don't change

One example is not having shitty configuration scripts in imperative scripting languages.

also
>classes

youtube.com/watch?v=WghNRW4wFR4

RIP dreams n eyedears

Use Emacs Org with Babel. You'll need to write your own stuff to make line numbers in your Org file March those in your tangled files, but Emacs 26.0.91 has ~display-line-numbers-mode~ where simple overlays can help you a lot. I don't know how to set a GDB breakpoint from Org, but you can open the tangled files in a separate buffer and jump to the line of interest in that buffer directly from Org. Then, you can mark your file up however you like.

It's got to be over 100 if OP could learn to program. I'm 120 and I'm just a uni drop out. OP needs to understand that he is actually a smart person. He just needs to use his smarts appropriately.

Well actually there may be courses online that teach you do manage projects properly, but you clearly haven't read the right ones.

>I'm 120
>that scam again

You need to study design patterns more
And do documentation

Use comments, soysmellz.

Learn your lesson and do refactors and redesigns before your code becomes incomprehensible.

I sleep maybe 5 hours.

Could you recommend me sum gud free ones maybe?

>How do you guys deal with this?

i dont use python

can you point in right direction for how to plan a programming project properly?

Get a fucking life and stop coding so dam much.
Your brain is turning to mush lifelet.

>posting nujacks

Ummm, wtf... how old are you? Do you have a formal education in Computer Science? Do you have a job as a software engineer?
Dear god.. it just gets worse and worse
The absolute state of fucking python coders
Learn an actual goddamn proper programming language that requires line termination. It's meant to teach sloppy ass idiots discipline.

How is it that you have soo many side programming projects but are unable to write proper code w/ comments and documentation. This is why I've always been offended by some dickhead asking about code projects in an interview. If you do any proper SOFTWARE DEVELOPMENT for a living, you're done after a full day. Your brain is worth shit and you have a life to live so that you can write BETTER code when the time comes. I'm absolutely convinced that people who churn out code Mon-Sunday create absolute abominations and need to go sit the fuck down some where and get a fucking life. Quality over quantity.

>anything bigger than 1kloc
>python
gee, I wonder where the issue could be

proper abstractions m8
a non-shit type system allows you to encode yer invariants (without going over the top with FP wankery)
and combining the two allows you to better manage complexity

don't despair tho
just persist and keep looking for how to improve yer shit

speaking of, got an example where you feel branlet, and why?

> Python
top kek.. I'll glad he said programming instead of code development. It's shit like this that reminds me of the difference between someone w/ a formal C.S degree and someone who writes 1000s of lines of hot garbage on github. Even w/ a C.S degree, some people are just code monkeys. If someone rambles on and on about the thousands of lines of code they're writing or how they forget after some time, I know they're either :
A.) Not writing anything of value
B.) Not a professional who knows how to abstract, organize, document, and comment their code
C.) A brainlet code monkey
D.) All of the above

Implying a retard like OP knows how to use git

no need to get that militant m8, unless you've been the victim of some severely delusional python code monkeys
then again, "measuring programming progress by lines of code is like measuring aircraft building progress by weight"

If you can't manage 5000 lines you wrote yourself, good luck getting a job writing software! I keep track of a 300k product and regularly add features, fix bugs, and generally maintain it.

Is what it is. Someone has to speak the cold hard inconvenient truth no one else wants to.

Tens of millions of lines of code here with tens of thousands of files. The code standard booklets are about 3 1000 page binders. Documentation/comments/spec docs/requirement docs separate the brainlet code monkey from the professional software engineer. Python developers need not apply. Go write some glue code between some shitty web app and back-end.

>speak the cold hard inconvenient truth no one else wants to.
do ho ho
if you think your sentiment isn't said just as often as the other side's, you're just as delusional as them
tho meme valley employers are more blatant at brainwashing and exploiting the fresh grads

ten gorrilion LoC here
the more LoC the bigger my e-peepee is
>what is accidental complexity

No this is a c++ codebase. I don't do python.

I wasn't joking about the code base size.
It's not about E-peen LOC. It's about reflecting on how such a large code base can be easily navigated and worked when its structured properly, documented, commented and conforms to standards. Something lost on OP which is why he's having the issues he is w/ a couple 1000s of lines of code.
C++ / Object oriented - Classes/objects
And you're still having issues? LOL, wtf..
Get your shit together.

I'm not OP. I'm 300k guy. It's all c++. I would shoot myself if I had to maintain 300k in python.

Comment your shit, organize your code, and make regular commits. That should help you out.

Cool. I mean.. 300kloc is the same as 30millionkloc if the code is structured/documented properly. I guess that was my point. If structured properly, you're never exposed to a considerable portion of it at once. Some universities drive this point home and thus its easily reinforced upon one's first professional job. Otherwise, fuck it. I've seen so many very interesting and useful github projects not be worth shit and garner no interest in terms of contributions because its structured like ass and lacks documentation.

>a large code base can be easily navigated and worked when its structured properly, documented, commented and conforms to standards.
absolutely
I fear this is not sufficiently well taught in our current IT/CS undergrad courses.
More case studies - war stories with counterexamples of how projects avoid the common pitfalls, a la extended versions of the AOSA book chapters, might help

OTOH that's prone to survivorship bias, not to mention the generations and generations of architecture astronauting fads that have been unleashed on the industry to make various cunts some money.

>large 5000+ lines of code on your side-project
write less code

How much design are you doing before you start coding? Ideally you should have written out how everything is going to work (on a basic level) ahead of time. It's tempting to just sit down and start banging out code, but the quality and coherence will go way up if you spend time designing it (not just in your head either, write shit down).

You're not going to find just a one-size-fits-all solution. There's different philosophies and goals of different design styles and they are each well-suited for different tasks.
I think your best bet would be to look for resources on software engineering, any good software engineering textbook would probably do.

how do you even come up with too many ideas? I can't even think of one thing to do

nu-wojack needs to fucking die

>design patterns
Meme

This is where software engineering comes into play. I’m a CS major now taking a SE class, I’d recommend everybody takes one.

You should try some VCS like git.

I'm surprisingly ok with this architecture, although I think you should give some explanation how it works.

> I fear this is not sufficiently well taught in our current IT/CS undergrad courses.
This should be drilled home in your junion/senior year. At my university, you were required to take a substantial project course that reinforced it. It was either mastered or you failed the course and werne't allowed to graduate. We completed requirements/spec/requirements traceability/interaction diagrams/code/design docs you name it. I also did a number of internships. Public sector was similar to this experience. I was actually shocked at how things were done in the private sector. Although things were documented/commented, there were large gaps w/ relation to systems understanding and out of date documentation.

> More case studies - war stories with counterexamples of how projects avoid the common pitfalls, a la extended versions of the AOSA book chapters, might help
Most definitely. However, this needs to be reinforced with a strict project course that reinforces these points. The course I took taught proper documentation/etc but allowed students to slack w/ a strong warning. Towards the end of the course, those who slacked on the documentation were fucked as the system came together and there were corner case bugs. Nothing like pulling your hair out and sleepless nights worrying if you're going to get an 'I' after a semester's worth of work to drive the point home to do proper documentation.

> OTOH that's prone to survivorship bias, not to mention the generations and generations of architecture astronauting fads that have been unleashed on the industry to make various cunts $.
Well, last I heard.. After my graduating class, the school started dumbing shit down due to the complaints and Reeing. Things appeared to have gone downhill since. I can recall vivid lessons some 10 years later that save my ass and separate me from other engineers. My code simply works (but I spend lots of time in structr/design) while others are plagued with timing/corner case bugs

I am all of these. How do I become better? I am literal mongoloid who can't write code.

Get a formal education in Computer Science or sign up for free course material from MIT/Stanford that teaches and reinforces these principals. Everyone wants to skip formal education now-a-days and then end up writing code like they've never had any formal structuring. Fuck Object oriented languages/python. Take a fucking proper course in C. If you can structure/comment/document and write bug free C code, the rest will be a cake walk.

OO langs can make mental organization easier it really depends on the project. Eitherway, proper SE and organization is needed for large programs.

jelly t-b-h
had a half-baked undergrad, combined with shite class/groupmates and me being a worthless go-with-the-flow. Gonna be one of the regrets of my life, but hey, no changing the past - might as well try to be less shit in the future.

I am studying Applied Math, second year in pretty good university here (top-3 around the country), and falling behind. Now our task is to write our own basic language with interpreter in C++. I am clearly behind my peers.

Is there a way I could catch them up?

prototype it in a better suite language, then translate to c++
I'm assuming you're mid-brainlet ATM, so go for python
note that as soon as the project gets big enough, python's dynamic typing's gonna show its downsides

or is this a group project? In that case try to push the group to use pseudo-code more often while doing dat shit

>falling behind.
more specifically?

> OO langs can make mental organization easier it really depends on the project.
Yeah, they teach them typically as the first language in College. It's training wheels. After one semester, you're supposed to move on to C and exhibit that you've captured the principals by structuring w/o training wheels.

> Eitherway, proper SE and organization is needed for large programs.
This is what separates a software engineer from a code monkey hacker.

Good attitude. I always feel, once you've identified the problem you're halfway done solving it. Next comes the will/desire to fix it. Luckily there's tons of course material available for free for one to improve. Top universities have free course materials online. This wasn't available when I was younger. I find it quit sad that there's shit tons more resources avail. that rarely get used. People's first habit is to go on a forum/reddit/Q&A/etc instead of simply googling things. This is where the bad practices set in.

But, when it comes to structure... it needs to be reinforced and lived in a consistent experience so it becomes second nature. I honestly question how this can be done w/o consequence and a strong imperative .. None of the good practices that go along w/ documentation/design/structure are fun in a learning capacity. So, w/o consequence/imperative, it's far too easy for the principals to not stick. When you have a dickhead professor breathing down your neck threatening to give you an 'I' if your interaction diagram arrow style is incorrect, the lesson really buries deep in your brain FOREVER.

I write comments in the project itself. I write notes in a notepad, and most importantly I write clean code. The last one is pretty hard for most people apparently, the amount of unmanageable spaghetti code people think is ok is ridiculous. I don't know if it's because they're lazy, or too stupid to work in a simple top-down manner. It's like no one ever told them you write code for people not computers, so you want it to read like a good English.

Read Robert C, Martin's Clean Code.

Only C/C++ is allowed, we can't use Python anywhere but Data Science shit. There's a book called "Write your own Lisp", but this is a fucking cheating and some of my groupmates have already taken it.

>falling behind
Previous task was to emulate prey/predator mechanics. I struggled with anything and had to look up for immediate solutions, to rewrite later. Staring at the screen like a retard, thinking how'd objects move on the grid, how to output it correctly, etc. I didn't have to meet the deadline since I have just transferred.

Same shit with math.

Listen to this guy :
Pseudo code and design.
Sketch out your approach in diagrams. Tweak and proof it until you feel its bullet proof. Then code from this. The last thing I do in software development is write code. By the time all of my design/mockups are done and proofed, it's should be a mental stream translation to code.

Segment functional pieces. Lego block common functionality and write tie ins. Revise your diagrams if you end up changing things in code.. Work from your diagrams always.

Essentially, you want to break function/objectives into subsystems and latch them together. You want to be able to visualize your efforts so as to SPOT errors/issues at a functional/subsystem level. Implementation is just translation.

It pisses me off how little philosophy/thinking is taught w.r.t to programming. Applied math? Take some Art/Philosophy/Formal Language course work. Seems you need to cultivate your mind some more.

> Previous task was to emulate prey/predator mechanics. I struggled with anything and had to look up for immediate solutions, to rewrite later. Staring at the screen like a retard, thinking how'd objects move on the grid, how to output it correctly, etc. I didn't have to meet the deadline since I have just transferred.
Essentially, your mind isn't IN it because you haven't placed anything in it so to speak... Turn the computer off... walk the fuck away from it..
Read this gem :
ventrellathing.wordpress.com/2013/06/18/the-case-for-slow-programming/

Brainstorm on paper. Organize your brainstorm ideas on another piece of paper.. Organize them. If it isn't looking cohesive do more background research on the task at hand (DO NOT LOOK AT SOLUTIONS) .. Google/research particular parts of the problem and go back to brainstorming/organization.

Write down your goal then break it down to sub goals.
Now form some approaches and solutions and diagram/gather them together.. Assume you have written the code to various subsystems/components, call it something, draw a box around it and put input/output lines on it.. Now connect the pieces together such that things function to achieve the goal. You now have a skeleton .. Write : en.wikipedia.org/wiki/Skeleton_(computer_programming)
Now author the complex code to complete the functionality. Update the diagrams if you make any structural changes.

You should never again have blank stare moments w/ this approach.

COMMENTS AND MORE COMMENTS TO REMIND YOURSELF OF WHAT IT IS THE FUCK YOU WERE THINKING WHEN YOU WROTE THAT MAMMOTH BLOCK OF CODE :DDDDD :PPPPPPP silly billy. also it helps to not ditch a project for 3 or 4 months of come back to a project you put on hiatus for years and years. silly jilly milly filly billy silly head

>Only C/C++ is allowed,
I assume they mean in the deliverables
I'd say using it for prototyping (as executable pseudocode) would even give them a good impression, as long as you don't present it in a dpt-language-cultist way
make sure to check with the groupmates and the prof/TA before investing effort - if the schedule allows
otherwise, just TIMEBOX a python prototype, translate to implementation, use the python prototype (translated to pseudocode) as a base for the project implementation overview documentation
> struggled with anything and had to look up for immediate solutions, to rewrite later.
sounds alright-ish when it's new material
>Staring at the screen like a retard, thinking how'd objects move on the grid, how to output it correctly, etc
sounds like your thought process and your implementation language were too far apart
it helps to build abstractions (e.g. functions) to do each of those functions - e.g. print the grid, print the grid with the cunts on it, have the cunts be objects, have move/die/etc behaviors as methods on these objects, etc

Well the thing is pure S.E. Guys get less mathematics/algorithm strength, but both C.S. And S.E. Are needed.

For me it was the reverse, we got only a minor intro with java, then most courses used C (I wish we learned C++ instead, need to explore that) because C was good for algorithms study especially.

Then in the later courses with projects that have to be more meaningful than smaller command line tasks, it goes back to java/python as the common languages.

Well, holy shit, much appreciated. I guess I have to practice more.
>dpt-cultish-way
There was a guy who asked for individual task, managed to get it done in Scala, and passed just fine, and another one implemented the prey/predator in 3D. I am fucking envious.

>guy who asked for individual task, managed to get it done in Scala, and passed just fine,
Easier than you might think - a'm fuckin around with scala, and I find plenty of shite which is much simpler to express (correctly) in it than in C/C++/Python/Java etc., especially when one uses it as Python++ with a useful type system and access to a comparably large ecosystem.
NB: it's got a bit of a FP wanker infestation tho - the "I wish I was getting paid to write haskal" crowd
Obvious disclaimer: there's plenty of shit where Scala's not the right answer too, and e.g. Python (or one of the others) might be a better fit.
if you're interested (and not pressed for time!), give the first (or first two) Scala Coursera courses a shot - could do with a bit less math, but it's doable shit. Also, try it with the Ammonite REPL - from-repl library fetching makes it even more comfy than ipython.
/shill

Thank you, again.

no worries m8
the pleasure of the "look at me, I'm so smart" circlejerk-disguised-as-help is all ours

This is literally the worst part of any project

>Tfw you leave code that doesn't serve any functional purpose solely because if it's not broken don't fix it
>remove code and the whole thing breaks

Notes, dicipline and tests.

I use notes and diagrams to explain stuff. If the project is worth sharing with people, I write the doxygen as a document, so people can read this and understand my code.
I also adhere to a programming style.
I mostly write C++, so I use the same programming style I use at work on my own projects.
It is very close to the boost programming style, so not anything weird, but if you have two solutions that are almost identical also look identical, it makes it a lot easier to read the code.
But testing is very important and I cannot stress this enough.
As soon as you sketch out what you want to do, you should describe how you want to test if it works.
When testing becomes an afterthought, you end up with test code intertwined with your actual code and it is a mess.
Ideally, your build server should run a test and reject your commits, but that might be overkill for weekend projects.

I don't know, I mainly learn project management in uni. And like the other said, there's no silver bullet. You should try working with others on big projects (big = outside of your comfort zone).

Does anyone have any clue as to how can I get they source code, for implementation with selenium in python, of a menu that appears after I click on a html link? Is in outlook 2010 owa, when selecting 'more options' in the draft new email pop up.

>ITT brainless who don't plan out thier program and write in on punchcards for back up

one of my most productive days was throwing out a hundred lines of kode -- some unix oldfag

but i don't expect a python brainlet like you to understand

look at existing projects and see how they handle their organization for a start

also make sure your commit messages are not just "fuck", "shit", "can you not", "fixed it", "aids", etc - but actually describe what you committed