Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "write code in comments"
-
When CS professors are lazy to grade so they think they can just give you any grade without you questioning them...
Me: Hi Professor, I see I got a 94 out of 100 on my 2nd project. Your comments said, some of my functions didn't pass your junit test cases.
Prof: Yes!
Me: How come? I tested it several times before submitting and they all passed the test cases. You gave us the test cases to write the code for.
Prof: Yeah, but some of your functions aren't passing on mine.
Me: Since I'm in your office, can you please run it again so I can see?
Prof: Are you doubting me? I gave you the project and I'm telling you they're not passing my test cases.
Me: I just want to make sure because I did work really hard on this project to pass all the test cases. *Runs the code to show him on my laptop and they all pass*
Prof: Fine, let's run it together on mine again. *He runs it and they all pass on his laptop*..hmm, that's weird. They didn't pass when I ran them. Maybe, because of the IDE I used earlier.
Well, looks like you get your 100.
Me: Thank you but which IDE did you ran it in that failed? Just wondering..🤔
Prof: Doesn't matter now...they're passing. Just be ready for your next project...you guys will be writing the test cases yourself this time..9 -
I sometimes write code by first putting comments and then writing the code.
Example
#fetch data
#apply optimization
#send data back to server
Then i put the code in-between the comments so that i can understand the flow.
Anyone else has this habit?18 -
Manager: Hey how come you left so many comments on my PR?
Dev: Well you’ve just recently learned how to code so there’s going to be a lot of things to learn beyond what you’ve picked up in your online coding tutorials. Don’t worry it’s only minor things like you put everything all in one function, left outdated comments in the code, have if statements 4 levels deep, have a console.log after every line of code some of which log .env variables, skipped error handling, cast to “any” a bunch instead of using more specific types, didn’t write any tests and some unrelated tests are now failing due to a circular dependancy.
Manager: THAT IS SO DISRESPECTFUL!!APPROVE MY PR IMMEDIATELY. IT WASN’T EVEN EASY FOR ME TO CREATE THE PR, NOW I HAVE TO MAKE AN UPDATE!? YOU’RE THE DEV, YOU SHOULD FIX IT NOT ME!! NEVER COMMENT ON ANY OF MY PRS AGAIN.10 -
I'm a new developer. Here is the top advice I've received:
0. Think like a programmer, outside of work too.
1. Programming is tough. It takes a certain kind of mindset to sit in front of a monitor and think it through a problem till the end. Develop that mindset.
2. Handwork pays.
3. Do it for fun. Be exceptional. Money will follow.
4. Care about the craft you build. Write such a beautiful code that your fellow devs would think about your code and have a nerdgasm.
5. Simple is beautiful. Anybody can make things complex. It takes a stroke of genius to make things simple.
6. Write modular code. It makes your code reusable and easy to maintain. Future developers who will work on your piece of code will appreciate it.
7. Share your knowledge. Unlike materialistic things, knowledge grows when you share it.
8. Add comments. You think you'll remember why you wrote that piece of code that way or a clever hack you created but trust me, you won't.
9. Be humble. You'll never know everything. Don't hesitate to ask for help.
10. Writing code is exciting! Of course there will be some frustrating moments. But don't give up! You'll miss a lot of fun.5 -
I am sure this has happened to all of us in some extent with some variations.
Colleague not writing comments on code.
Ask him something like "How am I suppose understand that piece of garbage you have written when there is no comments or documentation?"
This keeps happening for a long time. Some time after, I write a kernel module using idiomatic C and ASM blocks for optimizations (for some RTOS) and purposely not write neither documentation nor comments.
When he asked for an explanation, I answered to everything he questioned as general as I could for "that trivial piece of code".
After that he always documents his code!
Win! 🏆4 -
Gunnery Sgt. Hartman:
What do you code, anyway?
Pvt. Cowboy:
SIR, JAVA, SIR!
Gunnery Sgt. Hartman:
JAVA? Holy dogshit! Only steers and queers code in Java!! And you don't much look like a steer to me so that kind of narrows it down. Do you suck dick?
Pvt. Cowboy:
SIR, NO, SIR!
Gunnery Sgt. Hartman:
I BET YOU'RE THE KIND OF GUY WHO'D WRITE LEGACY CODE AND NOT HAVE THE COMMON COURTESY TO WRITE ANY COMMENTS.8 -
About 18 months ago my non-technical Manager of Applications Development asked me to do the technical interviews for a .NET web developer position that needed to be filled. Because I don't believe in white board interviewing (that's another rant), but I do need to see if the prospective dev can actually code, for the initial interview I prepare a couple of coding problems on paper and ask that they solve them using any language or pseudo code they want. I tell them that after they're done we'll discuss their thought process. While they work the other interviewing dev and I silently do our own stuff.
About half way through the first round of technical interviews the aforementioned manager insisted we interview a dev from his previous company. This guy was top notch. Excellent. Will fit right in.
The manager's applicant comes in to interview and after some initial questions about his resume and experience I give him the first programming problem: a straightforward fizzbuzz (http://wiki.c2.com/?FizzBuzzTest). He looked as if the gamesters of Triskelion had dropped him into the arena. He demurs. Comments on the unexpectedness of the request. Explains that he has a little book he usually refers to to help him with such problems (can't make this stuff up). I again offer that he could use any language or pseudo code. We just want to see how he thinks. He decides he will do the fizzbuzz problem in SQL. My co-interviewer and I are surprised at this choice, but recover quickly and tell him to go ahead. Twenty minutes later he hands me a blank piece of paper. Of the 18 or so candidates we interview, he is the only one who cannot write a single line of code or pseudo code.
I receive an email from this applicant a couple of weeks after his interview. He has given the fizzbuzz problem some more thought. He writes that it occurs to him that the code could be placed into a function. That is the culmination of his cogitation over two weeks. We shake our heads and shortly thereafter attend the scheduled meeting to discuss the applicants.
At the meeting the manager asks about his former co-worker. I inartfully, though accurately, tell him that his candidate does not know how to code. He calls me irrational. After the requisite shocked silence of five people not knowing how to respond to this outburst we all sing Kumbaya and elect to hire someone else.
Interviews are fraught for both sides of the table. I use Fizzbuzz because if the applicant knows how to code it's an early win in the process and we all need that. And if the applicant can't solve it, cut bait and go home.
Fizzbuzz. Best. Interview. Question. Ever.6 -
Add no comments or documentations whatsoever during my initial years of coding (when actually I used to write code worse than a constipated elephant's shit).. In my mind I would be like "This is quite clear-cut.. A first grader will be able to understand this code.."
But then I had to debug my own code barely some 1-2 months later and I figured out the importance of good comments and documentation..3 -
I have a junior who really drives me up a wall. He's been a junior for a couple of years now (since he started as an intern here).
He always looks for the quickest, cheapest, easiest solution he can possibly think of to all his tickets. Most of it pretty much just involves copy/pasting code that has similar functionality from elsewhere in the application, tweaking some variable names and calling it a day. And I mean, I'm not knocking copy/paste solutions at all, because that's a perfectly valid way of learning certain things, provided that one actually analyzes the code they are cloning, and actually modifies it in a way that solves the problem, and can potentially extend the ability to reuse the original code. This is rarely the case with this guy.
I've tried to gently encourage this person to take their time with things, and really put some thought into design with his solutions instead of rushing to finish; because ultimately all the time he spends on reworks could have been spent on doing it right the first time. Problem is, this guy is very stubborn, and gets very defensive when any sort of insinuation is made that he needs to improve on something. My advice to actually spend time analyzing how an interface was used, or how an extension method can be further extended before trying to brute-force your way through the problem seems to fall on deaf ears.
I always like to include my juniors on my pull requests; even though I pretty much have all final say in what gets merged, I like to encourage not only all devs be given thoughtful, constructive criticism, regardless of "rank" but also give them the opportunity to see how others write code and learn by asking questions, and analyzing why I approached the problem the way I did. It seems like this dev consistently uses this opportunity to get in as many public digs as he can on my work by going for the low-hanging fruit: "whitespace", "add comments, this code isn't self-documenting", and "an if/else here is more readable and consistent with this file than a ternary statement". Like dude, c'mon. Can you at least analyze the logic and see if it's sound? or perhaps offer a better way of doing something, or ask if the way I did something really makes sense?
Mid-Year reviews are due this week; I'm really struggling to find any way to document any sort of progress he's made. Once in a great while, he does surprise me and prove that he's capable of figuring out how something works and manage to use the mechanisms properly to solve a problem. At the very least he's productive (in terms of always working on assigned work). And because of this, he's likely safe from losing his job because the company considers him cheap labor. He is very underpaid, but also very under-qualified.
He's my most problematic junior; worst part is, he only has a job because of me: I wanted to give the benefit of the doubt when my boss asked me if we should extend an offer, as I thought it was only fair to give the opportunity to grow and prove himself like I was given. But I'm also starting to toe the line of being a good mentor by giving opportunities to learn, and falling behind on work because I could have just done it myself in a fraction of the time.
I hate managing people. I miss the days of code + spotify for 10 hours a day then going home.11 -
Currently, I am going through a legacy application built in microsoft access back in 90s.
* No Comments
* No Relationships between tables
* Random code that does nothing
* Weird form layouts
* Weird naming conventions
I need to copy this functionality into modern version using SQL Server Management studio and asp.net core, I also need to kill myself because none of this fucking shit fucking fuck makes sense.
I do my best to write clean and concise code along with comments but after this ordeal I am going to up my game because nobody should need to suffer through spaghetti code and stupid logic that is uncommented.
😶6 -
Ok, so teacher (which should be something like a professional dev or whatever) assigned us a homework for a Christmas (I dont care, I can complete his assignments in like 10 minutes max). We have to do some simple shit in C++, just some loops and input + output. Nothing hard. He challenged me to write it as short as possible, so I did. My classmates have codes around 60 to 70 lines long (after propper formating). I made it 20 lines long using some pointer magic and stuff like that. I tried my code, it ran fucking perfectly, so I sent that to him. He replied that the code does not work. I tried to recompile it and it ran perfectly. Again, it does not work. Afeter 13 fucking emails he fucking finally sent me the error message. Some fucntion was not found (missing some library but literally everywhere else it works without it...). Thats strange, because it run perfectly on my Fedora with CLion, so I switch to Windows and try to run same code in Visual Studio (which we are using in school btw). Works perfectly. So I start arguing with the teacher more and more. I tried around 10 online compilers. Works fuckng everywhere. Teacher is pissed, me too. So I rewrote my whole code, added comments and shit, reinvented wheel literally everywhere. Now I have C99 standardised code over 370 lines long that run even on a fucking arduino after changing input output methods so it can work with it. It (suprisingly runs) on his PC too.
After a bit more arguing, he said that he is using CodeBlocks from fucking 2015. Wow. Just fucking wow. Even our school has some old Visual Studio (2007 I guess) and it worked there.6 -
I spent over a decade of my life working with Ada. I've spent almost the same amount of time working with C# and VisualBasic. And I've spent almost six years now with F#. I consider all of these great languages for various reasons, each with their respective problems. As these are mostly mature languages some of the problems were only knowable in hindsight. But Ada was always sort of my baby. I don't really mind extra typing, as at least what I do, reading happens much more than writing, and tab completion has most things only being 3-4 key presses irl. But I'm no zealot, and have been fully aware of deficiencies in the language, just like any language would have. I've had similar feelings of all languages I've worked with, and the .NET/C#/VB/F# guys are excellent with taking suggestions and feedback.
This is not the case with Ada, and this will be my story, since I've no longer decided anonymity is necessary.
First few years learning the language I did what anyone does: you write shit that already exists just to learn. Kept refining it over time, sometimes needing to do entire rewrites. Eventually a few of these wound up being good. Not novel, just good stuff that already existed. Outperforming the leading Ada company in benchmarks kind of good. At the time I was really gung-ho about the language. Would have loved to make Ada development a career. Eventually build up enough of this, as well as a working, but very bad performing compiler, and decide to try to apply for a job at this company. I wasn't worried about the quality of the compiler, as anyone who's seriously worked with Ada knows, the language is remarkably complex with some bizarre rules in dark corners, so a compiler which passes the standards test indicates a very intimate knowledge of the language few can attest to.
I get told they didn't think I would be a good fit for the job, and that they didn't think I should be doing development.
A few months of rapid cycling between hatred and self loathing passes, and then a suicide attempt. I've got past problems which contributed more so than the actual job denial.
So I get better and start working even harder on my shit. Get the performance of my stuff up even better. Don't bother even trying to fix up the compiler, and start researching about text parsing. Do tons of small programs to test things, and wind up learning a lot. I'm starting to notice a lot of languages really surpassing Ada in _quality of life_, with things package managers and repositories for those, as well as social media presence and exhaustive tutorials from the community.
At the time I didn't really get programming language specific package managers (I do now), but I still brought this up to the community. Don't do that. They don't like new ideas. Odd for a language which at the time was so innovative. But social media presence did eventually happen with a Twitter account that is most definitely run by a specific Ada company masquerading as a general Ada advocate. It did occasionally draw interest to neat things from the community, so that's cool.
Since I've been using both VisualStudio and an IDE this Ada company provides, I saw a very jarring quality difference over the years. I'm not gonna say VS is perfect, it's not. But this piece of shit made VS look like a polished streamlined bug free race car designed by expert UX people. It. Was. Bad. Very little features, with little added over the years. Fast forwarding several years, I can find about ten bugs in five minutes each update, and I can't find bugs in the video games I play, so I'm no bug finder. It's just that bad. This from a company providing software for "highly reliable systems"...
So I decide to take a crack at writing an editor extension for VS Code, which I had never even used. It actually went well, and as of this writing it has over 24k downloads, and I've received some great comments from some people over on Twitter about how detailed the highlighting is. Plenty of bespoke advertising the entire time in development, of course.
Never a single word from the community about me.
Around this time I had also started a YouTube channel to provide educational content about the language, since there's very little, except large textbooks which aren't right for everyone. Now keep in mind I had written a compiler which at least was passing the language standards test, so I definitely know the language very well. This is a standard the programmers at these companies will admit very few people understand. YouTube channel met with hate from the community, and overwhelming thanks from newcomers. Never a shout out from the "community" Twitter account. The hate went as far as things like how nothing I say should be listened to because I'm a degenerate Irishman, to things like how the world would have been a better place if I was successful in killing myself (I don't talk much about my mental illness, but it shows up).
I'm strictly a .NET developer now. All code ported.5 -
Question everything!
Comments lie.. sometimes code does too.. Customers..they lie the most..and are sloppy..
Don't be like customers, don't be sloppy. If you were sloppy own it & don't lie about it!
Pick your fights (trying to fix vs rewrite the shit out of it)..you will know what to do more with experience..
RTFM & docs.. If things still unclear, ask before your dick gets stuck in a toaster!
Ask away, learn about the customers & how they use your product.. you'll be surprised how something intuitive to you might be a rocket science for them..meaning more room to fuck things up when using it..more ways you can adapt & prevent things..
Most of all, don't fuckin lie.. ever!!
If you lie on you're CV, we will find out.. If you fuck up something & lie about it, we will find out.. but it will cost us precious time when solving it from scratch.. People fuck up..that's a fact..how you go about it is what makes/breaks it for me. So don't ever fuckin lie to me!!
And don't be arogant.. if you complain about fixing bugs, this is not a job for you.. if you can't even fix the obvious ones you've put there in the first place..twice as bad..
So think before you code..what do you want to do, how you want to accomplish this, is it reusable, can it be extended, does it introduce new technology into the project, will it fuck up current setup.. once you have this shit figured out, code will write itself..
Did I mention already you're not to lie to me, ever?!
And don't try talking about me behind my back either..I've seen it backfire before, results were not good..3 -
!rant but story
https://devin.xyz (v.0.0.1)
My quick and semi-ugly solution to save amazing rants and comments forever and more organized.
What it is and it will be:
- archive of rants and comments from devrant that I found very good
- the original ranters will be informed when their rants are archived
- the original ranters and/or the management team of devRant has the right to request the archive content's total deletion
- every single thing on there will be accessible by anyone anytime anywhere (as log as server is healthy)
- open-source
What it may become:
- anyone can register and save their archive
- dev content archive from other sources
- dev articles blog
What it will never have/be:
- any form of payment
- ads
- tracking (I don't even wanna know how many users are viewing)
- non dev related content
- devRant
I'm willing to create user accounts for anyone interested in very near future. So please buzz me here if you want one.
So far it's a website of Laravel + Voyager + bulma with very minimal custom codes (I had to write below 100 lines of code in total). It is on Vultr server.
I'm gonna maintain and update as much as I can on my spare time. Hence I don't consider this as a collab. However, the code is on gitlab private repo. I'll make the repo public soon as well. Any contribution is gladly welcome. 😄10 -
FFS stop squashing commits. If “updated comments” is what the commit was it should show it in git blame. If “fixed null check” is what the commit was it should show it in git blame.
There is no reason to have “ticket-234 service revision” beside 1000 lines of code. How does anyone justify this loss of git info for the sake of “clean history”? Nobody looks at your history and says, “That is bloody clean git history I should write home about it.” People do however look at the code and say, “I wish I knew WTF they were trying to do on that line.”16 -
University, Italy
We have sent our code to the professor for correction.
Professor : Who wrote the code with comments in english?
Proud student : me !
Professor : you failed to write the algorithms, and also made mistakes with a lot of English words.3 -
I don't know if I'm being pranked or not, but I work with my boss and he has the strangest way of doing things.
- Only use PHP
- Keep error_reporting off (for development), Site cannot function if they are on.
- 20,000 lines of functions in a single file, 50% of which was unused, mostly repeated code that could have been reduced massively.
- Zero Code Comments
- Inconsistent variable names, function names, file names -- I was literally project searching for months to find things.
- There is nothing close to a normalized SQL Database, column ID names can't even stay consistent.
- Every query is done with a mysqli wrapper to use legacy mysql functions.
- Most used function is to escape stirngs
- Type-hinting is too strict for the code.
- Most files packed with Inline CSS, JavaScript and PHP - we don't want to use an external file otherwise we'd have to open two of them.
- Do not use a package manger composer because he doesn't have it installed.. Though I told him it's easy on any platform and I'll explain it.
- He downloads a few composer packages he likes and drag/drop them into random folder.
- Uses $_GET to set values and pass them around like a message contianer.
- One file is 6000 lines which is a giant if statement with somewhere close to 7 levels deep of recursion.
- Never removes his old code that bloats things.
- Has functions from a decade ago he would like to save to use some day. Just regular, plain old, PHP functions.
- Always wants to build things from scratch, and re-using a lot of his code that is honestly a weird way of doing almost everything.
- Using CodeIntel, Mess Detectors, Error Detectors is not good or useful.
- Would not deploy to production through any tool I setup, though I was told to. Instead he wrote bash scripts that still make me nervous.
- Often tells me to make something modern/great (reinventing a wheel) and then ends up saying, "I think I'd do it this way... Referes to his code 5 years ago".
- Using isset() breaks things.
- Tens of thousands of undefined variables exist because arrays are creates like $this[][][] = 5;
- Understanding the naming of functions required me to write several documents.
- I had to use #region tags to find places in the code quicker since a router was about 2000 lines of if else statements.
- I used Todo Bookmark extensions in VSCode to mark and flag everything that's a bug.
- Gets upset if I add anything to .gitignore; I tried to tell him it ignores files we don't want, he is though it deleted them for a while.
- He would rather explain every line of code in a mammoth project that follows no human known patterns, includes files that overwrite global scope variables and wants has me do the documentation.
- Open to ideas but when I bring them up such as - This is what most standards suggest, here's a literal example of exactly what you want but easier - He will passively decide against it and end up working on tedious things not very necessary for project release dates.
- On another project I try to write code but he wants to go over every single nook and cranny and stay on the phone the entire day as I watch his screen and Im trying to code.
I would like us all to do well but I do not consider him a programmer but a script-whippersnapper. I find myself trying to to debate the most basic of things (you shouldnt 777 every file), and I need all kinds of evidence before he will do something about it. We need "security" and all kinds of buzz words but I'm scared to death of this code. After several months its a nice place to work but I am convinced I'm being pranked or my boss has very little idea what he's doing. I've worked in a lot of disasters but nothing like this.
We are building an API, I could use something open source to help with anything from validations, routing, ACL but he ends up reinventing the wheel. I have never worked so slow, hindered and baffled at how I am supposed to build anything - nothing is stable, tested, and rarely logical. I suggested many things but he would rather have small talk and reason his way into using things he made.
I could fhave this project 50% done i a Node API i two weeks, pretty fast in a PHP or Python one, but we for reasons I have no idea would rather go slow and literally "build a framework". Two knuckleheads are going to build a PHP REST framework and compete with tested, tried and true open source tools by tens of millions?
I just wanted to rant because this drives me crazy. I have so much stress my neck and shoulder seems like a nerve is pinched. I don't understand what any of this means. I've never met someone who was wrong about so many things but believed they were right. I just don't know what to say so often on call I just say, 'uhh..'. It's like nothing anyone or any authority says matters, I don't know why he asks anything he's going to do things one way, a hard way, only that he can decipher. He's an owner, he's not worried about job security.13 -
Yes, my Python scripts are not remotely pretty. But then, neither was my nonexistent formal training in scientific computing. And no, I will not 'write two lines of comments for every line of code'. Physics major programmer problems.1
-
So I have to fix this motherfucking insane regex with over 1k chars in it ...
This fucking shit is not maintainable and there are no comments or any other sort of documentation.
And this bullshit was not build via code so that bastard wasted weeks of time to develop that shitty expression by hand on a online regex tester website.
So I have 3 options:
1. Reverse engineer everything and waste my precious time
2. Delete that shit, analyze the input and write the regex via code instead of creating it by hand
3. Look for that "super duper clever" dev and break his legs.
I think option 3 suits me best.
And for you dear reader, if you are regexphile, enjoy this gigantc regex with >16k chars:
http://madore.org/~david/weblog/...7 -
I spent the last weeks rewriting a huge project which I had to hurriedly write a year ago. No comments, no documentation, spaghetti code. Part me was an asshole! But now I am done, all is new, everything is well commented, structured in classes with well defined tasks. Yay.2
-
So recently my open source project took off and got trending on GitHub (680 starts and 225 forks). This was the first time a project of mine really gained some traction and invested more of my time and weekends to maintain this project - I wrote comprehensive docs, contributing guidelines and reviewed PRs and made sure I commented on every single one of them. Sure, it isn't easy to review 50 PRs a day after coming home from work but the excitement of seeing this project becoming trending fueled me.
First 2 weeks it was good. I would come home from work and have dinner and sit down to maintain the project. Whenever contributors would be stuck, I would help them and write comments on each PR.
But the problem started since last week. People just really want to see their contribution activity graph get populated and hence they would make stupid PRs and literally no one followed contributing guidelines - I mentioned in that that the code should adhere to Pep8 styling but no one gave a shit. Each day I would spend reviewing PR with crappy formatted code and no sign of Pep8, and even some will just file PR and add a fucking docstring to every function or add paragraph of comments. Also, the PR quality was bad with unsquashed commits amounting to 10 or 20 or even sometimes 50.
I wrote the contributing guidelines doc and in that I mentioned every source that contributors could find helpful like how to squash commits, how to file a PR and Pep8 and not to write useless comments. Seriously people, grow up!6 -
I knew someone that typed with only 2 fingers ( index fingers )
There were no comments in the code because, it would take ages to write a sentence.
I don't know how someone that was born with a laptop in her lap doesn't know how to use all the fingers to type.
But, for her this was just a job. No personal projects, no will to learn new things. Just do the work they give her, as slowly as possible.
I remember I forced myself to learn how to type using all fingers when I was little. Now I even rebind the movement keys on games because is more comfortable to use "the right keys" ( I hate wasd, esdf ftw!)
How about you, do you know anyone that-s bad at typing?11 -
Spent all morning trying to write a JSON parser in Python just to get a bit of practice (technical interview next week).
After an hour or more... Didn't get far and finally gave up...
Then I remember Python has a built-in json module... (yea no need to write in myself).
Since libraries are just py files, I open the source code... And wow!
All the public methods are nicely documented with informative comments and descriptions.
But then I look at the method calls and .... I don't understand what it's doing....
.............................. ☹️🙁😖😢😭😧😰😱3 -
When I say I code I mean I write fake HTML comments in the WordPress editor when the Client is watching me work so he doesn’t feel bad for paying me a month’s salary for doing what a 14 y/o is able to accomplish within two hours of googling
-
I really think there should be a subject in every CS course to teach us how to handle/work-under Grade-A assholes and dumbfucks. Not that it would help, but atleast warn us on what we are getting into.
In my opinion, development is not *that* hard or frustrating but is made so by these shitty people. But again, what do I know.
I was scolded by my boss for using for-loop to iterate through an array recently. Apparently for-loop is not used in real world projects and this iteration should be done "in-memory". My colleagues and I are still trying to understand and process that.
I was asked to add fitbit integration to a project within 2 hours just because I had "already done it a week ago" in *another* project. Luckily, it was then given to a "senior" developer who took 4 days for it and essentially copy-pasted my work without much changes, ofcourse it stopped working every now and then.
I am given unreal deadlines on my tasks, on technologies I haven't worked on before, and then expected to churn out production ready code with no bugs in them.
My boss literally just sends me the links of 1st three google results on the problems I encounter and report, after humiliating me ofcourse. Yes, I did google it and yes I went through all I could find from Google forums to GitHub issues. When the library/plugin author himself says that this feature is not yet available, don't expect me to develop it in 2 hours you dumbfuck.
And for the love of God, please stop changing the data model every single day and justify it with agile development. Think before making any changes to it. Ever heard of Join queries? Foreign keys? Or any other basic database concepts.
We reached a point where each branch in the repo had different data model. Not kidding. And we were a team of just 4 developers. Atleast inform us when you change models after discussing it with your shit for knowledge "senior" developer, so we don't have to redo it all over again. The channels on slack are not for sharing random articles only.
I am just waiting to complete my year here.
I should have known what I got myself into the day he asked me to remove the comments I had added to explain what my code does. Why you ask? Because "we don't write comments". -
AI is the future, and it's a future I want to be part of.
This week was very stressful, beside my usual depression and personal issues, I've received a lot of difficult tasks at work, to do in a very short amount of time.
Things I never did, tecnologies I've never used, and for a potential client that is critical for the company at this period in time, and if we won't be able to satisfy their requests we could go bankrupt really soon.
A lot of responsibility, almost no time and a person not competent enough to do it (me), especially on a hurry.
I couldn't sleep in these days, I couldn't think peacefully, concentrate to find the best solutions. I had really bad thoughts.
I couldn't find any useful solution online, on stackoverflow, forums, etc. and I spent hours searching them.
For who knows me here on devRant, probably knows also that I tend to work with old legacy code and dead languages as VB6 and VB.NET.
So integrate "new fancy stuff" isn't that easy and there are no documentation and examples to relay on.
I had fear to even try to understand the documentation (for other languages) and try to write code for it… I was panicking.
With no more ideas, I've decided to try to ask ChatGPT for help.
In maybe 3 or 5 seconds it was able to generate the solution, in VB.NET, with comments and all the explanation needed to understand it and integrate it correctly in my software.
With a few other requests it was able to change it to make it fit better my scenarios.
It's truely unbelivable how the tecnology advanced in the last years, how a computer on the other side is able to reply to my questions with answers that I couldn't find anywhere, because they probably never existed for my case, in VB.NET especially.
ChatGPT made my day, and allowed me to end this stressful moment and give me time to relax and focus on more important personal stuff this weekend.5 -
Typical code life?
1. Write rough comments
2. Write more detailed comments
3. Write pseudo code
4. Write semi-working but definitely ugly code
5. Write working but very ugly code
6. Refactor the code to be nicer, check for patterns, bottlenecks and other bits and pieces
7. Push to git the "final" code
8. After few months blame whoever wrote the code
9. Refactor all the things!
---
This happened in my career more than once and still - it seems like the best option out there to get things done. What do you guys think? Should something be added/removed from this? Is this over-complicated or what?2 -
HOW. IN THE WORLD. COULD IT BE SO DIFFICULT TO COMMENT THE CODE I WRITE MYSELF ?
After my first project (you know, the "Working project I made for fun long ago" code everyone did once, but when you look at it again it looks like sorcery and there's no way to understand it ?), I decided that I'd comment almost everything I'd do... But...
When I begin a project, it's fiiiine and I do my comments the way they should be... AND THEN, WHEN DIFFICULTIES ARRIVES AND I START TO BE TIRED (ie : always) THEY START TO INCLUDE INSULTS OR WEIRD JOKES ABOUT THE PROGRAMMING LANGUAGE, MOVIES REFERENCES, AND SOMETIMES THEIR LANGUAGE VARIES. (Like, that project you're doing in English and suddenly there's a comment written in French in the middle of that)
Soo, yeah, even if I do comment my shit now, it isn't more helpful, lol. Maybe I should listen to relaxing music when I code err.
Oh, comments. Damn comments. Someday I'll do those correctly. Maybe.8 -
*Pro tip:* add comments in your code stating what you're gonna write next! This helps the reader to know what to expect!
[filename EventsTable.js]15 -
I have been very inactive in these last couple of months but I really need to rant right now:
I am working on a project, which is also part of a contest, with a few of my friends. I asked one of them to write a bit of code and some documentation about it, here's the result:
He wrote half a page of text with plenty of spelling mistakes and grammatical errors but here comes the even worse part:
Instead of just leaving the code in its own file he copied it into the word (libre office writer) file as well. Now I have got 3 pages of non-indented code with a few comments flying around here and there, weird variable names and a lot of commented out pieces of code.
Bloody hell I feel like I am the only one in this team taking this contest serious.3 -
OK people, I don't need a novel written for every line of code, but PLEASE STOP trying to tell me that "yOuR coDe sHouLd bE sELf dOcUmeNtiNg aNd cOmMenTs mEaN iT's aUtoMaTiCaLLy bAd". That's a bunch of BS. I can't begin to tell you how many times I've saved my own butt by dropping a "this call can't be awaited; causes the library's internal API to throw an error" comment in my C#, or a "can't use double quotes here; doesn't work right for some reason" line in my JavaScript. Sometimes there are very good but un-obvious reasons why something was done a certain way, even though it looks like it could be done better. And don't try to tell me "the tests will catch it". Let's be realistic here, nobody has 100% test coverage on any project that's much more than "Hello World". And even if the tests DID catch it, why waste the time when you could just write a comment?
P.S.: This is not directed at anyone on here specifically. It's directed at all the devs I've met IRL and the comments I've seen on SO, who think that comments must be bad.12 -
Hey this is the first time i post here.
I just started working part-time for this company last week. What i have to do is to change some windows from Win32 to WPF. As i was reading the legacy code i just had to sigh man. They have like 100 projects in a single solution, from C++ to C#, everything acctached to each other, with almost NO comments or docs. Wtf man? I don't know how it actually works in the industry (this is my first dev job) but when you write fucking 20 classes with each one contains bunch of attributes, methods, properties, you can't just leave all the code's semantics in their names. And by the way the app is so fucking ugly i bet they have appointed part-time developers as UX engineers... Even i have little knowledge about UX/UI, i just can't bear with this kind of ugly and confusing and unintuitive production with a cost of a good photo editting software.
Ok there may be much more to rant in the future but let me try through this and tell you more. Have a good day. :)5 -
I'm here in my bed. I can't sleep and in less than 5 hours I will have an important exam. I was thinking that a few months ago I went to a IT company as a school program. I would have to stay there for 2 weeks and "work" for them.
Upon arrival, the guy who had to monitor me gave me a sheet of paper with 5 alghoritmic problems to solve. He tells me to use java and hands me a laptop. naturally with windows. I try to look for some ideas but I can not find anything. I go to the control panel and search for something. Obviously there is a lot of bloatware and nothing catches my attention. then strangely I find something called oracle ... something ... but when trying to open it it gives me an error.
Fuck me. I decided to open notebook(normal one not ++ or something) and start solving the problems trying to remember the names of the methods and the classes based on what I had learned in school. then the guy comes back and looks at me puzzled. I tell him I did not find any IDE for java and the only one I found seem to give me an error. The guy double clicks and the program opens...fucking shit... He tells me to finish the problems and goes away perplexed. I copy the code from notepad to the IDE, I check the errors, I run it and the add some comments and I call the guy. he looks at the code, says that everything seems fine and then assigns me other things to do.
Now. HOW FUCKING STUPID MUST SOMEONE BE TO THINK THAT WRITING JAVA IN NOTEPAD IS A VIABLE CHOICE, AMONG ALL THE POSSIBLE SANE CHOICES I COULD HAVE MADE LIKE TRY TO UNDERSTAND THE ERROR OF THE IDE OR CALL THE GUY... NO. MY LITTLE SHOTTY FUCKING BRAIN DECIDED THAT NOTEPAD WAS A GOOD CHOICE. IF I COULD GO BACK IN TIME IN THE SAME MOMENT THAT I OPENED NOTEPAD I WOULD BITCH SLAP MYSELF SO HARD THAT I WOULD LOSE MY SOULD AND THE LAST 2 NEURON THAT MADE THAT SHITTY CHOICE. I WOULD BITCH SLAP MYSELF SO HARD THAT THE KINETIC ENERGY PRODUCED WOULD COLLAPSE THE UNIVERSE ITSELF. AND FROM THE DARKNESS A NEW UNIVERSE WILL BE BORN. A UNIVERSE WHERE THERE IS NO JAVA OR WINDOWS. A UNIVERSE WHERE MY 2 NEURONS WOULD HAVE MADE THE SHITTIEST DUMBEST CHOICE EVER IN A I LAST MISERABLE SELF DESTRUCTIVE ATTEMPT.
but then I come on devrant and I read about people who did thing worse than writing java on notepad and then everything is fine
PS my English is so bad I had to use Google translate, write an original version, translate it and do a side by side comparison with my translated version to check If I could improve something. Don't now If It improved the quality or not...3 -
In highschool, I was looking around for schools and universities at which I would start my student career. I went to a grad school one day, to see what it was like to be a student there. The first class I visited was programming for embedded systems. We got the assignment to write Java code to control a boom barrier. The teacher had written the template. And I kid you not, the template had a method of around 20 lines of code - without comments - with the purpose of carrying out a logical OR operation. An operation that literally can be done using an operator in Java: |
Why oh why do they let these people teach, with the result that the students will get used to these bad practises...5 -
What does GPT-3 tell us about how our brains work?
I just read an interesting article (link below) about how it does on the turing test. I've had this inclination for a while that state of the art AI is "incomplete", in the sense that we have some of the systems to make AGI, but not all of them. One of the comments they make is that "GPT-3 often finds it easier to write code to solve a programming problem, than to solve the problem on one example input", and that's the nail on the head. We can codify situations, describe the rules, put them in memory and run those rules in our head. We can manipulate the input to see how it'll change, we can spot from a problem statement what the rules are instead of focusing on what the answer is. Anyway, light bulb moment shared.
Link: https://lacker.io/ai/2020/...9 -
So I did a code review for a colleagues pull request and I've noticed that he hasn't written the PHPDocs for a lot of the classes and functions. One minor thing I wrote is to add the author for the class.
About 2 mins after writing that comment he came over to tell me why should he write the author in the comments when people can just go look at the git commit logs. I was like WTF? I asked why would he do that, his answer was that if there's an issue, we can just use git blame to identify the author. To me that makes no sense as git blame isn't supposed to be used like that.
It's guys like these are the ones who don't document anything whether in an online document or even in code. And they just make work harder for the rest of us.2 -
/* Spending time writing comments in code because if everything else fails, at least I can write a novel depicting a deteriorating struggle to make up my mind from them */
-
PM tells me to merge (large feature) work that's heavily under WIP.
In that is a performance optimisation he instructed (with an aggressive DM) me to stop looking at even though it's a concern for larger clients that I had to fix before as it's "unnecessary" - thought whatever I'll leave the code as is then
I tell him him the PR is not ready yet, there is still a lot of clean up to and tests to write
Just do it
A ~week later "wow you write really selfish code like look at this"
Shows a wrapper class from the optimisation with 2 properties and getters and setters (and override some of super's properties). I explain to him why it's there, "that should have been a comment". I tell him I write detailed comments as part of my refinment process which he wanted me to stop.
This is after he tried to merge a release branch into main while sneaking in some "corrections" and I pointed out it breaks Dev.1 -
The actual struggle of working in a non-english team who prefers to keep their variables named in our native language. Currently trying to think of a better way to phrase 'sjaafoerAerend' as dropping any part of it makes it more vague.
Is this a thing in asian countries as well? I'm guessing it's more common to just stick to english naming there.
I figure it's safe to assume that anyone who will see the code are going to be proficient in english. If they aren't, natively named variables isn't going to make a difference. Hell I even write my personal reminder comments in english.4 -
How do you get over the bad times? I keep having to work with shitty legacy systems that were written in perl and flash in the 90s, but my boss keeps telling me "No" on redoing some of the bigger stuff even though it is really needed. I mean, that is your goal here, right? Rebuilding this POS? FFS you still stored passwords in plain text twoo weeks ago! But no, you's rather dig around in Perl than upset some random user because his fucking interface looks different.
But then I also have to work with another system that I could redo in Cake/Laravel in two weeks (it's literally getting and writing data to one table, so two views and user auth), and the previous dev just... made a huge mess. I mean, why would you need to post data asynchronously when it's this one stupid form ? Just do a regular form submit? And the system is really not suitable for extending, because everything is in the database, EVERYTHING! Like, html form inputs? So to add a simple input to the template I have to create a new input type in the types table and then add that to the form structure table? Only to have the input checked by fucking regex? REGEX! Why? Seriously, this is not some high end CMS that needs this level of code reusability No. This is a simple fucking form.
And I can't get it to work. No documentation of course. No comments, either. All of this makes me feel like I'm just the shittiest dev ever. I feel dumb, and useless. Haven't turned on my private PC in weeks because I see no reason to work on any of my own stuff.
I used to have a job, working with Magento and Wordpress. And yeah, it was horrible, it was chaos, but it was fun and I was great at it. I bent that motherfucking system to fit my needs. People respected my opinion, they were convinced I could program this and that, and I proved them right. Did I make mistakes? Hell yeah. Did I give up? Fuck no!
But now, I just feel like I can't even write a simple fucking form any more. I'm just so close to giving up on development as a whole, even though I love it so much.5 -
GraphQL fans, please read the whole rant until you jump in the comments.
I get it, when you have multiple data sources (that aren't always proper databases), your stuff is relevant.
But most of the people use GraphQL when they have a single database. In that case, native joins are always faster than GraphQL dataloader N + 1 BS you have. It takes less time and less code to go to the backend and write an endpoint for the frontend with a DB query than write several GraphQL ones on the frontend and then combine the data with imperative JS. It will work faster too.
So why the fuck should I use GraphQL at all?28 -
I've been creating my Typescript/C# projects using SOLID principles. Whenever someone randomly joins me in my projects at work, i feel they need a lot of help. Specially since they know programming, but are not familiar with SOLID.
Like ohhh ok you created a base class for that, or ohhh that method already exists in the base class sorry i've implemented it again, or ohhhh ok you already implemented this method in that class.
The more classes i create the more complicated it becomes, sometimes for me too!
I feel I have to write a documentation for the code I write just to keep up with the different, but code changes/augments so writing a doc is really time consuming.
However if i didnt create base classes or interfaces it would be less complicated to browse through method definitions.
I am happy with the code like that though, but in some specific times it's a pain in the ass.
Comments?2 -
Lets play a little python game together and win some devRant points :
We have an array of integers named L
We need to sort this array so that the biggest number be in the beginning and lowest at the end..descending order
Rules:
-You are not allowed to write more than one line of code in the comment...only one
-if you comment once...you cannot comment directly after that...you have to wait for two other comments after you so you can comment again
-you have to build your code upon the previous comments ... you cannot start from scratch
-the lucky one who puts the final comment is the winner..and we should all ++ his comment to give him the biggest amount of points
Lets start and see who will win :)15 -
So a few days ago I sat down to write a redis adaptor to transfer data back and forth between redis and elasticsearch. I download the go-redis package and start writing a simple client.
I run the client and it gives me an error. So I'm stuck at it for about 30 mins and then I say to myself, "You dumb fuck you haven't started the redis-server". So I open up another terminal and type in `redis-server` and then I realise I don't even have redis installed on my machine.
I do such dumb things every weekend. If you have any dumb mistakes you made while writing code please share them in the comments. :-) -
So, funny story with a bit of self promotion at the end.
I was recently checking out some apps on playstore and found that my first ever , "launched just to experiment" app (released 1.5 years ago) has received more than 5k downloads . I was very happy about that so posted a small message on LinkedIn .
Now , my LinkedIn profile consists of 98% people who are totally strangers and never met me ( is it just me or do you also get a lot of stranger connect requests there?). So my usual post rarely ever goes beyond 5 or 6 likes.
Bit idk how there too my post got 35+ likes and now i was on cloud9.
So i finally decided to kick my ass and release some update to that app ( it had around 70% pity comments like "nice first app,but it should have this x feature",. "overall nice but it could use an x feature " etc.
And boy what my journey was in the last 72hours.
Firstly my madhead laptop started killing me with the battery failures and constant hang.
Then my past asshole self tried to give me a middle finger. So i have this whole partition in my memory where i keep my Android stuff and apps. It has a special folder named published zone and i keep all my published app codes and related files there.
I was fairly certain that this app's code eill be also there,so i opened it, found the code and tried running it.
Turns out my asshole self had tried to mess around the code so much that all the db layer WAS fucked up, all the ui WAS changed and no code was working.
"Not to worry", i thought. I always use git and there would be a correct version some commits before. WRONG. I HAD CHANGED THE WHOLE FUCKING WORKING PRODUCTION CODE AND DIDN'T MAINTAIN A VCS!
Also this was the verbose and shitty java code my 1.5 year before self so loved to write, so it was taking me way more time to figure out what's happening in an already fucked up code.
So i tried a couple of ways to get back my working code :
- I tried looking for a google recommended solution. Those guys take my whole app code build and distribute via playstore, but they provide no means to retrieve back the original code.
- i checked my (occasionally) back up hard disk but no. My hard disk would have 100s of movies from 2016 , but not a useful piece of fuckin code.
- i also tried to get my apk and decompile it via some online decompiler. Here the google again fucks up and don't allow me to get my apk directly. Meanwhile i found a ton of shady websites which are hosting an apk of my app without my knowledge O_o . I tried to decompile on of them but code was even more non understandable than my fuck up code.
So i ended up looking at both the mess up code and decompiled code and coded the whole app from scratch ( well not scratch, i extracted the resources and some undamaged activities from the mess up code . Also github was down for more than 3 hours yesterday , at the same time when i was trying to look onto some repositories)
Lessons learned:
- DON'T FUCK UP WITH THE PRODUCTION CODE
- MAINTAIN VCS
- Your laptop is shit reliable, github is also shit reliable , so save code at multiple places.
- there are way more copies of your code lying on the internet than you think.
Checkout my app here :https://play.google.com/store/apps/...2 -
"Some time ago I wanted to rewrite my old project. I saw code without comments and cried. Cried so much."
Programming teacher in college
People who teach us programming usually write a quicksort every year for 5-10 years. It is sad af :( -
I have just slept for a minimum of 5 hours. It is 7:47 PM atm.
Why?
We have had a damn stressful day today.
We have had a programming test, but it really was rather an exam.
Normally, you get 30 minutes for a test and 45 minutes for an exam.
In this "test" we have had to explain what 'extends' does and name a few advantages of why one should use it.
Check.
Read 3 separate texts and write the program code on paper. It was about 1 super class and 1 sub class with a test class in Java.
Check.
Task 3: Create the UML diagram of the code from above. *internally: From above? He probably means my code since there is no other code there. *Checks time*. I have about 3 minutes left. Fuck my life.*
Draws the boxes. Put the class names in each of them. A private attribute for the super class.
Teacher: Last minute!
Draw the arrow starting starting from the sub class to the super class.
Put my name on each written paper. And mentally done for the day. Couldn't finish the last task. Task 3.
During this "test", I heard the frustrations of my classmates. Seemed like everyone was pretty much pissed.
After a short discussion with the teacher who also happens to be the physics professor of a university nearby.
[If you are reading this, I hope that something bad happens to you]
The next course was about computer systems. Remember my recent rant about DNS, dhcp, ftp, web server and samba on ubuntu?
We have had the task to do the screenshots of the consoles where you proof that you have dhcp activated on win7 machine etc. Seemed ok to me. I would have been done in 10 minutes, if I would be doing this relaxed. Now the teacher tells us to change the domain names to <surnameOfEachStudent>.edu.
I was like: That's fine.
Create a new user for the samba server. Read and write directories. Change the config.
Me: That should be easy.
Create new DNS entries in the configs.
Change the IPv6 address area to 192.168.x.100-200/24 only for the dhcp server.
Change the web server's default page. Write your own text into it.
You will have 1 hour and 30 minutes of time for it.
Dumbo -ANGRY-CLIENT-: Aye. Let us first start screenshotting the default page. Oh, it says that we should access it with the domain name. I don't have that much time. Let us be creative and fake it, legally.
Changes the title element so that it looks like it has been accessed via domain name. Deletes the url and writes the domain name without pressing Enter. Screenshot. Done. Ok, let us move to the next target.
Dhcp: Change lease time. Change IP address area. Subnet mask. Router. DNS. Broadcast. Optional domain name. Save.
Switches to win7.
ipconfig /release
ipconfig /renew
Holy shit it does not work!
After changing the configs on ubuntu for a legit 30 minutes: Maybe I should change the ip of the ubuntu virtual machine itself. *me asking my old self: why did not you do that in the first place, ass hole?!*
Same previous commands on win7 console. Does not work. Hmmm...
Where could be the problem?
Check the IP of the ubuntu server once again. Fml. Ubuntu did not save when I clicked on the save button the first time I have changed it. Click on save button 10 times to make sure it really is saved now lol.
Same old procedure on win7.
Alright. Dhcp works. Screenshot.
Checks time. 40 minutes left.
DNS:It is your turn. Checks bind9 configs. sudo nano db.reverse.edu.
sudo nano db.<mysurname>.edu.
Alright. All set. It should work now.
Ping win7 from ubuntu and vice versa. Works. Ping domain name on windows 7 vm. Does not work.
Oh, I forgot to restart the bind9 server on ubuntu.
sudo service bind stop
" " " start
Check DNS server IP on win7. It looks fine.
It still doesn't work. Fuck it. I have only 20 minutes left. Samba. Let us do this!
10 minutes in. No result. I don't remember why. I already forgot why I have done for it. It was a very stressful day.
Let us try DNS again.
Oh shit. I forgot the resolver!
sudo nano /etc/resolv.conf
The previous edits are gone. Dumb me. It says it in the comments. Why did not I care about it. Fuck it.6 minutes left. Open a yt video real quick. Changes the config file. Saves it. Restarts DNS and dhcp. Closes the terminal and opens a new one. The changes do not affect them until you reopen them. That's why.
Change to win7.
Ping works. How about nsloopup.
Does not work.
Teacher: 2 minutes left!
Fuck it.
Saves the word document with the images in it. Export as pdf. Tries to access the directories of the school samba server. Does not work. It was not my fault tho. Our school server is in general very slow. It feels like they are not maintained and left alone like this in the dust from the 90s.
Friend gets the permission to put his document on a USB and give the USB to the teacher.
Sneaky me: Hey xyz, can you give me your USB real quick?
Him: sure.
Gets bombed with "do you want to format the USB?" pop-ups 10 times. Fml. Skips in a fast way.
Transfers the pdf. Plug it out. Give it back.
After this we have had to give a presentation in politics. I am done.6 -
Writing documentation is one of those tasks that most developers don't like doing. Especially when it comes to writing in say a Word/PDF file, an online wiki, or Confluence. It's time consuming and a pain in the ass.
But even if you don't like it, at least write comments in your source code! I hate having to keep writing "Write the PHPDocs for this class/function" in every pull request that I review. It's wasting my time writing such comments when it's such a basic thing to do when writing source code.31 -
markdown is not good enough! the tools aren't there for non-devs and there's no concordance on moving forward *compatibly* for anything other than headers and __possibly__ lists.
md has been around for years and still no consensus on comments, meta data, css, data imports, etc.
i could never in good faith recommend to a non-dev to use markdown, even though every academic and professional writer from legal to journalism should exclusively be using markdown to write and store their documents. the data portability and ease of search, retrieval, collection, distribution, etc of markdown compared to pdf or docx is enormous. markdown is the hex format of text, the perfect layer of data and visual so that the user and the computer can both operate on text as blocks of data rather than weirdly styled paragraphs that need to be reformatted BY HAND for citation-style or journal format, or paper size. FOR EACH SUBMISSION. Academics literally rewrite their 100-page papers to accommodate up to 10 different submission requirements.
They could be clicking MLA vs Chicago and/or using a journal's stylesheet to recompile for its styles.
Today there is some support from zotero et al to take away some of the pain, but it makes ZERO SENSE for writers to have to keep and store and keep up to date, multiple versions of the same document. Git pull does not exist for them. But the worst part is that git isnt the solution to their problem. They need a compiler more than they need version control. But they also desperately need vcs. They ALL literally have a million files named "dumdum.dumFINAL-3084_lastversion \2020, this one.dum".
They dont have git or anything like it, because they need a line-by-line solution like markdown for git to become effective.
All of writing is basically mired in the fact that people cant even roll up their paragraphs and see what the fuck it is theyre saying. Most writing reads like a long scroll through some nonsense that goes nowhere. Like this rant. but the point is that markdown and line-by line editing actually produces more logically sound writing. You start to think in terms of defining ideas in blocks, ... like code.9 -
There is a period in developer's life when writing comments in your code is a good idea. Then, after some time, when you write comments, it means your code is not that descriptive, is not so good that you consider writing comments.2
-
I'm refactoring one of our react apps. And want to kill people so much !!!! Why the hell do you write if true return true else return false ?!?!!! Decomposing coupled classes in independant on es doesn't work if they are still coupled !!!!! Reducers must be done in functional !!!!!!
If you can't write in english then don't FUCKING WRITE IN ENGLISH YOUR FUCKING COMMENTS !!!!!!!! Comments are there to help other to understand YOUR code, other need to be able to réas it !!!!!
WHY ?!?!?!
On the bright side it means some dojos....1 -
While attempting to quit smoking and after spending a full day trying to understand why the previous devs took this approach to encrypting a string and my lack of nicotine addled brain not allowing me to see that this was a “Secure”String and so uses a machine specific key (that’s why the code that worked locally wouldn’t run on production 😑) this is my rant on comments added to the helper I had to write
/// <summary>
/// If you are using this class and it's not for backward compatibility - then you probably shouldn't be using it
/// Nothing good comes from "Secure" strings
/// Further to this Secure strings are only "useful" for single user crypto as the encryption uses the login creds, transferring
/// this data to another client will result in them never being able to decrypt it
///
/// Windows uses the user's login password to generate a master key.
/// This master key is protected using the user's password and then stored along with the user's profile.
/// This master key then gets used to derive a number of other keys and it's these other keys that are used to protect the data.
///
/// This is also a broken crypto method via injection (see Hawkeye http://hawkeye.codeplex.com/) plus the string is stored in plain
/// text in memory, along with numerous other reasons not to use it.
/// </summary>
public class SecureStringHelper
{3 -
Currently having a stupid fight in my PR comments to remove dead code because I refuse to write a whole book to justify a cleanup commit.
-
I wrote some code in a different pattern than that was seen in the project. Got positive comments, but the senior said that as per the project rules you are not supposed to write like this.
So ended up writing some duplicate code but somehow it incorporates my pattern and existing project rules.
Should I be happy or sad? -
I swear the longer I use AI for auto complete in my IDE the worse it gets
today it can't even get the syntax of basic method calls right
last few weeks it was failing to rewrite code I already had in another part of the codebase and was just hallucinating confused garbage instead -- it knew what I meant but it was just not there right
when I first got it I could write comments and then autocomplete the code but that stopped working at some point and I just thought maybe I was asking things that were too complex for it, but now I'm thinking all these things degrade over time and can't not degrade for some reason
they keep claiming they don't learn but if they degrade they must be doing some sort of feedback system
I remember back when they did IBM AI and such and that stuff degraded as well, then AI fell out of fashion for a bunch of years4 -
A lecturer just told a class of final year developers approx 50 people that commenting our code should be banned and we shouldn't write comments within our code in case we cause confusion2
-
My mentor to me when I joined the job fresh out of college (in a somewhat dramatic tone, which is why I remember it so vividly):
"Gone are the days when you wrote programs with a small number of big functions, and lots of comments. Write code which is easy to read by humans - small functions which do 1 thing and are named after the 1 thing it does."
TL,DR: well named modular code. -
purity might just be the most important thing when refactoring code you didn't write.
for real, if you purify everything in that code, future refactorings will go way smoother and reasoning even more so.
But it's no easy feat, sometimes you face cockroach code. cockroach code is code written nuke style. The fire and forget code that you shouldn't forget.
cockroach code's easy to spot. you can't know what cockroach code does without reading it's comments. roach code is fat, roach code retro feeds from different spots of macaroni. it does IO and everything else all bundled together.
roach code isn't easy to scratch out its async version. in fact, thats a property of roach code. If you can't make it async without a rewrite, you've got roach code.12 -
You should write comments in your code, and in case of Perl you must write comments in your code.
I've done some DNS zone editing stuff using Perl's magic around 4 years ago and now I have no fucking idea what's going on in there. It's on production DNS server since then, no problems so far... -
continuation of "testing is not needed" series
https://devrant.com/rants/4407958
a second former colleague (which works as backend dev) was seeking frontender, and remembered about the React frontender we both worked with.
I decided to warn him:
> *Giggles* According to his words, front is not like back. Git and testing aren't required there.
I received next replies:
> actually I don't need tests as well
> I did not write them all this time
> I have testers in a team for that, which do the testing for me
> I think I'll need it in cv though.
My comments:
I am trying to imagine their code... architecture, and I am a bit scarried to see how it looks like, are you?3 -
Any good advice for managing junior developers?
In my experience I have found that loose definitions of work to be completed yields poor results. Honestly, sometimes I wonder if I have to write the code structure and leave a bunch of TODO comments for people to fill in.
Or alternatively people get going on tangents without thinking of the concrete problem given.
Or go try building generic abstractions that are unneeded and will not be reused complicating even the simplest use case.
Maybe the problem is in me and that I am not clear in communicating what's needed. What techniques do you guys use to get more or less what you want?7 -
I tend to write with long variable names instead of using too many comments to explain what i am doing in the code. Is it wrong?1
-
It is better to write almost all of the logic used in the code as comments/documentation.
Trust me.
It is a good thing. It increases Code readability.
Nobody is going to copy your logic and get hired in a high paying job or get promoted for that reason. People will come to know about your wit and will appreciate you instead.2 -
Always check your logic for non trivial modules or functionality before you write the code. It may take some time, but you can find a lot of possible errors or missed cases if you first put your logic in words...
You also get free documentation for your code if you write it as indented comments :) -
1. Music, something fast paced with minimal to zero lyrics (usually a GOA radio station in my case)
2. No distractions around (use a "do-not-disturb" flag or something to hang on your monitor or show on your desk)
3. No chats or other communication/social media visible, best case those apps / tabs are completely closed or muted
4. Having a clear goal to achieve, might even be only a sub-goal for the current coding session.
5. Structure your code before your actually write it, I usually create step-by-step comments in each file, documenting my thought process and what steps the current file/class/whatever should do.
6. Try to code your stuff in the same order as the aforementioned comment step-by-step list dictates (unless there is a reason to change the coding order)
7. Only windows open: IDE/Editor, Browser
8. Also keep only the browser tabs needed for your work open (testing clients, documentation, music if using a browser client, etc.)
At least that's what works for me3 -
Imagine the nooblet hell it would create if Python would throw actual errors all over the place if pep8 has been violated...
If only...
sidenote: I post this rant because I had to help my girlfriend and her project partner (for her study) because partner refuses to write readable code (no comments in the code at all as well) and both refuse to write in compliance with pep8 "because it's useless"5 -
In finals, I was prepared to write code for any given problem. Instead, the professor gave code snippet itself for all questions and asked to write output. No comments, nothing. Just pure spaghetti code. Wasted so much time in analyzing the code that I had to leave a couple of questions unattended. Moreover each question weighted for around 8 marks. So, just one miscalculation means 8 marks is into the void. I'm feeling like I'd get just enough marks to clear the subject.1
-
I recently saw this on devRant and I thought it was a cool idea.
Why don't we start writing code in each comment down here in order to form some C# (or Java) code working? I'll start from:
public class devRant {8 -
When it comes to writing comments in your code, I do quite a lot of it. Even for parts where you just need to read the code to understand what it does. However I do write very clean comments, not even snarky comments where I know someone has done something completely stupid. In my work, I generally keep it very clean. I wonder how many people write profanity, or use weird naming for functions or variables?
https://thenextweb.com/dd/2018/...3 -
For those who are on my team, arguing on not putting comments in their code:
How much ever (un)readable your code is, any peer / reviewer / future team member can only understand what that code snippet is doing, but not why was it written in the first place or what the hell you were thinking while writing that logic. So, it'll be awesome if you write that as comments or at least link to the story/design doc which warranted that code.3 -
Is this a justified code review comment or a bully?
Code reviews are weakness of this industry which has the potential to attract bullies. Abuse of the comment box in a pull request and bombarding the employee with hundreds of comments can cause stress, frustration, burnout and finally resignation and costs of fulfillment for the organization. While companies should find and stop bullying in the work place, what kind of code review comment is considered a bully and why? Any of below traits can mean you are dealing with a bully:
1. Claims the code needs to be changed but doesn't say how. So no matter how many times you change your code, he can repeat the same comment: "Your code is still bad due to blah blah and it needs to be changed".
2. Provides how the code should be changed, but the change doesn't add up to quality, security, performance, readability, etc. i.e. "Why did you use a for loop here? Use a while loop instead". Or "Why did you write it using three classes A, B and C? Instead write it using 4 classes D, E, F and G which does blah blah". In the later case, not following the review comment, you won't get approval. Following the comment means you need to rewrite your whole code. After which, you might again receive more comments to change other parts of your code!
3. Claims the requested change is due to standards but claimed standard does exist anywhere. Internet, company wiki, university course books, anywhere. In more severe cases of psychopathy, the bullying person refers you to a link which hours later turned out to be written by himself! Have fun describing what has happened to your manager or team leader... .
4. Asks the code to be changed in a way that supposedly is closer to standard or of better quality, security, performance, etc. But the proposed way will not work and is the main reason you didn't do that in the first place. So you start arguing forever in the comment box over why his method won't work!
If you cannot see any of the above traits, then keep calm, take a breath, fix your code. Otherwise you might be victim of a bully.3 -
Anyone know any VScode extensions that allow you to add edit comments? Something that will allow me to highlight a piece of code, and write a comment in a text bubble. Similar to comments in the “Suggesting” mode of Google Docs