Which language is the least bad?
-
@wharrgarbl said in Which language is the least bad?:
struct Point { int x; int y; }
Needs moar immutable:
data class Point(val x: Int, val y: Int)
-
@wharrgarbl said in Which language is the least bad?:
@sloosecannon said in Which language is the least bad?:
Also, it takes all of 3 seconds to generate getters and setters in a good IDE. So you're saving no time at all...
It makes my code uglier, and I hate stupidity with a passion.
But, but!… stop hating yourself!
-
@boomzilla said in Which language is the least bad?:
Python adds ambiguity and makes it more difficult to format code however the fuck I want to see it.
Name one language that doesn't.
-
@sloosecannon said in Which language is the least bad?:
@wharrgarbl said in Which language is the least bad?:
It's not comparable.
Uh, yes they actually are...
@wharrgarbl said in Which language is the least bad?:
so many morons.
Perhaps they're not the problem...
Now you said that, I think you cultists hate globals blindly too. There are many situations a global would suit better to our needs and you Java morons make shitty workarounds to avoid it.
-
@wharrgarbl said in Which language is the least bad?:
you Java morons make shitty workarounds to avoid it.
Language prejudices aside, a public static member is, for all intents and purposes, a global variable. The class just gives it a namespace.
-
@gordonjcp said in Which language is the least bad?:
@boomzilla said in Which language is the least bad?:
Python adds ambiguity and makes it more difficult to format code however the fuck I want to see it.
Name one language that doesn't.
C. C++. Java. C#.
I know, 4 != 1.
-
The best language is obviously Brainfuck. Since it only includes the barest necessities there is no room for all the stupid shit.
-
They all make it impossible to format code how I want to see it, because it has to be cluttered up with all these messy semicolons and curly brackets. It's unclear and unnecessary. Python is much better, since you only have to keep track of indenting it properly which you should be doing anyway.
-
@gordonjcp said in Which language is the least bad?:
They all make it impossible to format code how I want to see it, because it has to be cluttered up with all these messy semicolons and curly brackets.
Well, if we're being honest here, I don't really care about how you want to see code.
-
@boomzilla So you don't mind if your code is unreadable shit?
-
@gordonjcp said in Which language is the least bad?:
@boomzilla So you don't mind if your code is unreadable shit?
Correct, your code can be as unreadable as you like. I feel pretty safe in the assumption that I'm very unlikely to encounter it.
-
@boomzilla Well, unless you do a lot of assembly language you're unlikely to read much of my code.
-
@gordonjcp And no amount of formatting one way or the other is likely to make a significant difference in my opinion of the readability of the code.
-
@boomzilla That says more about your abilities than the code.
-
And if anyone can show me a microcontroller that can be programmed in anything other than assembly and still pull down sub-microwatt power consumption, I'll be happy to take a look.
-
@gordonjcp said in Which language is the least bad?:
@boomzilla That says more about your abilities than the code.
Yes, I have touched very little assembly code in the last decade and I frankly don't care to spend the brain power on that sort of thing right now.
-
@gordonjcp said in Which language is the least bad?:
And if anyone can show me a microcontroller that can be programmed in anything other than assembly and still pull down sub-microwatt power consumption, I'll be happy to take a look.
I daresay a modern C compiler beats 90%¹ of people who think their asm code was better.
The point where I abandoned the illusion was about 20 years ago when I tried to optimize an assembler program I had written for a 68000 for the 68060 and later compared it to what a (primitive by today's standards) compiler had produced.¹ Don't sniff that number.
-
@gordonjcp said in Which language is the least bad?:
They all make it impossible to format code how I want to see it, because it has to be cluttered up with all these messy semicolons and curly brackets.
Set your syntax highlighter to color the braces the same color as the background. Problem solved.
-
@onyx said in Which language is the least bad?:
@gordonjcp said in Which language is the least bad?:
They all make it impossible to format code how I want to see it, because it has to be cluttered up with all these messy semicolons and curly brackets.
Set your syntax highlighter to color the braces the same color as the background. Problem solved.
Why are there all these blank lines at the start and end of each block? Better delete them
That's weird, the second line of this
if
statement runs very time
-
@jaloopa said in Which language is the least bad?:
Why are there all these blank lines at the start and end of each block? Better delete them
E_HERETICAL_CURLY_BRACE_PLACEMENT_DETECTED
@jaloopa said in Which language is the least bad?:
That's weird, the second line of this if statement runs very time
Verily.
Filed under: Do I have to make my trolling indicators larger these days?
-
@onyx said in Which language is the least bad?:
Filed under: Do I have to make my trolling indicators larger these days?
Try this one:
-
@hungrier GIBBERISH
-
@boomzilla It's only gibberish if your window is 3px too narrow:
-
@hungrier said in Which language is the least bad?:
It's only gibberish if your window is 3px too narrow:
To preemptively prove you wrong is why I included the reply/quote/vote widgets.
-
@boomzilla So set your post width to 100ex + 3px
-
@laoc Right, but I'd have to write a C compiler, or adapt an existing one to generate appropriate code. Then I'd need to hand-tune the intermediate assembly to strip all the shite out so it fits into the 512 words of flash I have available.
-
@gordonjcp said in Which language is the least bad?:
Then I'd need to hand-tune the intermediate assembly to
strip all the shite outadd a bunch of inefficiency back in so it fits into the 512 words of flash I have available.You know, they've been refining C compilers for nearly half a century now. You might be pleasantly surprised at how much they know about optimization, both for speed and for size, if only you ask them for it. I think
-Os
is the form of the question they understand.
-
@onyx said in Which language is the least bad?:
The best language is obviously Brainfuck. Since it only includes the barest necessities there is no room for all the stupid shit.
Brainfuck? That'sgot, like 10 characters.
Unary FTW!
-
@gordonjcp said in Which language is the least bad?:
@laoc Right, but I'd have to write a C compiler, or adapt an existing one to generate appropriate code.
Which µC is it that you're writing for? The vast majority do have a code generator somewhere.
Then I'd need to hand-tune the intermediate assembly to strip all the shite out so it fits into the 512 words of flash I have available.
Linking with stdlib and using printf is
-
@wharrgarbl said in Which language is the least bad?:
@twelvebaud said in Which language is the least bad?:
Or, you know, you could start out with propTab or C# autoproperties rather than field access in the first place, because other than P/Invoke structs why on earth would you have nonprivate fields?!
struct Point { int x; int y; }
This code is so ugly, it makes me sick! You can't just pass integers around and use them like that! You have to define a setter, a getter, 3 constructors, a destructor, and a handful of operator overloads, then it will be clear and readable.
-
@accalia said in Which language is the least bad?:
@another_sam said in Which language is the least bad?:
@obeselymorbid Holy shit I didn't notice the year this post was nearly THREE YEARS OLD WTF DUDE?
@obeselymorbid is the @whargarbl of necrolikes.
hey, don't compare me to that @wharrgarbl dude
-
@wharrgarbl said in Which language is the least bad?:
There are many situations a global would suit better to our needs
I... disagree with "many". I'd agree there are circumstances when a global is the right choice, and globals can be much easier to use if you don't care about the side-effects. However, those can come back and bite you later.
-
@anonymous234 said in Which language is the least bad?:
@wharrgarbl said in Which language is the least bad?:
@twelvebaud said in Which language is the least bad?:
Or, you know, you could start out with propTab or C# autoproperties rather than field access in the first place, because other than P/Invoke structs why on earth would you have nonprivate fields?!
struct Point { int x; int y; }
This code is so ugly, it makes me sick! You can't just pass integers around and use them like that! You have to define a setter, a getter, 3 constructors, a destructor, and a handful of operator overloads, then it will be clear and readable.
Constuctors?!?! You monster! This clearly calls for an AbstractSingletonProxyFactoryBean.
-
@twelvebaud said in Which language is the least bad?:
@gordonjcp said in Which language is the least bad?:
Then I'd need to hand-tune the intermediate assembly to
strip all the shite outadd a bunch of inefficiency back in so it fits into the 512 words of flash I have available.You know, they've been refining C compilers for nearly half a century now. You might be pleasantly surprised at how much they know about optimization, both for speed and for size, if only you ask them for it. I think
-Os
is the form of the question they understand.As an example, this guy demonstrates a C++17 pong implementation that ends up being less than 500 instructions (about 1005 bytes as he mentions towards the end) once the compiler is finished with it. Runs on a Commodore64.
-
@cvi said in Which language is the least bad?:
As an example, this guy demonstrates a C++17 pong implementation that ends up being less than 500 instructions (about 1005 bytes as he mentions towards the end) once the compiler is finished with it. Runs on a Commodore64.
I'd just want to point everyone towards this video, whether you use C++ or not. It's a fascinating talk IMHO.
On the downside, now it makes me want to go through all my C++ code and try some of this stuff out, for which I sadly have no time. :P
-
@cvi said in Which language is the least bad?:
As an example, this guy demonstrates a C++17 pong implementation that ends up being less than 500 instructions (about 1005 bytes as he mentions towards the end) once the compiler is finished with it. Runs on a Commodore64.
It depends on what you're doing though. You can get quite a lot in, but it is easy to run out of space too.
-
BASIC
-
@wharrgarbl said in Which language is the least bad?:
@sloosecannon said in Which language is the least bad?:
@wharrgarbl said in Which language is the least bad?:
It's not comparable.
Uh, yes they actually are...
@wharrgarbl said in Which language is the least bad?:
so many morons.
Perhaps they're not the problem...
Now you said that, I think you cultists hate globals blindly too. There are many situations a global would suit better to our needs and you Java morons make shitty workarounds to avoid it.
Yeah, globals, not understanding benefits of properties. You are the kind of a person that make me hate coming to work.
-
@laoc said in Which language is the least bad?:
@gordonjcp said in Which language is the least bad?:
And if anyone can show me a microcontroller that can be programmed in anything other than assembly and still pull down sub-microwatt power consumption, I'll be happy to take a look.
I daresay a modern C compiler beats 90%¹ of people who think their asm code was better.
The only reason I've ever written assembly is when I didn't want the C runtime included with my esoteric program.
-
@jaloopa said in Which language is the least bad?:
@onyx said in Which language is the least bad?:
The best language is obviously Brainfuck. Since it only includes the barest necessities there is no room for all the stupid shit.
Brainfuck? That'sgot, like 10 characters.
Unary FTW!
I can't read Unary or Brainfuck because I am a human. I need a language designed for humans, like BIT:
(Yes, I did write a bunch of interpreters and compilers for it, thanks for asking!)
-
To everyone who has taken the "change to property when needed" (regardless of any language or IDE or other tool I know of), it will always violate OCP and a host of other items - as soon as there is a single call in existence. Heed the advice of Scott Meyers from 20 years ago: "Minimal yet Complete".
-
@ben_lubar said in Which language is the least bad?:
thanks for asking
You must have confused us for some other community.
-
@wharrgarbl said in Which language is the least bad?:
if you're not writing a library for third parties to use
If anyone other than you is/may/will use it, it's needed otherwise all you'll ever hear when you modify anything is:
Of course, if the client programmers have deliberately flouted the (unenforced) encapsulation of your objects, and your subsequent essential class modifications unavoidably and necessarily break several thousands of >errant lines of their malignant code, surely that's just instant justice, isn't it? Unfortunately, your pointy-haired >boss will probably only hear that "your sub ... essential class modifications un ... necessarily break ... thousands >of ... lines of ... code". Now, guess who's going to have to fix it all.
—— Perl Best Practices (§ 15.5 )
Damian Conway / O'Reilly / July 2005 / ISBN: 0-596-00173-8Edit: fixed the quoting gone astray and added the below:
If your language supports the idea that properties are (behind the curtain) handled by the language as get/set methods, then sure, you're good (maybe). But just to be safe make everything private, and make 'em fuckin work for the data. protected,public (except for what is needed to make your class/module usable), and friends are just pain waiting to happen.
-
@m_adams said in Which language is the least bad?:
If anyone other than you is/may/will use it
Then it's an API for use outside of my code. That's is different and not what most of the code is. I still wouldn't give a damn about getter and setters if I know it won't be needed, but probably would put them there to make otter people happy.
-
@wharrgarbl said in Which language is the least bad?:
I still wouldn't give a damn about getter and setters if I know it won't be needed…
I hear that, and it does make sense in that situation. I, personally, usually add get/set (sic) in my own, private, code just because sometimes I'm the moron who deliberately flouted the (unenforced) encapsulation and broke shit
-
@kt_ said in Which language is the least bad?:
Yeah, globals, not understanding benefits of properties. You are the kind of a person that make me hate coming to work, from time to time.
I also don't see the point in functions too. I can do everything inside main with gotos. It gets better performance because then I don't have function prologues.
-
@wharrgarbl said in Which language is the least bad?:
@kt_ said in Which language is the least bad?:
Yeah, globals, not understanding benefits of properties. You are the kind of a person that make me hate coming to work, from time to time.
I also don't see the point in functions too. I can do everything inside main with gotos. It gets better performance because then I don't have function prologues.
Oh FFS.
Swampy, is that you?
-
@sloosecannon function prologue is a lot of instructions that's just a waste that increase code size and machine cycles
-
@wharrgarbl said in Which language is the least bad?:
@sloosecannon function prologue is a lot of instructions that's just a waste that increase code size and machine cycles
Right, so.... low effort troll it is then.
-
@wharrgarbl said in Which language is the least bad?:
@sloosecannon function prologue is a lot of instructions that's just a waste that increase code size and machine cycles
Nah, but seriously. Why do it by hand if you can have the compiler do it for you?
Here's one of the final slides from the presentation I linked above
I don't like paying for unnecessary function prologues/epilogues either, but that doesn't mean I have to write programs like some animal. Besides, getters and setters are zero-overhead ("for free") if you're using a sensible language.