Details
-
SkillsC, C++, C#, Objective-C, Java, Swift
-
LocationLondon
-
Github
Joined devRant on 5/17/2016
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
-
One of those "you have got to be kidding me moments":
struct Speaker: UnitNode, MemBufferBase {
typedef UnitNode super;
…
}
And then elsewhere:
#define Node UnitNode
#define Speaker AudioSpeaker
Never seen anyone typedef base class as super in C++ nor use a #defined variable as a class name. And of course elsewhere in the code class names are normal literal a but are referenced via a #define (and sometimes not via the #define)... The same obfustication done two different ways! -
Working with the codebase from hell here:
struct UnitNode: Node {
typedef Node super;
Stop making C++ look like Java! -
The slow typer who just discovered #define
#define Property AudioUnitPropertyID
#define Parameter AudioUnitParameterID
#define ParameterValue AudioUnitParameterValue
#define Format AudioFormat
#define FormatDescription AudioStreamBasicDescription
#define PacketDescription AudioStreamPacketDescription
#define ActionFlags AudioUnitRenderActionFlags
#define TimeStamp const AudioTimeStamp
#define IO ABufferList
#define PD APacketDescription
#define Count UInt32
#define DataSize UInt321 -
One true bracers when writing HTML be like "don't waste white space man":
<html> <div>
<h1>hello <h2>
world
</h2>
</h1>
</div>
</html> -
Adding extensions to Swift classes so that all methods have exact equivalents with anonymous parameters so you don't have to use parameters names when invoking which goes against the spirit of the language. #douchebagdeveloper
-
So I see this code:
class ViewWithDisplayLayer {
func viewDisplayLayer() -> CALayer? {
FatalErrorMustOverride()
return nil
}
}
If only Swift bad some way of defining some sort of interface or protocol with methods to be implemented by a class without using class inheritance and wouldn't it be great if that feature also gave a compile time error if you forgot to override/implement said method(s). If only.....
😳 -
Developers who think using cryptic variable names (like acronyms) is better than long descriptive variable names.....but then feel the need to document/comment the variable name rather than just naming the variable properly in be first place.
// Current CGRect to draw into
let ccgrd = self.currentCGRect()
Instead of just
let currentRectForDrawing = self.currentCGRect()4 -
There’s two types of code. There’s the code that’s like a Dyson or BMW product. It’s written to be beautiful and easy to understand and last for years. Then there’s code that’s like a cheap plastic Chinese product that’s designed to work once (if even) and then is dumped in a landfill.
-
I can count the number of people who know the difference between pod install and pod update on one hand.
-
When someone defines a Bool3 type in swift to represent true, false and undefined. Even tho swift already has Optionals as a first class feature. 😳
-
Swift let's you use most Unicode characters as variable names. But that doesn't mean you should do it.
I just found this in the code base:
let π = M_PI
FML -
The developer who thinks they are so elite because they make their code hard for anyone else on the team to understand. Especially when they have access to operator overloading.
self <- ~~~cgr3 -
Going back to C++/C#/Java from Swift is like: What is the point of all these brackets and semicolons?!1
-
APIs this have unnecessary global state (static config properties) as if you're writing a monolithic single threaded app.
-
The Captain Obvious commenter:
// account deletion
account.delete()
// check results
if results.any()
.... which eventually leads confusing unmaintained comments3 -
Those devs that put TODO comments everywhere in code. When has anyone actually ever seen a TODO and DID it? Put the task in jira/trello/whatever and leave the future source of confusion out of the code base!3
-
C/C++ considers pointers to be declared next to the variable name rather than the type name (int *x, *y vs int* x, y).
I know this but I still consider * to be more associated with the type. Therefore I'm one of those people who declare each variable in its own line and group the type and * together. (int* x; int* y)5 -
Maybe changing the name of the this pointer to "m" will encourage people to start using it and stop prefixing field names with m_ 🤔