A compiler has mostly fixed rules for translation. The English language often is ambiguous and there are many ways to implement something based on a verbal description.
Programming by using the ai as a “compiler” would likely lead to many bugs that will be hard to impossible to trace without knowing the underlying implementation. But hitting compile again may lead to an accidental correct implementation and you’d be none the wiser why the test suddenly passes.
It’s ok as an assistant to generate boilerplate code, and warn you about some bugs / issues. Maybe a baseline implementation.
But by the time you’ve exactly described what and how you want it you may as well just write some higher level code.
Think of it more like bigger building blocks rather than single use functions. If there is an issue with the pizza arriving burnt black at the customer you don’t want to read through the logic for making the dough and adding toppings if the most likely cause is the oven.
Sure, you could add comment blocks to mark the sections. But you can’t easily jump to that exact point. With function names you can easily skim over the unimportant calls, or go through a list of functions/methods in the file and jump there directly. With comments that’s not a standard feature in IDEs.
Also that function does not scale well if you have more than 2 options of toppings. Maybe some are not compatible and logic needs to be added that you don’t use pineapple and banana on the same pizza, for example.
But I understand your argument about following through multiple layers of abstractions. That’s something that irritates me as well a bit, if you follow a function, that does nothing, but pass the same parameters through another function and return the result.
No guard clauses, or changes to the data, just 1:1 pass-through. And this them goes 2-3 levels deep before reaching real code again. Bonus of they all are in different files too.
Especially the other projects that were hidden on someone’s desk until a week before the deadline. And now they have two or more projects like that simultaneously
Assembly would be lower. You have more complex / direct instructions in assembly. Brain fuck is pretty much just a pure turing machine, and has 8 instructions.
X86 has ~ 1000 + variants. Even ARM with a smaller instruction set has 232 instructions.
In brain fuck to set a number you’d have to count up (or down - underflow) to that number. In assembly you just set it.
Somewhere I’ve read that current assembly code with Makros should be similar to writing C.
For a current project, I’ve been struggling with my language files. They’re all JSON files, and will always fallback to English if translations aren’t available....
Usually a translation system might return the key value if the translation is missing. By translating with “untranslated” as a default you’d get just that text filled as fallback.
Unless you reinvent the wheel for lookup and can just ignore your magic value, or put an if on every value lookup.
Sounds like a good use of comments. Explain why, not how. (that should be readable from the code for the most part. Unless you’re having function calls like xmmmuldp (simd) )
If someone changes the code and forgets to modify the comment, the reader might favor one or another at random.
Hence why you should comment why, not how/what.
// slow down traffic before crossing busy main road
Now you can change the stop sign to a yield without touching the comment. Or judge that the comment can be removed if it’s clear the main road does no longer exist.
I am confused as to whether it is acceptable to use code produced by other people for something that is related to me and my creations. Do i have to resort to coding my portfolio website with pure css and js to demonstrate my credibility and experience as a candidate employee? Does the ideology of ‘using other people’s tools...
Don’t let yourself down because you don’t know the syntax off the top of your head.
Even after 15 years of programming, and studying computer science, I would have to look up how to write loops, conditions, variable assignments in bash / sh / batch.
Coming to python from a primarily java focus background wasn’t any different. I knew what steps the program should do, but had to look up how to translate it into whatever language. And for further improvements what features the language has to express the things “in the style of the language”
saw a 2nd year CS guy run a maze solver (for final exam) with 300 nested if-statements. worked about 50% of the time. so he added another 5000 nested ifs and got it up to 90%. good enough!
I’m looking for a good on the eyes font that suport a feel special characters like ç, ã and í. It also need to have a easy difference between 0/O and I/l. Sorry if this is not the best place to ask this....
What things really helped you toget better at programming?
Curious to hear about the things that helped improve your programming ability.
Which language you wish would really grow and reach mainstream adoption?
Assume mainstream adoption as used by around 7% of all github projects...
Stop doing Computer Science (feddit.de)
Monitor Alignment Alignment Chart (feddit.de)
I’m at true neutral.
Linear code is more readable (blog.separateconcerns.com)
My poor RAM... (loot.buckodr.ink)
cross-posted from: ls.buckodr.ink/post/332420
Planning is for the weak (sh.itjust.works)
This one goes out to the sysadmins in the crowd. (dubvee.org)
What are your programming hot takes?
Most and Least Verbose Programming Languages (programming.dev)
I was looking at code.golf the other day and I wondered which languages were the least verbose, so I did a little data gathering....
How do you handle language files?
For a current project, I’ve been struggling with my language files. They’re all JSON files, and will always fallback to English if translations aren’t available....
More the merrier (lemmy.world)
is it ethical to use third party libraries and other stuff in my portfolio website?
I am confused as to whether it is acceptable to use code produced by other people for something that is related to me and my creations. Do i have to resort to coding my portfolio website with pure css and js to demonstrate my credibility and experience as a candidate employee? Does the ideology of ‘using other people’s tools...
5 Things I’ve Learned in 20 Years of Programming (daedtech.com)
Some people just can't pace themselves (lemmy.world)
Which TLD if you can't get a .COM?
What TLDs to use if you cannot snatch a .com ?...
unrolling loops is efficient, right? (lemmy.max-p.me)
saw a 2nd year CS guy run a maze solver (for final exam) with 300 nested if-statements. worked about 50% of the time. so he added another 5000 nested ifs and got it up to 90%. good enough!
[closed] [help] what font do you use in your code editor/IDE?
I’m looking for a good on the eyes font that suport a feel special characters like ç, ã and í. It also need to have a easy difference between 0/O and I/l. Sorry if this is not the best place to ask this....
Le torture (lemmy.world)