There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

aeki , in When someone corrects your code

I am really happy when people are quite strict in code reviews, it makes me feel safer and I get to learn more.

Nothing worse than some silent approvals with no real feedback. What if I missed something obvious… and now it’s merged.

To be fair, I also enjoy getting my grammar corrected. I’m juggling 3 languages and things can get messy.

reflex , (edited )
@reflex@kbin.social avatar

Like the other guy, I also read your comment twice looking for mistakes but found none.
You should of left something to fix!
😏

Edit: I'm glad there so many people who are as passionate about the correct spelling of "should've" as I am. I was testing you all, and you passed!

ironhydroxide ,

Correcting the reviewer.
Notes: “should of” isn’t valid, should implies a verb, of isn’t a verb. I expect you meant “should have”. Please recall this in future submissions.

interolivary ,
@interolivary@beehaw.org avatar

should implies a verb, of isn’t a verb

“should” and “of” should probably be in quotes here?

LinuxSBC ,

A question mark does not fit the sentence, which is a statement (“they should.” rather than “should they?”). While question marks are commonly used to demonstrate a rising tone at the end of a sentence, its not considered correct for formal writing.

interolivary ,
@interolivary@beehaw.org avatar

A-ha, but this most decidedly not formal writing! UNO REVERSE CARD.

But on a more serious note, I did intend it as a sort of question because I’m not 100% sure, because the rules for quote use might well be different in English than my native language. I actually also don’t know the rule for question mark usage in English; is it generally considered a crime against orthography to plonk a question mark on something that’s a statement, or is it valid in some cases?

LinuxSBC ,

It’s totally valid in most cases. It’s technically only supposed to be used for a question, but language is based on how it’s most commonly used, with those “rules” only applying in extremely formal situations. With the prevalence of informal text-based communication, many people use it to indicate being unsure, like how you used it. I just wanted to continue the chain of grammar corrections (which is why I used the wrong “its”/“it’s” at one point). Also, you were right about the quotes.

interolivary ,
@interolivary@beehaw.org avatar

It’s technically only supposed to be used for a question, but language is based on how it’s most commonly used

Ah, I see you’re also a descriptivist 😀

But yeah I know you were just continuing the joke; I’m a language nerd (well, general nerd really) and I just got curious about what the rule actually is. While English orthography rules related to punctuation usually seem to be pretty much the same as with Finnish, the rule for question marks seems to be more relaxed in Finnish because it can “officially” be used to mark any expression as a question. The rules for commas are also different, ours are closer to German and we tend to spray commas everywhere

reflex , (edited )
@reflex@kbin.social avatar

Notes: “should of” isn’t valid, should implies a verb, of isn’t a verb. I expect you meant “should have”. Please recall this in future submissions.

😏

wandermind ,

They should of course keep that in mind, but it’s not that “should” should always be followed by a verb directly. The problem is that “of” in this context is a mishearing/spelling of “have”, so they should in this case have written it like that instead.

jadero ,

I would argue that “should of” is just a naive written rendition of the spoken contraction “should’ve”. They are homophones, so it’s a completely understandable error among those without the relevant education or background. I know only English and was in Grade 9 at a different school before someone corrected me.

Huschke ,

I love that you used “should of” in a valid sentence.

Doug ,

Except that it would be “they should, of course,”.

jadero ,

In that spirit, I will call attention to your first sentence, specifically the comma. In my opinion, that can be improved. One of three other constructions would be more appropriate:

  • I am really happy when people are quite strict in code reviews. It makes me feel safer and I get to learn more.
  • I am really happy when people are quite strict in code reviews, because it makes me feel safer and I get to learn more.
  • I am really happy when people are quite strict in code reviews; it makes me feel safer and I get to learn more.

The first of my suggested changes is favoured by those who follow the school of thought that argues that written sentences should be kept short and uncomplicated to make processing easier for those less fluent. To me, it sounds choppy or that you’ve omitted someone asking “Why?” after the first sentence.

Personally, I prefer the middle one, because it is the full expression of a complete state of mind. You have a feeling and a reason for that feeling. There is a sense in which they are inseparable, so not splitting them up seems like a good idea. The “because” explicitly links the feeling and reason.

The semicolon construction was favoured by my grade school teachers in the 1960s, but, as with the first suggestion, it just feels choppy. I tend to overuse semicolons, so I try to go back and either replace them with periods or restructure the sentences to eliminate them. In this particular case, I think the semicolon is preferable to both comma and period, but still inferior to the “because” construction.

I’ve clearly spent too much time hashing stuff out in writers’ groups. :)

aeki ,

This is what I live for. :D

I agree with most of that. In formal settings, I prefer full sentences with conjunctions; however, choppy sentences are the ones that often end up in my Lemmy comments.

jadero ,

That only makes sense. We are having a conversation, not creating literature.

little_hermit ,

Strange, I get a mild hostility vibe from colleagues if I review too ambitiously.

jadero ,

Reviews have to be balanced to circumstance. There is a big difference between putting out the sales brochure and the notice on the bulletin board. Likewise in coding a cryptographic framework for general consumption and that little script to create personal slideshows based on how you’ve tagged your photos.

As a general rule, wider distributions, public distributions, and long-lived distributions need more ambitious reviews. If the distribution is wide, public, and permanent, then everything needs very detailed scrutiny.

I have found some success in starting with and occasionally revisiting review goals. This helps create and maintain some consistency in a process that is scaled to the task at hand.

interolivary , (edited )
@interolivary@beehaw.org avatar

Notably, a good code review should also bring up the good parts of the submission, and not just concentrate on the errors. Not only does it make the recipient feel better to get positive feedback among the negative, but it helps them learn about good practices too. Just concentrating on the errors doesn’t really tell them which things they’re doing well.

Many reviewers concentrate on just finding mistakes, and while it’s useful it’s sort of the bare minimum; a good code review should be educational. Especially if the submitter’s a more junior coder, in which case it’d also be a good idea to not just outright tell them how you’d fix some problem, but sort of lead them to a solution by asking them questions and pointing things out and letting them do the thinking themselves. But still, experienced coders will also benefit from well-structured feedback, it’s not like we’re “finished” and stopped learning.

aeki ,

Yes, I tend to do that, and thankfully some of my colleagues do too. Clever but readable solutions, following good and relevant practices, clear documentation, making a good MR description that makes it easier to review, and more.

interolivary ,
@interolivary@beehaw.org avatar

That’s great to hear. It’s thankfully becoming more common in general, and we can all do our part in spreading these practices.

I tended to actively evangelize for it when I was managing coders or teams. Unfortunately it’s still not all that uncommon for coders to be downright offensive when giving feedback, like not necessrily quite Linus-level rants but things like “this is idiotic, this is stupid, that’s shit, why would you do that” etc etc. The usual explanation I’ve gotten is that they’re just being “honest” and saying what they think, and it’s not their problem if the reviewee (is that even a word‽ I can’t English today) gets offended. Some even get all huffy about it, like “oh we’re just supposed to coddle them and never say anything negative so their little feefees don’t get hurt?” And I mean, yeah, getting honest feedback definitely a good way to learn, but it’s not like the only way to point out errors or problems is to be a cunt about it.

Anticorp ,

Assuming you have competent leadership, then it wouldn’t be merged if you missed something obvious. I guess you’re saying that you want more positive reinforcement.

Doug ,

I’m juggling 3 languages

We Americans like to forget that anyone might have any trouble understanding English especially in cases of polyglots.

I don’t know which is your native tongue but from this comment it looks like you’re doing a fine job.

CoderKat ,

Yeah, I learn so much from code reviews and they’ve saved me so much time from dumb mistakes I missed. I’ve also caught no shortage of bugs in other people’s code that saved us all a stressful headache. It’s just vastly easier to fix a bug before it merges than once it breaks a bunch of people.

Hotzilla , in When someone corrects your code

Fuck me, never touch my code, it is perfect.

hemko ,

Brother you don’t even remember what it does, how and why after 3 days

Hotzilla ,

Of course, but because it is perfect, no one, not even myself, needs to fix/modify/extend/understand

/s

Mr_Lobster , in There once was a programmer

I literally cannot comprehend coding with ChatGPT- How can I expect something to work if I don’t understand it, and how can I understand it if I don’t code and debug it myself? How can you expect to troubleshoot any issues afterwards if you don’t understand the code? I wouldn’t trust GPT for anything more complex than Hello World.

mild_deviation ,

Just yesterday, I wrote a first version of a fairly complex method, then pasted it into GPT-4. It explained my code to me clearly, I was able to have a conversation with it about the code, and when I asked it to write a better version, that version ended up having a couple significant logical simplifications. (And a silly defect that I corrected it on.)

The damn thing hallucinates sometimes (especially with more obscure/deep topics) and occasionally makes stupid mistakes, so it keeps you on your toes a bit, but it is nevertheless a very valuable tool.

philm ,

That only really works, if the method is self-contained, and written in a language that GPT has seen often (such as python). I stopped using it, because for 1 in 10 successful tries I waste time for the other 9 tries…

philm ,

This.

If I’m writing something slightly more complex, ChatGPT(4) is mostly failing.

If I’m writing complex code, I don’t even get the idea of using ChatGPT, because I’m only getting disappointed, and in the end waste more time trying to “engineer” the prompt, only to get disappointed again.

I currently cannot imagine using ChatGPT for coding, I was excited in the beginning, and it’s sometimes useful, but mostly not really for coding…

worldsayshi ,

If you’re already knee deep in existing code and looking for bugs or need to write quite specific algorithms it seems not very useful. But if you for some reason need to write stuff that has the slightest feeling of boilerplate, like how do I interact with well established framework or service X while doing A, B C it can be really useful.

oldfart ,

Also it’s often doing a great job if you paste a stack trace into it and maybe some surrounding code. I used it to fix someone else’s Java code as well as to upgrade some 3rd party Wordpress junk to latest PHP. I barely know Java and stopped following PHP news around version 5.6.

worldsayshi , (edited )

You shouldn’t use code that you don’t understand. Chatgpt outputs quite readable and understandable code and makes sure to explain a lot of it and you can ask questions about it.

It can save quite a lot of effort, especially for tasks that are more tedious than hard. Even more if you have a general idea of what you want to do but you’re not familiar with the specific tools and libraries that you want to use for the task.

III ,

It’s also wrong a lot. Hence the requirement for understanding. It can be helpful to get through a stretch but it will fuck up before too long and relying on it entirely is a bad idea.

1984 ,
@1984@lemmy.today avatar

Often the code is self explanitory. I understand the code very often, but I still couldn’t write it correctly from scratch. You never feel like that?

This is how code examples in books works too. You get some code to look at and try to understand it. Otherwise it’s like you would ignore code examples while learning programming.

Psythik ,

I haven’t been in web development in over 20 years; thanks to ChatGPT, I was able to get up-to-speed and start building websites again, when in the past I would have never been able to do so.

GPT is a powerful tool that can allow anyone to do anything if they’re willing to put in the effort. We should be praising it, not making fun of it. It’s as revolutionary as the internet itself.

corsicanguppy ,

I use it to give me prototypes for ansible because Ansible is junk. Then I build my stuff from the mishmash and have GPT check it. Cuts a lot of time down that I’d rather be doing any-bloody-thing else with.

UnfortunateShort , in There once was a programmer

ChatGPT was never made for programming and is horrible at generating code. It is nice for a peer-programming kinda setup tho, because it can quickly point you towards tools, libraries, APIs etc. to use

oldfart ,

It generated a custom needs GUI OCR tool in Qt5. I don’t know a single bit of Qt5 and went from zero to working tool in half an hour.

The tool takes a screenshot, lets me select an area on the screen, OCRs it and displays the text in a window.

If ChatGPT isn’t made for programming then I’m looking forward for a product that is.

lobut , in Openheimer in programming

I mean, it should be a protected branch to prevent against that.

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

Sometimes there’s no other option when someone merged develop into master just before a critical bug was found.

F04118F ,

You can always revert (i.e. undo in a new commit) the faulty commit. That will keep the history. This meme is not just about pushing straight to master, it’s about push --force which overwrites the remote branch completely, changing history.

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

Sometimes there’s only the nuclear option left, I have only done it a few times, someone merged a major refactoring and we ended up reverting by changing history.

I have also observed that when you revert with git revert and then merge back some time later git can get confused about if a commit was merged or not.

Mind you we didn’t use git flow or other smart processes to our own regret.

Double_A ,
@Double_A@discuss.tchncs.de avatar

git can get confused about if a commit was merged or not.

You have to revert the revert before re-merging the branch. Otherwise git keeps track of the commits that you reverted and doesn’t apply them ever again.

See: github.com/git/git/…/revert-a-faulty-merge.txt

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

Thanks for the info, I think that’s exactly what we didn’t do.

corsicanguppy , in There once was a programmer

There once were writers who didn’t objectify people by using pronouns reserved for inanimate objects.

I haven’t seen any lately.

Umbrias ,

What

The_Terrible_Humbaba ,
@The_Terrible_Humbaba@beehaw.org avatar

They’re saying that the image should say :

who writes code without chatgpt

instead of :

that writes code without chatgpt

Umbrias ,

Big meh. Languages evolve.

AnUnusualRelic , in When someone corrects your code
@AnUnusualRelic@lemmy.world avatar

Grammar is code.

_Gandalf_the_Black_ ,

However, real grammar and prescribed textbook grammar are two different things.

SpaceNoodle , (edited )

Anybody who bitches about prescriptivism is just mad that their grammar sucks.

Edit: this always gets 'em crawling out of the woodwork

_Gandalf_the_Black_ ,

Oh, so you mean the whole of the contemporary field of linguistics?

Pipoca ,

Prescriptivism is mostly just an unprincipled mishmash of shibboleths someone pulled out of their rear end hundreds of years ago, classism, and knee-jerk reactions against language change.

For example - why do people distinguish less vs fewer to refer to countable vs uncountable nouns? Because someone wrote in 1770 that they thought that distinction was elegant, despite not actually reflecting the way English at the time was spoken.

Why is ain’t “not a word”? Because it originated in the speech of poor people, and was used less commonly by rich people. People roll their eyes at new business-speak because it comes from rich, powerful people, but look down their nose at language innovations from poor hillbillies and other disfavored groups.

And you can find writings from old prescriptivists complaining about literally every change in the language, such as hating the new ambigious use of singular ‘you’ when ‘thou’ was perfectly good and unambiguous or hating phrases like ‘very pleased’.

magic_lobster_party , in I am God's greatest programmer

There’s also that long time senior dev who’s overly confident in their abilities and force pushes production breaking code directly to master.

Anticorp ,

Not for long there isn’t.

magic_lobster_party ,

Nah, they’re the one who’s contributing most to the project. Mostly because their code is so garbage no one else can work with it. But that’s not a thing the managers take into account.

jelloeater85 ,
@jelloeater85@lemmy.world avatar

Yeet that shit into main. Who needs unit tests, it works on my computer?

magic_lobster_party ,

If it works in my mind it’s ready for production

jelloeater85 ,
@jelloeater85@lemmy.world avatar

Top kek

wizardbeard ,

YOLOdev is the best way to dev

Strawberry ,

This shit happened the other week for me. Senior dev pushed the shittiest JS code without testing the day of a production install and it caused us to have to roll back the install after it very predictably caused a bunch of crashes for pages on our public site. Worst part is, the entirety of what he wrote could’ve been implemented as a CSS media query

jbk , in When someone corrects your code

reddit

CookieJarObserver , in When someone corrects your code

Someone Renames your objects “because they sound better that way”…

pirrrrrrrr , in There once was a programmer
eerongal ,
@eerongal@ttrpg.network avatar

Notepad++ is perfectly fine to code in. With the wealth of plugins it has, it’s pretty similar to vscode in how you can trick it out with all sorts of things it can’t do by default.

slackassassin ,

Notepad++ gang

kogasa ,
@kogasa@programming.dev avatar

I’m a tolerant person, but come on, man. Between VSCode, JetBrains, (n)vim and emacs, and I can’t think of a legitimate reason to use np++ for development over any of them.

GBU_28 ,

If you accept confusing and unsettling peers who watch you screen share and hammer out keybinds that do mysterious things, then you’re all set.

pirrrrrrrr ,

The tiny, tiny footprint and speed to load.

I would think I’d probably use an IDE if I was coding all the time.

Heck, I’m only using it because JFE got too old.

I do have VSCode set up even with the same scheme as NP++… but let’s face it, the most complex things I’m using are PowerShell and Node JS.

tiredofsametab ,

I don't use JetBrains because it's not free, I mainly use VSCode since it is and works fine, but I would use np++ after that. I spent years working in np++.

I played with linux in the early '90s, but mostly got started on GenToo Linux years ago and they had people installing Nano when building from the ground up. I grew to like that and never really learned VIM. I did use emacs every now and again, but all of those have lots of unwieldy key combinations that require memorization and don't work like a lot of other programs people coming from, for instance, Windows would be at all familiar with. The barrier to entry was too high to bother with so it was wine and np++ since I was also still using Windows for work.

I've been forced to use a Mac for work for the last almost-year and still can't find anything as good as np++. BBCode is as close as I can get and I'm still not really a fan.

kamenlady ,
@kamenlady@lemmy.world avatar

VSCode for osx, why not use this?

tiredofsametab ,

Ah, unclear on my part. I do use vscode on Mac, but still want a text editor to do other stuff.

kamenlady ,
@kamenlady@lemmy.world avatar

ah ok - yeah, i have the same struggle. Mac’s default Editor is too Rich-Text centric.

PieMePlenty ,

You havent lived until you wrote python over ssh in nano.

Black616Angel ,

But I mean this is (hopefully) an exception and not the norm.

trash80 ,

I’ve written C over ssh in pico. It was sort of zen in its simplicity.

ByGourou ,

We wouldn’t have to do that if vscode remote ssh was good

gentooer ,

Luckily all systems I had to do this on had vi installed.

MikuNPC ,

It’s super fast in comparison to full IDEs and is easier to use than most editors. I switch between vscode and notepad++ depending on what im doing.

DudeDudenson ,

Macros man, being able to record a macro and use it quickly and easily is worth it’s weight in gold when you’re doing something super repetitive that there are no automatic refactors for.

And i hate the “modern sleek design” culture of making all the options hidden and difficult to reach. Notepad s interface is so fucking clean and usefull.

I still use intellij because of a lot of other things but quite often I find myself using notepad for specific tasks and it’s such a treat

droans ,

I’ll use it for one-off short scripts. No point in doing the whole shebang for something that doesn’t need it.

mojo , in When someone corrects your code

It’s actually “their’yre” dumby, learn ur words

reflex ,
@reflex@kbin.social avatar

It’s actually “their’yre” dumby, learn ur words

SOme morans should of staid inn School!!

interolivary ,
@interolivary@beehaw.org avatar

get a brane morans

the_of_and_a_to , in When someone corrects your code

deleted_by_author

  • Loading...
  • zerofk ,

    I read your comment twice, looking for any tiny mistake to fix. How thoughtless of you not to include any.

    Jake_Farm , in There once was a programmer
    @Jake_Farm@sopuli.xyz avatar

    What about a programmer that doesn’t use stack overflow.

    Semi-Hemi-Demigod , in There once was a programmer
    @Semi-Hemi-Demigod@kbin.social avatar

    In days of yore, before Google or even Altavista, you could tell the quality of a team by how many O'Reilly books they had on the shelves.

    corsicanguppy ,

    I should sell mine. Maybe I’ll keep the crab book and the white book, but the latter’s not even an O’Reilly.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines