Posts

  • TestContainers

    Entegrasyon testleri yazı serisinin 4. bölümünde open source bir proje olan TestContainers‘ı tanıtmak istiyorum.

  • Docker ve Docker-Compose

    JUnit ve Docker yardımıyla entegrasyon testleri yazmayı anlattığım yazı serisinin 3. bölümünde docker ve docker-compose‘dan bahsedeceğim. Test otomasyonunun öneminden bahsettiğim serinin birinci yazısına buradan ve JUnit @Rule’larını anlatan serinin ikinci yazısına da buradan erişebilirsiniz.

  • JUnit @Rule'ları

    JUnit ve Docker kullanarak entegrasyon testleri yazmayı anlattığım yazı serisinin birinci bölümüne buradan erişebilirsiniz. Serinin bu ikinci yazısında, JUnit ve JUnit’in az bilinen fakat entegrasyon testleri yazarken kullanılması gereken bir özelliğinden, @Rule‘lardan bahsedeceğim. JUnit5‘e henüz geçmediğim için örnekler JUnit4 üzerinden olacak. Daha önce de yazdığım sebeplerden dolayı, bu yazı serisinde programlama dili olarak Kotlin kullanacağım.

  • Entegrasyon Testleri Yazmalı Mıyız?

    Yeni bir yazı serisine başlıyorum. Bu seride entegrasyon testlerini JUnit ve Docker yardımıyla nasıl yazdığımı anlatacağım. Serinin ilk bölümü olan bu yazıda entegrasyon testlerinin ne olduğundan ve neden entegrasyon testi yazmamız gerektiğinden bahsedeceğim.

  • Kotlin ile FizzBuzz

    Google IO 2017‘de uygulama geliştiricileri en çok heyecanlandıran haber Google’ın resmi olarak Kotlin programlama diline destek vermesi oldu. Bugüne kadar hakettiği ilgiyi göremeyen Kotlin, Google IO 2017 etkinliğinden sonra özellikle android developer’lar arasında hızla popüler olmaya başladı.

  • Kotlin'de Delegasyon

    Bir class’ı extend ettiğimizde sub-class ve super-class arasında kırılgan bir bağımlılık oluşur. Bu bağımlılığın kırılgan olmasının sebebi super-class’ta yapılan değişikliklerin sub-class’ların çalışmasını bozabilme riskidir. Inheritance’ın bu yan etkisi yüzünden Kotlin’de class’lar final‘dır (yani extend edilemezler). Eğer bir sınıfı genişletilebilir (extendable) yapmak istiyorsanız sınıfı open olarak tanımlamanız gerekir. open sınıflarda değişiklik yaparken bu değişikliklerden sub-sınıfların da etkilenebileceğini aklımızdan çıkartmamamız lazım.

  • Kotlin Sequences

    Java 8 ile beraber gelen Stream‘lerin Kotlin karşılığı Sequence‘lardır. Java ile aralarında bir isim çakışması olmasın diye Kotlin’de Sequence adı kullanılmış. Collection’lar ve map, filter, groupBy gibi higher-order fonksiyonlar ile veri işlemenin ne kadar kolay olduğunu bir önceki  yazıda görmüştük. Bu yazıda da Sequence’lardan yani lazy Collection‘lardan bahsedeceğiz. Sequence’lar sayesinde java 8 öncesini destekleyen platformlarda (örneğin Android) stream’lerın sağladığı avantajları kullanabilirsiniz. Sequence’ların, stream’lerden farklı olarak, birden fazla CPU’da çalışma destekleri yoktur.

  • Kotlin Collections

    Kotlin’de collection’lar, java collection library’leri üzerine yazılmış yardımcı sınıflar ve extension methodlardan oluşur. Kotlin programlama dilinin tasarımcıları, list, map ve set gibi veriyapılarını sıfırdan yazmak yerine, Kotlin collection altyapısını, mevcut java sınıflarının üzerine kurma kararı vermişler.

    Kotlin projesinin başındaki adam Andrey Breslav’dan bir alıntı yaparak kod örneklerine geçelim:

    “Kotlin relies on Java libraries but makes them better, mostly through extensions but sometimes with compiler-supported techniques (collections, arrays, primitives).”

    • Andrey Breslav, JetBrains
  • Kotlin Standard Library

    Kotlin Standard Library, Kotlin ile kod yazarken sürekli başvurulan bir araç kutusu olarak düşünülebilir. Standard Library ile ilgili dokümanlara buradan, kaynak koduna da buradan ulaşabilirsiniz. JDK üzerine inşa edilmiş ve JDK’nın Kotlin ile kullanılmasını sağlayan Standard Library içerisinde:

    • Collection ve Sequence sınıflarının kullanımını kolaylaştıran extension metodları
    • String, char dizileri ve regular expression’lar için extension’lar ve yardımcı sınıflar
    • JDK içindeki IO, threading ve dosya sistemi ile ilgili sınıfların Kotlin’den rahatça kullanılmasını sağlayan extension’lar ve yardımcı sınıflar
    • Bu yazıda üzerinde duracağımız, Kotlin’e özgü özel kalıplar yazmamızı sağlayan let apply with use, synchronized gibi higher-order functionlar vardır.
  • Kotlin ile "Instance" Oluşturma

    Bu yazıda Constructor‘lardan ve class instance’ları oluşturmanın farklı yöntemlerinden bahsedeceğim.

  • Kotlin Extensions

    C# programlama dilinden tanıdığımız Extension Method’ları, Kotlin de destekliyor. Extension’lar sayesinde (1) yeni bir türetilmiş tip yaratmadan (extend etmeden) (2) mevcut tipi değiştirip tekrar derlemeden, mevcut tiplere yeni özellikler ekleyebiliriz.

  • Kotlin Types

    Teknik konular hakkında Türkçe yazmak gerçekten çok zor. Bir çok kelimenin Türkçe karşılığını bulmakta zorlanıyorum. Yarı Türkçe yarı İngilizce yazmak hiç hoşuma gitmese de aklımdakileri bir an önce yazıya döküp paylaşmak için şimdilik çok fazla kafaya takmadan yazıyorum. Kimse kusura bakmasın lütfen.

  • Neden Kotlin?

    Neden olmasın?

    JetBrains 6 yıl önce Kotlin programlama dili üzerinde calismaya başlamış ve Kotlin 1.0 ‘ın duyurulmasının üzerinden 1 yıl geçmiş. Bu yazıyı Kotlin’i henüz denememiş olan Java yazılımcılarının Kotlin’i en azından bir kere denemeleri için kaleme alıyorum. Yeni bir programlama dili öğrenmenin kime ne zararı olabilir ki? Kotlin öğrenmenin şöyle bir yan etkisi olabiliyor baştan söyleyeyim : Bir daha Java ile kod yazmak istemeyebilirsiniz.

  • How To Customize Unity3d Hierarchy Window

    One of the many things I like about Unity is its customizable Editor. Although it crashes every few hours, its visual environment reduces development time. The Unity editor is very customizable, so that you can create custom tools for your needs.

  • Diving Into Arduino

    Last month I came a cross a video of a small dancing robot called OTTO. What makes OTTO special for me is that it is completely OpenSource. I am a professional software developer and I work with OpenSource software for years. But this little robot reminded me that hardware can also be open sourced. You can build a clone of this cute robot at home in a day : 3D print the moving parts, buy the required electronics, download the software and build the robot by reading the construction manual.

  • Unity Prefabs

    After working more than a year with unity, I decided to write down my takeaways from Unity prefabs system.

  • Reverse Engineering Apk Files

    The site Appbrain has a develoepr tools stats page that lists top used SDKs in android applications and games. Do you ever wonder how can we see which sdk an app uses? You can download an apk, open it and apply reverse engineering technics to convert the machine readable binary to human readable files.

  • Don't Use Constructors To Initialize Monobehaviours.

    Monobehaviours are building blocks of developing games in unity. You can create components and assign them to gameobjects to control their behaviour. You can think of components as scripts derived from monobehaviour base class.

  • Unity UI Performance Tips

    The new UI System is part of the Unity engine since release 4.6, and it is open source. The new UI System is becoming the defacto standard for building game UIs. It is getting better and better with each Unity release but you still need to pay attention to details while creating UIs unless you want to end up with an FPS suffering game. This post will list some of the best practices learned through experience while developing UI systems for our games.

  • Filtering Unity Logs With Logcat (Android)

    Android application logs can be viewed with the adb logcat command. For more adb commands you can read this post. UnityEngine.Debug.Log(string message) writes message to the console with the stacktrace information that follows immediately after any custom message you specify. IMHO these extra stacktrace information is not needed - does not makes our lives easier while debuging unity games on an android device.

  • UV Mapping (of a Cube)

    Previous post was about creating a cube mesh. This post will show how a 2D image can be projected to a 3D model’s surface (aka UV Mapping).

  • Creating a Cube Mesh In Unity3D

    Meshes are created from very simple elements, points and lines. The points are called vertices, and a single point is called a vertex. Vertices define points in 3D space. In Unity3D, three connected vertices form a triangle and these triangles define the mesh of objects.

  • Finite State Machines

    Applications written in Object Oriented Programming (OOP) languages have states and the logic is highly dependent on the current state of the application. And games are no exception. For example, rendering and animation code might change depending on whether our hero character is currently running, jumping or attacking an enemy. The “brain” that controls the enemies in the game might be in different states such as “chase player”, “dead”, “flee from player”. States are everywhere, we need to implement them carefully unless we want to end up with a system full of if and switch statements.

  • Observer Pattern and Lapsed Listener Problem

    We are using Model View Controller (MVC) architectural pattern to build mobile apps and games. MVC helps us decouple views from the rest of the application, so we can change the user interface without changing any model or logic in our app.

  • Free Software Licences

    Global developer conference Istanbul Tech Talks 2016 sponsored by PeakGames has been held in Istanbul last week. For the ones who missed ITT2016, session videos will be available in youtube channel soon.

  • Istanbul Tech Talks 2016

    Peak Games‘in katkilariyla hayata gecen Istanbul Tech Talks‘un bu yil ucuncusu duzenleniyor. Istanbul’da yazilim gelistiricileri bulusturan bu global etkinlige her yil efsane isimler katiliyor. Hatta bu sene konusmacilar arasinda Richard Stallman var.

  • Effectively Final Variables in Java

    Java 8 introduced a new term : effectively final variables. A variable which is not declared as final but whose value is never changed after initialization is effectively final.

  • Unity UI Drag Threshold

    If you have a unity project running on High DPI devices like Samsung Galaxy S5 or Samsung Galaxy S6, you may have issues pressing buttons because very small movements in finger touch can be interpreted as scrolling rather than a simple touch.

  • Writing Integration Tests For Unity3D Projects

    This is the 4th and the last post of series, Testing Unity Projects. After being sure that every unit (class) works as expected, we should also check how classes collaborate with each other by writing integration tests.

  • Dependency Injection For Unity3D Projects (StrangeIoC)

    The terms Dependency Injection (DI) and Inversion of Control (IoC) are generally used interchangeably to describe the same design pattern. Software can be viewed as a collection of objects collaborating with each other to perform a defined task. Without dependency injection, each object is responsible for obtaining references to its collaborators and this leads to highly coupled classes and hard to test code.

  • The Joy Of Mocking With NSubstitute

    While writing unit test, the class under test may have dependencies. And these dependencies may be impossible to instantiate in a test fixture or they may be very difficult to setup. To make unit testing simpler and to focus on the code being tested, not on the behavior or state of external dependencies, software craftsmen use the technique called mocking.

  • Testing Unity Projects

    Professional software developers write automated tests. It is not because they make a lot of mistakes, it is because :

  • Don't Make Commuting Ruin Your Life

    Commuting to work is something inevitable for me. I’ve been spending nearly three hours a day on my way between home and work. It is almost one fifth of my awake life. Or in other words 40 days in a year. That’s a lot of time to waste.

  • How To Make a Custom Syntax Highlighting for Sublime Text

    Sublime Text editor has built-in syntax highlighting support for too many languages. In case none of the supported highlightings covers your needs you can create your own. The idea of writing custom syntax definitions first came to light (for me) while looking at the log files generated by one of our games (By the way, I am working at PeakGames and we are building awesome mobile games). If the log file contains a lot of information it may be difficult to see the most important parts. Using tools like grep does not really help if you want to see the whole context.

  • adb Tips

    The official Android Developers page has a detailed documentation about Android Debug Bridge (adb). This post summarizes the adb commands that I (an android game developer) use daily.

subscribe via RSS