1. Thunderrise
  2. Blog
  3. Telegram Open Source Pitfalls
Telegram Open Source Pitfalls

Telegram Open Source Pitfalls

team
Thunderrise

First thing I need to say is: Don’t worry, Telegram is alright. It has a clear idea and a lot of cool features. It’s free, fast and allows to chat with a lot of funny emojis. But developers say that Telegram source code is opened. A lot of experienced programmers should say it’s a bit confusing.

Although no one should know how developing messenger will affect on the whole operation, there are enthusiasts that have a try. Mentioned above, Telegram server source code is opened to use but developers should make an effort to implement those codes. Let’s have a look at reasons.
Telegram Open Source Pitfalls

You can’t use Telegram API

First of all, you have to register a new application. To perform it, you need to enter your phone number and then you’ll receive a Telegram sms code to your app account (so preliminary install the app). After receiving the password you are able to register an app on the site. As you have registered, you’ll be offered with your unique api_id and api_hash that are necessary. Remember that when you open Telegram all the data is linked to your phone number.

Roughly speaking, you are able to use Telegram data only and not allowed to work with other data or a separate server. Such limitations complicate a creation of new messenger app. As a result, you can only create an application that will be fully dependent of Telegram source and you will have no bare chance for self-sufficient work.

But is it really so bad? If developer agrees to store all the data in Telegram code it’s not such a bad idea.

Lack of reusability 

Telegram IOS source code as well as Android one are not SDKs or libraries. So it will rather slow the development down then accelerate it. Instead of constants the code consists of a hardcode. There are some other major pitfalls.

  • Odd code lines. Usually, programmers use a separate “color” XML but Telegram uses setTextColor(0xff757575) for some reason. If the developer wants to change the color of something in the app, he turns to color.xml so it changes the color everywhere. Working with Telegram, they’ll need to search for this setTextColor(0xff757575) place and only there they could change the color. Admit it, this issue could only complicate other operation so it’s more headache for developers.
  • Obfuscated code. Int values are numbered very strange (such as “42540”) and they are passed as flag values. Isn’t it a bit odd? Definitely.
  • Really long methods. 300+ lines for one method, what a mess. They should definitely set their code to rights. As well as “If-Else” exposition, they are too long.
  • Kangaroo-code and a lot of Ctrl C - Ctrl V solutions. Admit it, no one likes such embarrassments.
  • Only three activities. There are a lot of classes “activity” that stretch BaseFragment. It’s a bit crazy cause it’s not a Fragment actually.
  • To justify Telegram developers, they didn’t say they have an SDK. So everything they’ve done was publishing the code.

Telegram Open Source Pitfalls

Using Telegram API you must go to GitHub

According to Telegram license you have to publish your source code. If a developer sets a value on his/her time, he will hardly be happy to have his/her code published for everyone to use.

As we’ve decided, Telegram is not the best solution for building a messaging application. It don’t offer us neither an SDK nor a competent source code. So if Telegram works good, it will be a waste of time to charge your Telegram based app work well because their code is really strange and comfortless to build similar projects on it.

But if you aren’t afraid of challenges, you can have a try on building Telegram API based messenger and we can help you handle it. Feel free to contact us if you have any questions.